From 018944b15fd48aa8ae7dffa86829d49d1788ad9f Mon Sep 17 00:00:00 2001 From: Marco Nenciarini Date: Thu, 16 Jan 2025 10:17:35 +0100 Subject: [PATCH] fix(PITR): compare TargetLSN with backup EndLSN instead of BeginLSN (#56) Closes #6536 Signed-off-by: Marco Nenciarini --- pkg/catalog/catalog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/catalog/catalog.go b/pkg/catalog/catalog.go index 123d892..c985fac 100644 --- a/pkg/catalog/catalog.go +++ b/pkg/catalog/catalog.go @@ -183,7 +183,7 @@ func (catalog *Catalog) findClosestBackupFromTargetLSN( if (strconv.Itoa(barmanBackup.TimeLine) == targetTLI || // if targetTLI is not an integer, it will be ignored actually currentTLIRegex.MatchString(targetTLI)) && - types.LSN(barmanBackup.BeginLSN).Less(targetLSN) { + types.LSN(barmanBackup.EndLSN).Less(targetLSN) { return &catalog.List[i], nil } }