Conversation
More Comments in BufferAndLoad Fix RandomReadCacheTest input failure
… for tests; make some ReadAtAddrss and Reviv tests [Explicit] temporarily. A couple Garnet test fixes for required minimum page count
Fix MultiDBManager not propagating SizeTracker start when adding a DB Fix SortedSetOps using wrong context Fix Recovery not propagating LastPageFreed Remove SizeTracker fields that duplicated LogSizeTracker Fix Recovery eviction-range calculations Disable some tests temporarily until they can be converted
There was a problem hiding this comment.
Pull request overview
This PR implements major changes to CacheSizeTracker and LogSizeTracker to enable fine-grained HeadAddress movement (not constrained to page boundaries), combining inline log space and heap size limits into a unified memory target. The implementation automatically enables size tracking when memorySize is specified, and introduces the ability to specify pageCount independently. The PR also removes the EmptyPageCount property in favor of MaxAllocatedPageCount.
Changes:
- Renamed configuration properties from
MemorySize/HeapMemorySizetoLogMemorySizewith combined inline+heap tracking - Added
PageCountconfiguration option to allow specifying page count independent of memory size - Replaced
EmptyPageCountwithMaxAllocatedPageCount(nowHighWaterAllocatedPageCount) - Implemented fine-grained eviction that can clear individual records within pages
- Updated size tracking to use observer pattern and track both inline and heap memory together
Reviewed changes
Copilot reviewed 129 out of 130 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ServerOptions.cs | Renamed MemorySize to LogMemorySize, added PageCount, renamed IndexSize to IndexMemorySize |
| GarnetServerOptions.cs | Removed HeapMemorySize/ReadCacheHeapMemorySize, added ReadCachePageCount, updated logging |
| KVSettings.cs | Changed MemorySize to LogMemorySize, added PageCount, removed MinEmptyPageCount |
| LogSettings.cs | Updated to use MemorySize (long) instead of MemorySizeBits, added PageCount |
| CacheSizeTracker.cs | Removed LogSizeCalculator, updated to track combined inline+heap memory |
| TestUtils.cs | Updated test utilities to use new configuration names and pageCount parameter |
| Various test files | Updated memory size parameters and adjusted for new MinTargetPageCount requirements |
| Allocator implementations | Updated FreePage logic to check logSizeTracker instead of EmptyPageCount |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix some issues (resulting from going to GC.AllocateArray) with reusing allocator pages. Replace the last NativeMemory allocations in Allocator with GC.AllocateArray.
Move FreePage() up to just below Alloc/ReturnPage() so they're together
Major features:
There are a number of temporarily [Explicit] tests that still require work to modify from the previous implementation; that work is in progress.