diff --git a/src/ZoneTree/Segments/InMemory/MutableSegment.cs b/src/ZoneTree/Segments/InMemory/MutableSegment.cs index fb134ef..1e80d9b 100644 --- a/src/ZoneTree/Segments/InMemory/MutableSegment.cs +++ b/src/ZoneTree/Segments/InMemory/MutableSegment.cs @@ -207,12 +207,18 @@ public AddOrUpdateResult Delete(in TKey key, out long opIndex) try { Interlocked.Increment(ref WritesInProgress); - opIndex = 0; + if (IsFrozenFlag) + { + opIndex = 0; return AddOrUpdateResult.RETRY_SEGMENT_IS_FROZEN; + } if (BTree.Length >= MutableSegmentMaxItemCount) + { + opIndex = 0; return AddOrUpdateResult.RETRY_SEGMENT_IS_FULL; + } TValue insertedValue = default;