From c9c691c3838f3e906b8e5d853a8239a8d7feda6e Mon Sep 17 00:00:00 2001 From: MichaluxPL <68371308+MichaluxPL@users.noreply.github.com> Date: Tue, 15 Apr 2025 12:27:36 +0200 Subject: [PATCH] feat(wal): parallel WAL archiving Signed-off-by: MichaluxPL <68371308+MichaluxPL@users.noreply.github.com> --- internal/cnpgi/common/wal.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/cnpgi/common/wal.go b/internal/cnpgi/common/wal.go index 586991d..05636a8 100644 --- a/internal/cnpgi/common/wal.go +++ b/internal/cnpgi/common/wal.go @@ -107,7 +107,12 @@ func (w WALServiceImplementation) Archive( if err != nil { return nil, err } - walList := arch.GatherWALFilesToArchive(ctx, request.GetSourceFileName(), 1) + barmanConfiguration := &objectStore.Spec.Configuration + maxParallel := 1 + if barmanConfiguration.Wal != nil && barmanConfiguration.Wal.MaxParallel > 1 { + maxParallel = barmanConfiguration.Wal.MaxParallel + } + walList := arch.GatherWALFilesToArchive(ctx, request.GetSourceFileName(), maxParallel) result := arch.ArchiveList(ctx, walList, options) for _, archiverResult := range result { if archiverResult.Err != nil {