Skip to content

[core] Do not count inherited index entries in the strict-mode partition check - #10218

Merged
JingsongLi merged 6 commits into
apache:masterfrom
LuciferYang:m/core-039-strict-mode-index
Oct 5, 2026
Merged

JingsongLi merged 6 commits into
apache:masterfrom
LuciferYang:m/core-039-strict-mode-index

Conversation

@LuciferYang

@LuciferYang LuciferYang commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

On a primary-key table with deletion vectors, a job that pins commit.last-safe-snapshot when it starts, such as a rescale of pt=1, fails with "Giving up committing as commit.strict-mode.enabled is true" as soon as a streaming job writing pt=2 commits a compaction, provided pt=1 has any DV, even though no snapshot after the job start changed pt=1.

Every snapshot's index manifest lists the DVs of all partitions. StrictModeChecker.hasOverlappedIndexPartition read the whole manifest, so DVs that pt=1 only inherited counted as a change to pt=1. This is the same kind of false positive as #8996.

The check now compares the index manifest with the previous snapshot's, restricted to the partitions being committed, and a partition counts only if the snapshot added, replaced or removed an index entry in it. Removals count because the OVERWRITE that rollbackToAsLatest commits can drop a DV without any data-file change. A missing index manifest is read as empty.

Tests

In TableCommitTest:

  • testStrictModeIgnoresDeletionVectorsInheritedByCompaction: on a primary-key table with deletion vectors, an update gives pt=1 a DV, the job start is recorded, and an update of pt=2 commits a COMPACT snapshot. A commit to pt=1 pinned to the job start now succeeds; on master it is rejected.
  • testStrictModeDetectsIndexRemovalWithoutDataDelta (with and without an index manifest on the rollback target): a rollback that only removes pt=1's DV has no data-file delta, and a pinned commit to pt=1 is still rejected while one to pt=2 succeeds.

API and Format

No.

Documentation

No.

hasOverlappedIndexPartition read the whole cumulative index manifest
of the checked snapshot, so a DV-only OVERWRITE by another user that
changed index files only in one partition was also flagged for every
other partition whose index entries were merely inherited from
earlier snapshots, aborting unrelated commits under strict mode.

Mirror the data check, which only reads the snapshot's delta: diff
the snapshot's index manifest against the previous snapshot's and
consider only entries added or replaced by that commit. The manifest
name fast exit is kept.

Assisted-by: GLM-5.3
@LuciferYang
LuciferYang marked this pull request as draft October 2, 2026 04:03
@LuciferYang LuciferYang changed the title [core] Check only index delta in StrictModeChecker partition overlap [core] Check only index changes in StrictModeChecker partition overlap Oct 2, 2026
@LuciferYang
LuciferYang marked this pull request as ready for review October 2, 2026 05:16
@LuciferYang
LuciferYang marked this pull request as draft October 2, 2026 07:04
@LuciferYang LuciferYang changed the title [core] Check only index changes in StrictModeChecker partition overlap [core] Do not count inherited index entries in the strict-mode partition check Oct 2, 2026
@LuciferYang
LuciferYang marked this pull request as ready for review October 2, 2026 10:05
@LuciferYang

Copy link
Copy Markdown
Contributor Author

@JingsongLi Could you help review this one: with deletion vectors, a rescale fails strict mode whenever another partition's compaction lands, the same kind of false positive as #8996. Details and a test that fails on master are in the description.

@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit b1f678b into apache:master Oct 5, 2026
18 checks passed
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.

2 participants