Skip to content

Commit 3cc1c0a

Browse files
Fix RCU test by not reusing BC from disposed store
1 parent f93b21f commit 3cc1c0a

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

libs/storage/Tsavorite/cs/src/core/Allocator/BlittableAllocatorImpl.cs

+2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ public long GetPhysicalAddress(long logicalAddress)
156156

157157
// Index of page within the circular buffer
158158
var pageIndex = (int)((logicalAddress >> LogPageSizeBits) & (BufferSize - 1));
159+
160+
Debug.Assert(IsAllocated(pageIndex));
159161
return (long)(pointers[pageIndex] + offset);
160162
}
161163

libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs

+2
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ public long GetPhysicalAddress(long logicalAddress)
236236

237237
// Index of page within the circular buffer
238238
var pageIndex = (int)((logicalAddress >> LogPageSizeBits) & (BufferSize - 1));
239+
240+
Debug.Assert(IsAllocated(pageIndex));
239241
return (long)(pointers[pageIndex] + offset);
240242
}
241243

libs/storage/Tsavorite/cs/test/MiscTests.cs

+1
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public void ForceRCUAndRecover([Values(UpdateOp.Upsert, UpdateOp.Delete)] Update
198198

199199
_ = store.Recover(token);
200200
session = store.NewSession<InputStruct, OutputStruct, Empty, FunctionsCopyOnWrite>(copyOnWrite);
201+
bContext = session.BasicContext;
201202

202203
using (var iterator = store.Log.Scan(store.Log.BeginAddress, store.Log.TailAddress))
203204
{

0 commit comments

Comments
 (0)