Skip to content

[server] Preserve resolved historical write probes - #4178

Draft
luoyuxia wants to merge 8 commits into
apache:mainfrom
luoyuxia:fip28-historical-write-resolved-probe
Draft

[server] Preserve resolved historical write probes#4178
luoyuxia wants to merge 8 commits into
apache:mainfrom
luoyuxia:fip28-historical-write-resolved-probe

Conversation

@luoyuxia

@luoyuxia luoyuxia commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Purpose

Related to #4159.
Depends on #4120. This is a stacked PR; until #4120 merges, review commit 4ebf96b06 only.

Incremental compaction can remove a historical local value or tombstone after the first local probe but before the write is applied. Re-probing local state during apply would then change the resolved previous value and produce incorrect merge, delete, or changelog semantics.

Brief change log

  • Preserve decoded local values, tombstones, and lake fallback results for the lifetime of one historical write request.
  • Reuse the preserved result during apply, even if RocksDB compaction removes the entry between probe and apply.
  • Switch later records for the same key to staged local state only after an earlier record produces an actual mutation.
  • Add coverage for value and tombstone removal between probe and apply, true lake misses, and a no-op delete followed by a same-key upsert.

Tests

  • ./mvnw -pl fluss-server -am -DskipITs -Dtest=HistoricalPartitionManagerTest -Dsurefire.failIfNoSpecifiedTests=false test (8 tests passed)
  • ./mvnw -pl fluss-server spotless:check
  • git diff --check
  • A broader fluss-server verify was also attempted. Its unrelated failures came from the local filesystem being 95.15% full, which triggered the RocksDB 85% disk guard, and filesystem-allocation-size assertions; the historical tests passed.

API and Format

No public API or storage format changes.

Documentation

No user-facing feature is introduced by this correctness prerequisite.

Generative AI disclosure

  • Yes — Codex (GPT-5), reviewed by the author.

luoyuxia and others added 8 commits September 1, 2026 11:46
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: 1469/1469
AI-Contributed/UT: 2215/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
Return a retriable KV storage error while local historical KV state is being initialized or rebuilt. Clarify cleanup-state naming and terminology, and extend the Paimon integration test through post-recovery writes and restarted tiering.

Co-Authored-By: Codex <noreply@openai.com>

AI-Model: gpt-5
AI-Contributed/Feature: 244/244
AI-Contributed/UT: 239/239
Refresh registered Paimon partition-bucket file sets when the required lake snapshot changes, allowing unchanged local lookup files to remain reusable.

Co-Authored-By: Codex <noreply@openai.com>
AI-Model: gpt-5

AI-Contributed/Feature: 161/215
AI-Contributed/UT: 95/125
Exclude the plugin-facing LakeTableLookuper interface from the aggregate per-class coverage rule.

Co-Authored-By: Codex <noreply@openai.com>
AI-Model: gpt-5
AI-Contributed/Feature: 3/3
AI-Contributed/UT: 0/0
Remove the coupled historical KV cleanup mechanism, defer lake lookup refresh I/O until lookup initialization, and simplify historical write version and routing checks. Reroute missing original targets when no request remains in flight, abort only the affected target when handoff is unsafe, and document the remaining retirement ambiguity.

Co-Authored-By: Codex <noreply@openai.com>
AI-Model: gpt-5.6-sol
AI-Contributed/Feature: 56/56
AI-Contributed/UT: 2/2
Cache the previous values resolved by the first local probe and lake fallback so compaction between probe and apply cannot change historical write semantics. Switch later same-key records to staged local state only after an actual mutation.

Co-Authored-By: OpenAI Codex <codex@openai.com>
AI-Model: gpt-5
Co-Authored-By: Codex <noreply@openai.com>
AI-Contributed/Feature: 344/344
AI-Contributed/UT: 129/129
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.

1 participant