Skip to content

[v25.3.x] iceberg: don't reject new fields with required descendants#30591

Merged
nvartolomei merged 1 commit into
redpanda-data:v25.3.xfrom
vbotbuildovich:ai-backport-pr-30585-v25.3.x-1779471711
May 22, 2026
Merged

[v25.3.x] iceberg: don't reject new fields with required descendants#30591
nvartolomei merged 1 commit into
redpanda-data:v25.3.xfrom
vbotbuildovich:ai-backport-pr-30585-v25.3.x-1779471711

Conversation

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

Backport of PR #30585

  • Command: git cherry-pick -x 07afd25
  • Commits backported: 1
  • Conflicts resolved: 1
  • Commits skipped (already on target): 0
  • Backport branch: ai-backport-pr-30585-v25.3.x-1779471711

Conflict details

  • 07afd25 (src/v/iceberg/compatibility.cc): validate_schema_transform on v25.3.x still used the for_each_field-with-lambda traversal; the PR replaces it with a stack-based walk that stops descending once an is_new ancestor is reached. Took the incoming side verbatim (helpers chunked_vector and reverse_field_collecting_visitor are already available via the existing compatibility_utils.h include), preserving the intended bug fix.

@vbotbuildovich vbotbuildovich added this to the v25.3.x-next milestone May 22, 2026
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label May 22, 2026
validate_schema_transform incorrectly rejected adding a new optional
column whose nested type contains structurally-required descendants
(e.g. an optional map, whose keys are always required). The walk
visited every annotated field and triggered new_required_field on the
nested required key/element.

Stop descending into a subtree once an is_new ancestor is encountered:
the substructure is part of the new type's definition, not a separate
top-level addition. The same reasoning applies to required list
elements and required struct subfields, though in practice only the
map-key case arises today. The datalake record translator coerces
all incoming schema fields to optional (see record_translator.cc),
leaving map keys as the only structurally-required descendants. The
list and struct cases are covered by regression tests for
completeness.

(cherry picked from commit 07afd25)
@nvartolomei nvartolomei force-pushed the ai-backport-pr-30585-v25.3.x-1779471711 branch from db363dd to 72c1433 Compare May 22, 2026 18:27
@vbotbuildovich
Copy link
Copy Markdown
Collaborator Author

CI test results

test results on build#84887
test_status test_class test_method test_arguments test_kind job_url passed reason test_history
FLAKY(PASS) NodesDecommissioningTest test_decommission_status null integration https://buildkite.com/redpanda/redpanda/builds/84887#019e5100-9888-4bd7-bc59-9e1486ec1672 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0317, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=NodesDecommissioningTest&test_method=test_decommission_status

@nvartolomei nvartolomei enabled auto-merge May 22, 2026 21:00
@nvartolomei nvartolomei merged commit 935bb34 into redpanda-data:v25.3.x May 22, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/redpanda kind/backport PRs targeting a stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants