Skip to content

Commit

Permalink
RavenDB-21936 Fixing the allocation size for a counter group name whe…
Browse files Browse the repository at this point in the history
…n purging counter tombstones
  • Loading branch information
arekpalinski committed Jan 15, 2024
1 parent c709374 commit a54b4a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Raven.Server/Documents/CountersStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ private long PurgeCounters(long upto, DocumentsOperationContext context, Collect
table.DeleteByKey(counterGroupKey);

names.GetPropertyByIndex(1, ref prop);
using var newScope = context.Allocator.Allocate(CounterKeysSlice.Size + 1 /* separator */ + 1 /* replace the current name with next one in counters group */, out ByteString newCounterKey);
using var newScope = context.Allocator.Allocate(documentKeyPrefix.Size /* it includes the separator already */ + prop.Name.Size /* replace the current name with next one in counters group */, out ByteString newCounterKey);
documentKeyPrefix.CopyTo(newCounterKey.Ptr);
Memory.Copy(newCounterKey.Ptr + documentKeyPrefix.Size, prop.Name.Buffer, prop.Name.Size);
Slice.From(context.Allocator, newCounterKey.Ptr, documentKeyPrefix.Size + prop.Name.Size, out counterGroupKey);
Expand Down

0 comments on commit a54b4a6

Please sign in to comment.