Repository navigation
[Store] Add immutable bucket allocator for DFS replicas - #4124
Merged
Merged
Conversation
wp-bc
force-pushed
the
bucket/immutable-bucket-allocator
branch
2 times, most recently
from
September 15, 2026 08:19
65be7e6 to
585bd21
Compare
wp-bc
marked this pull request as ready for review
September 15, 2026 08:21
wp-bc
requested review from
ShangmingCai,
UNIDY2002,
XucSh,
YiXR,
alogfans,
staryxchen,
stmatengss and
ykwd
as code owners
September 15, 2026 08:21
wp-bc
force-pushed
the
bucket/immutable-bucket-allocator
branch
from
September 15, 2026 10:45
585bd21 to
8ab0e9e
Compare
16 of 31 tasks
fcczzz
reviewed
Sep 17, 2026
1 task done
fcczzz
reviewed
Sep 18, 2026
fcczzz
reviewed
Sep 18, 2026
wp-bc
force-pushed
the
bucket/immutable-bucket-allocator
branch
from
September 20, 2026 06:05
8d47b33 to
c688f5a
Compare
fcczzz
reviewed
Sep 20, 2026
wp-bc
force-pushed
the
bucket/immutable-bucket-allocator
branch
from
September 20, 2026 08:56
e2a639c to
9c98e60
Compare
fcczzz
reviewed
Sep 21, 2026
wp-bc
force-pushed
the
bucket/immutable-bucket-allocator
branch
from
September 22, 2026 03:40
21a4ef5 to
9980663
Compare
fcczzz
reviewed
Sep 22, 2026
ykwd
approved these changes
Sep 22, 2026
8 of 32 tasks
8 of 36 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements the DFS immutable Bucket allocator proposed in:
It introduces a pluggable
GlobalAllocatorInterfacefor DFS replica allocation while preserving the existingDfsGlobalAllocatoras the defaultshardimplementation.A new
ImmutableBucketAllocatorcan be selected with:The Bucket allocator stores objects as aligned, append-only immutable entries in fixed-capacity Bucket files. Buckets are created on demand and reclaimed in LRU order.
The existing
DistributedFSDescriptorwire format is unchanged. In Bucket mode, the existingshard_idxfield carries the Bucket ID, preserving serialization compatibility.Main changes
Pluggable DFS allocator
GlobalAllocatorInterfaceas the Master-facing DFS allocation contract.DfsGlobalAllocatorto implement the interface.shardas the default allocator with unchanged behavior.shardandbucket.Immutable Bucket allocation
Create fixed-capacity Bucket files on demand.
Store values as aligned, append-only entries:
Track entries through
PENDING,COMMITTED, andTOMBSTONEstates.Never overwrite entries or reuse tombstoned or rolled-back ranges.
Assign monotonically increasing Bucket IDs.
Allow ordered batch allocation across multiple Buckets.
Roll back all reservations if any allocation in a batch fails.
Match complete descriptors when committing, freeing, or updating entries.
Seal full Buckets and create new ones up to the configured limit.
Bucket-level LRU eviction
Synchronous buffered Bucket I/O
Master and Client integration
PROCESSING, then commit them inPutEndbefore publication.shardmode.Configuration
The following settings are introduced:
MOONCAKE_DFS_ALLOCATOR=shard | bucket MOONCAKE_DFS_BUCKET_CAPACITY=1073741824 MOONCAKE_DFS_MAX_BUCKET_COUNT=64The existing DFS settings continue to configure common filesystem and eviction behavior:
MOONCAKE_DFS_BUCKET_CAPACITYmust be nonzero, aligned toMOONCAKE_DFS_ALIGNMENT, and representable by the filesystem interface.MOONCAKE_DFS_MAX_BUCKET_COUNTmust be positive.Documentation
Compatibility
shardremains the default allocator with unchanged allocation, eviction, and I/O behavior.DistributedFSDescriptorserialization remains unchanged, so existing clients can continue using shard descriptors without configuration changes.bucketmode.Module
mooncake-transfer-engine)mooncake-store)mooncake-conductor)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Validation was performed in an isolated Linux build environment using GCC 11.4 and Ninja.
Build command:
cmake -S . -B build -G Ninja \ -DBUILD_UNIT_TESTS=ON \ -DWITH_STORE=ON \ -DUSE_CUDA=OFF \ -DUSE_HIP=OFF \ -DUSE_HYGON=OFF \ -DUSE_3FS=OFF \ -DUSE_TCP=ON cmake --build build --target \ dfs_immutable_bucket_allocator_test \ dfs_immutable_bucket_backend_test \ dfs_immutable_bucket_client_test \ distributed_storage_config_testTest results:
dfs_immutable_bucket_allocator_test: 8/8 passeddfs_immutable_bucket_backend_test: 3/3 passeddfs_immutable_bucket_client_test: 2/2 passeddistributed_storage_config_test: 10/10 passedgit diff --check main...HEAD: passedCoverage includes:
Documentation validation:
Sphinx read and rendered all 100 source pages.
The new design page and navigation entry were generated successfully.
Strict warning handling encountered one external intersphinx TLS fetch failure; no warning originated from the new documentation.
Unit tests pass
Integration tests pass (in-process POSIX integration)
Manual testing done (describe below)
Checklist
./scripts/code_format.shRFC: #3641
AI Assistance Disclosure