[client][server][paimon] Complete historical partition writes - #4120
Open
luoyuxia wants to merge 4 commits into
Open
[client][server][paimon] Complete historical partition writes#4120luoyuxia wants to merge 4 commits into
luoyuxia wants to merge 4 commits into
Conversation
luoyuxia
force-pushed
the
fip28-historical-write-recovery-tiering
branch
2 times, most recently
from
August 27, 2026 03:00
7de8d5e to
dd7af7f
Compare
luoyuxia
force-pushed
the
fip28-historical-write-recovery-tiering
branch
2 times, most recently
from
August 28, 2026 01:25
b535ef8 to
5f89e36
Compare
Route writes for expired partitions through internal historical targets while preserving original partition metadata across PUT_KV and PRODUCE_LOG. Tier historical KV and log records back to their original Paimon partitions, fail writes to confirmed missing targets, and safely clean fully tiered historical KV overlays with leader-epoch and offset guards. Co-Authored-By: Codex <noreply@openai.com> AI-Model: gpt-5 AI-Contributed/Feature: 1111/1469 AI-Contributed/UT: 1829/2215
Simplify historical write routing, request handling, and Paimon tiering integration while removing redundant tests. Co-Authored-By: Codex <noreply@openai.com> AI-Model: gpt-5 AI-Contributed/Feature: 446/446 AI-Contributed/UT: 576/576
Bind historical write state to the active KV overlay and defer idle cleanup until its deadline after lake progress catches up. Co-Authored-By: Codex <noreply@openai.com> AI-Model: gpt-5 AI-Contributed/Feature: 234/234 AI-Contributed/UT: 129/129
luoyuxia
force-pushed
the
fip28-historical-write-recovery-tiering
branch
from
August 28, 2026 01:43
5f89e36 to
8bdabb3
Compare
Update the Paimon Arrow batch test for the historical-write parameters and adapt the historical lookup assertion to ByteArraySlice. Co-Authored-By: Codex <noreply@openai.com> AI-Model: gpt-5 AI-Contributed/Feature: 16/16 AI-Contributed/UT: 105/105
luoyuxia
force-pushed
the
fip28-historical-write-recovery-tiering
branch
from
August 28, 2026 06:23
8bdabb3 to
3f5edb0
Compare
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.
Generated-by: Codex (GPT-5) following the guidelines
Purpose
Linked issue: close #4119
Complete the end-to-end historical partition write support left as follow-up work by #4001. Writers should accept records for expired Paimon partitions, preserve each record's original partition identity while using the shared Fluss historical partition, and safely reclaim fully tiered local KV overlays.
Why resolve the write target before sending
A historical fallback changes the physical
TableBucketfrom the original partition to the shared historical partition. Fluss writer idempotence is scoped by physicalTableBucket, so the original and historical targets use different writer ID and batch-sequence namespaces. The original sequence cannot simply be reused, especially because multiple original partitions may share the same historical bucket.Once a request has been sent to the original target, transparently switching it to the historical target would require tracking all related in-flight requests, pausing new sends, preserving queue order, distinguishing deterministic failures from ambiguous outcomes, and reassigning sequences in the new physical bucket. This would add substantial state-management and concurrency complexity to the client.
This PR therefore uses a simpler approach. The client uses the auto-partition retention boundary only as a low-cost filter for partitions that may have expired, then refreshes metadata to confirm that the original partition no longer exists before enqueueing the record. This avoids metadata requests for current and future partitions and prevents the dynamic partition creator from recreating an expired partition. In the narrow race where the partition exists during this check but is removed before the server handles the request, the request fails through normal response handling. For a Flink job, this triggers failover; after the job restarts, the new writer sees that the original partition is missing and routes the replayed records to the historical partition.
Brief change log
PUT_KVandPRODUCE_LOG, version-gate the newPRODUCE_LOGfields, and correlate responses by physical bucket plus original partition.Tests
./mvnw -nsu -DskipTests -DskipITs -pl fluss-common,fluss-rpc,fluss-server validate./mvnw -nsu -DskipTests -DskipITs -pl fluss-client,fluss-flink/fluss-flink-common,fluss-lake/fluss-lake-paimon validateServerConnectionTest(4 tests passed).DynamicConfigChangeTest,HistoricalPartitionTableValidationTest,ServerRpcMessageUtilsTest,HistoricalPartitionTaskExecutorTest, andHistoricalPartitionManagerTest(55 tests passed).ClientRpcMessageUtilsTest,ArrowLogWriteBatchTest,CompactedLogWriteBatchTest,IndexedLogWriteBatchTest,KvWriteBatchTest,RecordAccumulatorTest, andSenderTest(78 tests passed).PaimonTieringTest(22 tests passed).HistoricalPartitionITCase(4 tests passed, including leader restart and lookup fallback to Paimon).fluss-rust/crates/fluss/regen.sh; generation is idempotent,cargo build --workspace --all-targets --exclude fluss_python --exclude fluss-cpp --exclude fluss_nif,cargo fmt --all -- --check, and workspace clippy with-D warningspassed.ReplicaManagerTestcould not complete locally because the host disk usage was about 91.6%, above the TabletServer test write limit of 85%; the resultingDiskWriteLockedExceptions caused cascading failures. This suite is left to CI.API and Format
PRODUCE_LOGfrom version 0 to version 1 and adds optionaloriginal_partition_namefields to bucket requests (field 4) and responses (field 6). Version gates keep version 0 peers compatible.PUT_KVby [server] Support primary-key writes to historical partitions #4001.server.historical-partition.kv-cleanup.idle-time, defaulting to 30 minutes; setting it to0disables idle cleanup.Documentation
Updates the historical-partition table option description to cover write access. No standalone user documentation is added in this PR.