Skip to content

Commit

Permalink
RavenDB-22849 - handle temporary mixed version state, don't delete an…
Browse files Browse the repository at this point in the history
…y cx tombstones
  • Loading branch information
lastav5 committed Jan 22, 2025
1 parent 48cff1a commit 0e00bde
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ private Dictionary<string, DatabaseStatusReport> CollectDatabaseInformation(Tran
var report = new DatabaseStatusReport
{
Name = dbName,
NodeName = _server.NodeTag
NodeName = _server.NodeTag,
BackupStatuses = new()
};

prevReport.TryGetValue(dbName, out var prevDatabaseReport);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class DatabaseStatusReport : IDynamicJson

public Dictionary<string, ObservedIndexStatus> LastIndexStats = new Dictionary<string, ObservedIndexStatus>();
public Dictionary<string, long> LastSentEtag = new Dictionary<string, long>();
public Dictionary<long, PeriodicBackupStatusReport> BackupStatuses = new ();
public Dictionary<long, PeriodicBackupStatusReport> BackupStatuses;

public long LastCompareExchangeIndex { get; set; }
public long LastClusterWideTransactionRaftIndex { get; set; }
Expand Down
6 changes: 6 additions & 0 deletions src/Raven.Server/ServerWide/Maintenance/ClusterObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,12 @@ private CompareExchangeTombstonesCleanupState GetMaxCompareExchangeTombstonesEta
if (hasReport == false)
return CompareExchangeTombstonesCleanupState.InvalidDatabaseObservationState;

if (report.BackupStatuses == null)
{
// the node wasn't updated to a version that supports it
return CompareExchangeTombstonesCleanupState.InvalidPeriodicBackupStatus;
}

foreach (var (taskId, status) in report.BackupStatuses)
{
if (status == null)
Expand Down

0 comments on commit 0e00bde

Please sign in to comment.