Skip to content

Fix MLPA tail increment; add cmdline options to Garnet BDN#1872

Merged
badrishc merged 6 commits into
mainfrom
tedhar/mlpa-fix
Jun 15, 2026
Merged

Fix MLPA tail increment; add cmdline options to Garnet BDN#1872
badrishc merged 6 commits into
mainfrom
tedhar/mlpa-fix

Conversation

@TedHartMS

Copy link
Copy Markdown
Contributor
  • Changed MultiLevelPageArray to use PageOffset for its tail and incrementing, fixing a rare lost-id
  • Add cmdline options to Garnet BDN, replacing the environment-variable approach

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Tsavorite’s MultiLevelPageArray allocation scheme to use a packed (Page, Offset) tail (via PageOffset) to avoid rare lost/duplicated ids under concurrent page growth and retry paths, and modernizes the Garnet BenchmarkDotNet harness to accept command-line options instead of environment variables.

Changes:

  • Refactors MultiLevelPageArray<TElement> to use a PageOffset-backed tail with Interlocked.Add/Exchange coordination for page turns (including a DEBUG-only AddPage failure injection hook).
  • Adds/updates Tsavorite recovery tests to stress the OOM rewind-and-retry path deterministically in DEBUG builds.
  • Adds BenchmarkDotNet CLI parsing for framework selection and operations parameter selection (--frameworks/--fw, --opparams/--op).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
libs/storage/Tsavorite/cs/test/test.recovery/ObjectIdMapTests.cs Renames allocation loop terminology and adds a DEBUG-only multi-thread OOM stress test using the new MLPA injection hook.
libs/storage/Tsavorite/cs/src/core/Utilities/SimpleConcurrentStack.cs Updates Clear parameter naming to “retainedPageCount” to align with MLPA terminology.
libs/storage/Tsavorite/cs/src/core/Utilities/MultiLevelPageArray.cs Core change: packed tail (PageOffset) allocation protocol + page growth path refactor + DEBUG-only failure injection hook.
libs/storage/Tsavorite/cs/src/core/Allocator/PageUnit.cs Clarifies PageOffset.Offset semantics via doc comment.
libs/storage/Tsavorite/cs/src/core/Allocator/ObjectIdMap.cs Adjusts assertions and clear-retention constants to match MLPA’s new Count/tail semantics.
benchmark/BDN.benchmark/Program.cs Adds custom CLI arg consumption and wires it into BDN configuration; replaces env-var behavior.
benchmark/BDN.benchmark/Operations/OperationsBase.cs Reworks operation parameter gating to be driven by CLI-selected flags (and adds a helper to set all flags).

Comment thread libs/storage/Tsavorite/cs/src/core/Utilities/MultiLevelPageArray.cs
Comment thread libs/storage/Tsavorite/cs/src/core/Utilities/MultiLevelPageArray.cs
Comment thread libs/storage/Tsavorite/cs/src/core/Utilities/MultiLevelPageArray.cs
Comment thread benchmark/BDN.benchmark/Program.cs Outdated
Comment thread benchmark/BDN.benchmark/Program.cs
Comment thread benchmark/BDN.benchmark/Program.cs Outdated
Comment thread benchmark/BDN.benchmark/Operations/OperationsBase.cs
@badrishc badrishc merged commit 7b914ef into main Jun 15, 2026
195 checks passed
@badrishc badrishc deleted the tedhar/mlpa-fix branch June 15, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants