Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ async Task StreamingSnapshotDriver()
await Task.Yield();

// Get sync metadata for checkpoint
await PrepareForSync();
var fullSync = await PrepareForSync();

// Stream checkpoint to replicas
await TakeStreamingCheckpoint();
if (fullSync)
await TakeStreamingCheckpoint();

// Notify sync session of success success
for (var i = 0; i < NumSessions; i++)
Expand All @@ -215,7 +216,7 @@ async Task StreamingSnapshotDriver()
}

// Acquire checkpoint and lock AOF if possible
async Task PrepareForSync()
async Task<bool> PrepareForSync()
{
if (disklessRepl)
{
Expand All @@ -235,6 +236,7 @@ async Task PrepareForSync()
#endregion

#region initializeConnection
var fullSync = false;
for (var i = 0; i < NumSessions; i++)
{
try
Expand All @@ -257,6 +259,7 @@ async Task PrepareForSync()
{
// Reset replica database in preparation for full sync
Sessions[i].SetFlushTask(Sessions[i].ExecuteAsync(["CLUSTER", "FLUSHALL"]));
fullSync = true;
}
}
catch (Exception ex)
Expand All @@ -268,6 +271,8 @@ async Task PrepareForSync()

await WaitForFlush();
#endregion

return fullSync;
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ public void ClusterAofReplayDisklessSync([Values] bool disableObjects, [Values]

// Validate replica data
Validate(primaryIndex, replicaIndex, disableObjects);

// Wait for replica to catch up
Comment thread
vazois marked this conversation as resolved.
context.clusterTestUtils.WaitForReplicaAofSync(primaryIndex, replicaIndex, logger: context.logger);
}

/// <summary>
Expand Down