Skip to content

[Bugfix] Align NoF allocation offsets to the namespace block size - #4024

Open
cage-goat wants to merge 2 commits into
kvcache-ai:mainfrom
cage-goat:nof-block-size-reporting
Open

[Bugfix] Align NoF allocation offsets to the namespace block size#4024
cage-goat wants to merge 2 commits into
kvcache-ai:mainfrom
cage-goat:nof-block-size-reporting

Conversation

@cage-goat

Copy link
Copy Markdown

Description

Fixes #4021

NoF allocations could return offsets that were not aligned to the namespace block size, causing the client to reject I/O during alignment checks.

This PR addresses the problem in two commits:

  • Report each namespace's block_size from the existing bdev query, or accept an explicit value through the C++/Python registration APIs
  • Use the namespace block size as the minimum allocation unit for NoF and reject segments with unaligned bases or sizes

NoF block sizes must be powers of two and at least 512 bytes. The registration APIs now require block_size, and the NoFSegment RPC schema changes. Masters and clients exchanging this type must be upgraded together.

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Reshard (mooncake-reshard)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

Test results:

  • Unit tests pass
  • Integration tests pass (if applicable)
  • [] Manual testing done (describe below)

Checklist

  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh
  • I have run pre-commit on the files changed in this PR and all hooks pass
  • I have updated the documentation (if applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specify below)

Codex assisted with analysis, implementation, tests, and build verification.

Pass block_size through the Python/C++ registration APIs and
NoFSegment RPC serialization.

Reject block sizes below 512 bytes or not powers of two, and update
NoF fixtures and validation tests.

Signed-off-by: Cage Chen <cage@arcfra.com>
NoF allocations could start at offsets that were not aligned to
the namespace block size, causing I/O submission to fail.

Use the namespace block size as the minimum allocation unit.
Reject segment bases and sizes that are not block-aligned.

Signed-off-by: Cage Chen <cage@arcfra.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: NoF offset allocator can return offsets that are not aligned to the namespace block size

1 participant