Single-file CommitBatch: a deleted key the batch also upserts reaches the judge as its removal half
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ad51e45183
commit
60474bd2b3
1 changed files with 3 additions and 1 deletions
|
|
@ -4560,7 +4560,9 @@ namespace GameCult.Caching
|
|||
return CultCommitOutcome.Mismatch;
|
||||
|
||||
var (upserts, removals) = StagedWrites(request.Upserts, request.Deletes);
|
||||
var written = ApplyWriteSet(disk, upserts, removals, request.Checks);
|
||||
// A key the batch deletes and also upserts is a retype: the upsert wins in the write set, so the deletion travels as a check,
|
||||
// and the judge reads the key as the removal it names.
|
||||
var written = ApplyWriteSet(disk, upserts, removals, request.Checks.Concat(request.Deletes.Select(entry => entry.Key.Value)));
|
||||
foreach (var entry in request.Deletes)
|
||||
Entries.TryRemove(entry.Key.Value, out _);
|
||||
foreach (var entry in request.Upserts)
|
||||
|
|
|
|||
Loading…
Reference in a new issue