Skip to content

Commit 81efdb4

Browse files
authored
Replay pending deletions on QueueManager.Initialize (#151)
DeliveredPositionsId was migrated in d8fefad from a parent-with-children layout to a single List<long> value, but Initialize still scanned for children — which no writer produces anymore. Restarted flows therefore never replayed pending message deletions. Read the persisted List<long> directly, matching the AfterFlush write pattern.
1 parent 50defdb commit 81efdb4

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

Core/Cleipnir.ResilientFunctions/Queuing/QueueManager.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,11 @@ private async Task Initialize()
8383

8484
_idempotencyKeys.Initialize();
8585

86-
var children = _effect.GetChildren(DeliveredPositionsId);
87-
var positions = new List<long>();
88-
foreach (var childId in children)
89-
{
90-
var position = _effect.Get<long>(childId);
91-
positions.Add(position);
92-
}
93-
94-
if (positions.Any())
86+
if (_effect.TryGet<List<long>>(DeliveredPositionsId, out var positions) && positions is { Count: > 0 })
9587
{
9688
await _messageStore.DeleteMessages(_storedId, positions);
97-
foreach (var childId in children)
98-
await _effect.Clear(childId, flush: false);
89+
positions.Clear();
90+
_effect.FlushlessUpsert(DeliveredPositionsId, positions, alias: null);
9991
}
10092

10193
_initialized = true;

0 commit comments

Comments
 (0)