Skip to content

feat: retry stale v3 snapshot row-lineage validation#794

Merged
wgtmac merged 1 commit into
apache:mainfrom
wgtmac:row_lineage_commit
Jul 1, 2026
Merged

feat: retry stale v3 snapshot row-lineage validation#794
wgtmac merged 1 commit into
apache:mainfrom
wgtmac:row_lineage_commit

Conversation

@wgtmac

@wgtmac wgtmac commented Jun 30, 2026

Copy link
Copy Markdown
Member

Add a retryable validation error kind and use it for add-snapshot stale sequence-number and stale first-row-id checks, matching Java Iceberg's RetryableValidationException behavior.

Include the new retryable validation kind in commit retry policy, while preserving normal validation failures for mixed/non-retryable builder errors. Add focused v3 row-lineage tests for multi-file assignment, branch commits, retry reassignment, stale snapshot validation, and delete-manifest null first_row_id handling.

Add a retryable validation error kind and use it for add-snapshot
stale sequence-number and stale first-row-id checks, matching Java
Iceberg's RetryableValidationException behavior.

Include the new retryable validation kind in commit retry policy, while
preserving normal validation failures for mixed/non-retryable builder
errors. Add focused v3 row-lineage tests for multi-file assignment,
branch commits, retry reassignment, stale snapshot validation, and
delete-manifest null first_row_id handling.

@huan233usc huan233usc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

[[nodiscard]] Status CheckErrors() const {
if (!errors_.empty()) {
std::string error_msg = "Validation failed due to the following errors:\n";
bool all_retryable = true;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering why we require all the errors to be retryable before treating the result as RetryableValidationFailed. Java impl throws a RetryableValidationException immediately when it encounters a retryable validation error, will this affect the behavior of lib users?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The all_retryable check is intentional because C++ builders accumulate errors, while Java is fail-fast. In Java, a RetryableValidationException stops evaluation immediately, so there is no mixed-error result to classify.

In C++, if we treated the result as retryable when only the first error is retryable, a chained builder call could retry even when another collected error is deterministic and cannot be fixed by refreshing metadata. Requiring all collected errors to be retryable keeps retry limited to cases where refreshing can plausibly fix the whole update.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I get it.

@wgtmac

wgtmac commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

Thanks all for the review!

@wgtmac wgtmac merged commit 9bf1ba1 into apache:main Jul 1, 2026
21 checks passed
mmaslankaprv added a commit to redpanda-data/iceberg-cpp that referenced this pull request Jul 1, 2026
merging_snapshot_update_test.cc called op->SetTargetBranch("audit"), a
method that does not exist on MergingSnapshotUpdate, breaking the CMake
-Werror build on upstream/main HEAD (introduced by apache#794). The real API for
targeting a branch is ToBranch(). Carry-patch until upstream fixes it.
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.

4 participants