Skip to content

Commit b94cdc4

Browse files
MichaluxPLleonardoce
authored andcommitted
feat(wal): parallel WAL archiving
Signed-off-by: MichaluxPL <[email protected]>
1 parent e00024f commit b94cdc4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/cnpgi/common/wal.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ func (w WALServiceImplementation) Archive(
107107
if err != nil {
108108
return nil, err
109109
}
110-
walList := arch.GatherWALFilesToArchive(ctx, request.GetSourceFileName(), 1)
110+
barmanConfiguration := &objectStore.Spec.Configuration
111+
maxParallel := 1
112+
if barmanConfiguration.Wal != nil && barmanConfiguration.Wal.MaxParallel > 1 {
113+
maxParallel = barmanConfiguration.Wal.MaxParallel
114+
}
115+
walList := arch.GatherWALFilesToArchive(ctx, request.GetSourceFileName(), maxParallel)
111116
result := arch.ArchiveList(ctx, walList, options)
112117
for _, archiverResult := range result {
113118
if archiverResult.Err != nil {

0 commit comments

Comments
 (0)