Repository navigation
Conversation
04b37c8 to
9430f51
Compare
|
I think this PR combines four substantial changes:
Would you be open to splitting these into separate PRs? We could start with a functional bucket backend using synchronous writes and regular reads, then follow up with separate PRs for recovery, asynchronous writes, and direct I/O optimizations. For recovery, there is an existing RFC: #3819. Could we discuss the alternatives there and agree on which approach to adopt, particularly what the allocator should restore versus what the Master should restore? Asynchronous writes change what a successful Put means and would benefit from a separate discussion. Ideally, this behavior should be independent of the allocator type. O_DIRECT and the other read optimizations could also be evaluated separately with correctness tests and benchmarks. This would make each change easier to review and validate. Are there dependencies between these pieces that you think require them to land together? |
Thanks for the detailed feedback. That makes sense, and we are happy to split this PR along the boundaries you suggested.
Regarding #3819, is anyone currently implementing it? If so, could you share the current progress or an implementation branch? We would be glad to align the bucket recovery work with it and avoid introducing a competing recovery model. However, you are right that the caller-visible semantics still change: BatchPut may return success after the synchronous replica has completed but before the deferred DFS write and its finalization have completed. Therefore, a successful return no longer necessarily means that all requested replica writes have finished. We will remove this behavior from the initial bucket PR and discuss it separately as an allocator-independent feature, including whether it should use an explicit async API/configuration and how background failures, retries, cancellation, and shutdown should be reported. We will prepare the first reduced PR around the synchronous, buffered-I/O bucket backend and follow up with the other pieces separately. Thanks again for helping us make the review scope clearer. |
|
@wp-bc Thanks, the proposed split sounds good. Regarding #3819, yes—we have an implementation in progress in draft PR #4018. It covers shard allocator metadata persistence and reconciliation with the Master snapshot. The bucket backend may need a different persistence mechanism from the shard allocator's checkpoint/WAL. Let's discuss the alternatives in #3819 and agree on the recovery semantics, particularly how to handle entries present on only one side. |
Following the submission plan we discussed, I’ve opened PR #4124 covering the basic Bucket functionality. When you have a chance, could you please help review it? |
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 append-only immutable entries. Bucket files are created on demand, sealed metadata is persisted for standalone restart recovery, and physical space is reclaimed by evicting complete Buckets in LRU order.
The existing
DistributedFSDescriptorwire format is unchanged. In Bucket mode, the existingshard_idxfield carries the Bucket ID, preserving descriptor serialization compatibility.Main changes
Pluggable DFS allocator
GlobalAllocatorInterfaceas the Master-facing DFS allocation contract.DfsGlobalAllocatorto implement the interface.shardas the default allocator with its existing behavior.ImmutableBucketAllocatorfollowing the terminology used by RFC [RFC]: DFS replica: extract GlobalAllocator interface and add ImmutableBucketAllocator #3641.Immutable Bucket allocation
Metadata and recovery
The active Bucket is intentionally not persisted. After an abrupt restart, it is discarded, while committed entries in sealed Buckets are recovered.
Bucket-level LRU eviction
Batch I/O and direct reads
BatchWrite.BatchReadrequests by Bucket and process independent Buckets in parallel.O_DIRECTreads with aligned pooled staging buffers.O_DIRECT.Master and Client integration
PROCESSINGuntil the write succeeds and the Master commits them.Configuration and administration
The following settings are introduced or documented:
The active Bucket limit can be changed online through:
The endpoint validates the JSON type and range. Values must be in
[1, INT32_MAX], and the endpoint returns a conflict response when the active allocator is not the Bucket allocator.Lowering the limit below the current Bucket count does not delete existing Buckets immediately. It prevents additional Bucket creation until the count falls below the configured limit.
Compatibility
shardremains the default allocator.DistributedFSDescriptorserialization is unchanged.Known limitations
fsyncdurability guarantee.Module
mooncake-transfer-engine)mooncake-store)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 a Linux build environment. The host contains vendor-modified RDMA headers, so an upstream-compatible verbs include path was supplied through:
Build command:
Test results:
dfs_immutable_bucket_allocator_test: 51/51 passeddfs_immutable_bucket_backend_test: 50/50 passeddfs_immutable_bucket_client_test: 7/7 passeddfs_posix_test: 27/27 passeddfs_sync_client_test: 7 passed, 1 checksum test skipped becauseMOONCAKE_STORE_CHECKSUMwas disabledgit diff --check 2b3cefbac4d571bcb001db3aa702772b41b8c647...HEAD: passedCoverage includes:
max_bucket_countupdates and validationNot yet run in the current environment:
The required 3FS/HF3FS service, Sphinx toolchain, pre-commit, and
clang-format-20are not available on the validation host.Checklist
./scripts/code_format.shRFC: #3641
AI Assistance Disclosure
Codex was used to audit the internal implementation against the community baseline, identify already-upstream functionality, port and adapt the Bucket-specific changes, prepare tests and documentation, and assist with local validation.
The human submitter is responsible for reviewing, understanding, and defending every changed line before this PR is marked ready for review.