fix(restore): add 100ms delay between database restores
Ensures PostgreSQL fully closes connections before starting next restore, preventing potential connection pool exhaustion during rapid sequential cluster restores.
This commit is contained in:
@@ -1203,6 +1203,9 @@ func (e *Engine) RestoreCluster(ctx context.Context, archivePath string) error {
|
||||
completedDBTimesMu.Unlock()
|
||||
|
||||
atomic.AddInt32(&successCount, 1)
|
||||
|
||||
// Small delay to ensure PostgreSQL fully closes connections before next restore
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
}(dbIndex, entry.Name())
|
||||
|
||||
dbIndex++
|
||||
|
||||
Reference in New Issue
Block a user