feat(commit): align functionality with java paimon commit#397
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR expands commit conflict detection and index-file handling in FileStoreCommitImpl, adds row-id/write-column conflict checking for data-evolution scenarios, and updates/extends unit tests accordingly.
Changes:
- Add
ConflictDetection,ManifestEntryChanges, andRowIdColumnConflictCheckerto centralize commit change collection and conflict checks (including DV/global index considerations). - Support committing index files during overwrite / filter-and-overwrite flows, and adjust commit-kind selection (e.g., DV index append => overwrite kind).
- Update commit retry behavior and add/adjust tests for index files, retries, and PK table commit behavior.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/paimon/core/operation/file_store_commit_test.cpp | Adds test validating DV index append triggers overwrite commit kind |
| src/paimon/core/operation/file_store_commit_impl_test.cpp | Extends commit tests for index files, retry metrics, and conflict checking signature changes |
| src/paimon/core/operation/file_store_commit_impl.h | Introduces new conflict/index APIs and wires in ConflictDetection |
| src/paimon/core/operation/file_store_commit_impl.cpp | Implements index-aware overwrite, retry commit checking, and centralized change collection |
| src/paimon/core/operation/file_store_commit.cpp | Removes prior PK-commit restriction logic in Create |
| src/paimon/core/operation/commit/row_id_column_conflict_checker.h | Adds row-id/write-column overlap conflict checker interface |
| src/paimon/core/operation/commit/row_id_column_conflict_checker.cpp | Implements row-id/write-column overlap conflict checker |
| src/paimon/core/operation/commit/manifest_entry_changes.h | Adds helper to collect manifest + index changes from commit messages |
| src/paimon/core/operation/commit/manifest_entry_changes.cpp | Implements change collection and “changed partitions” logic |
| src/paimon/core/operation/commit/manifest_entry_changes_test.cpp | Adds unit tests for ManifestEntryChanges |
| src/paimon/core/operation/commit/conflict_detection.h | Adds conflict detection API covering bucket/key-range/row-id/global-index checks |
| src/paimon/core/operation/commit/conflict_detection.cpp | Implements conflict detection logic and row-id history scan |
| src/paimon/core/operation/commit/conflict_detection_test.cpp | Adds unit test coverage for conflict detection behaviors |
| src/paimon/common/data/binary_row.h | Adds std::hash for tuple key used in conflict detection |
| src/paimon/CMakeLists.txt | Wires new sources + tests into the build |
Comments suppressed due to low confidence (1)
src/paimon/core/operation/file_store_commit.cpp:1
- The PR description is still the unfilled template (e.g., linked issue
#xxx, tests section empty), but this change alters user-visible behavior by removing the previous PK-table commit restriction inFileStoreCommit::Create. Please update the PR title/description to clearly state the behavioral change, link the real issue, and list the tests validating the new PK commit behavior.
/*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zjw1111
left a comment
There was a problem hiding this comment.
Reviewed the commit conflict-detection alignment against Java Paimon. The port is largely faithful (ManifestEntryChanges collection order, RetryWaiter backoff math, SequenceSnapshotProperties ADD-only max, row-tracking assignment all match Java). A few correctness gaps and divergences are worth fixing before merge — see inline.
Highest priority: RowIdColumnConflictChecker::ConflictsWith swallows field-resolution errors and can let a schema mismatch pass conflict detection.
Also, a few items not inlined:
- Test coverage:
RowIdColumnConflictCheckerhas no C++ test at all (Java has 7 cases, incl.testUsesFieldIdAcrossRename/testFailsOnUnknownNonSystemWriteColumnwhich cover two of the issues below);CheckRowIdExistence/CheckRowIdRangeConflicts/SequenceSnapshotPropertiesalso lack direct tests. Please add these. - Style (
docs/code-style.md): plainintinrow_id_column_conflict_checker.cppbinary search (low/high/mid/index) andstd::unordered_set<int>infile_store_commit_impl.cppNumChangedBuckets — use fixed-width types. - Intentional partial ports (please confirm and add a note): DV+UNAWARE entry enrichment,
pkClusteringOverrideshort-circuit in CheckKeyRange, partition-expire handling in CheckDeleteInEntries, anddropStatson overwrite delete entries are all omitted. - The PR description is still the unfilled template — please fill in the change summary, linked issue, and tests.
zjw1111
left a comment
There was a problem hiding this comment.
Cross-language review against Java Paimon found four additional correctness and boundary-condition gaps; see the inline comments.
The existing unresolved threads about overwrite ADD/DELETE deduplication and preserving the underlying commit error also still apply. I would not approve this revision until the P1 data-integrity issues are addressed.
zjw1111
left a comment
There was a problem hiding this comment.
Re-reviewed against the latest Java master (f7ec93b3c). The dedicated row-id range check, the RowRangeIndex-based existence / global-index checks, ReadIncrementalEntries, and the 3-branch sequence assignment now all align with master. No blocking data-correctness issues. Remaining items are inline.
One non-inline note: SpecialFields::IsSystemField omits _LEVEL (master's SYSTEM_FIELD_NAMES includes it). But _LEVEL only lives in the KeyValue/merge-tree schema and never reaches write_cols on the append/data-evolution path that RowIdColumnConflictChecker inspects, so it is not reachable here — optional.
zjw1111
left a comment
There was a problem hiding this comment.
+1. Row-id / RowRangeIndex alignment with master and the added test coverage look good; CI is green. The retry error-preservation comment in file_store_commit_impl.cpp is non-blocking (diagnostics only) — please follow up separately.
|
Post-merge follow-up (cleanup + open item):
|
|
Additional non-blocking cleanup (from internal AI review, all verified accurate — style/perf only, no correctness impact):
|
| } | ||
|
|
||
| TEST_F(CleanInteTest, TestDropPartitionAndExpireSnapshotWithIOException) { | ||
| TEST_F(CleanInteTest, DISABLED_TestDropPartitionAndExpireSnapshotWithIOException) { |
Purpose
Linked issue: N/A
This PR aligns the C++ commit path with Java Paimon commit semantics, with focus on correctness and conflict handling in PK/overwrite/index scenarios.
Main changes:
Tests
Added test cases in this PR:
API and Format
Documentation
Generative AI tooling
Generated-by: GitHub Copilot (GPT-5.3-Codex)