Skip to content

feature (iceberg): Implement TRUNCATE TABLE for Iceberg Engine (REST …#1655

Open
il9ue wants to merge 3 commits into
antalya-26.3from
feature/iceberg-truncate-26.3
Open

feature (iceberg): Implement TRUNCATE TABLE for Iceberg Engine (REST …#1655
il9ue wants to merge 3 commits into
antalya-26.3from
feature/iceberg-truncate-26.3

Conversation

@il9ue
Copy link
Copy Markdown

@il9ue il9ue commented Apr 16, 2026

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Frontport for Antalya 26.3

  • 26.1 Antalya port - Implement TRUNCATE TABLE for Iceberg Engine (REST catalog support) Feature: Support TRUNCATE TABLE for Iceberg engine #1529, It's a frontport from 26.1, contains:
    • feat(iceberg): Implement TRUNCATE TABLE for Iceberg Engine (REST catalog support) — Core implementation: metadata-only truncation generating a new overwrite snapshot with empty manifest list, committed atomically via REST catalog
    • fix(iceberg): pass new_snapshot to updateMetadata in IcebergStorageSink — Fixed silent breakage of all INSERTs on REST catalog tables (wrong JSON object passed to catalog->updateMetadata)
    • fix(iceberg): restore return false in RestCatalog::updateMetadata — Preserve retry contract; add LOG_WARNING for diagnostics
    • fix(iceberg): revert Mutations.cpp updateMetadata to pass new_snapshot — Same fix as IcebergStorageSink, applied to ALTER TABLE DELETE/UPDATE path
    • refactor(iceberg): add comment explaining Avro zigzag encoding — Reviewer-requested documentation for manual Avro OCF serialization
    • refactor(iceberg): address code review feedback on TRUNCATE implementation — Named zero arguments, helper functions, restart integration test

Adaptation notes for antalya-26.3

The following API changes between antalya-26.1 and antalya-26.3 required adaptation:

  • RestCatalog constructor signature updated to match antalya-26.3 calling convention in DataLakeConfiguration.h
  • DatabaseDataLakeSetting member names updated
  • Cargo.lock restored to antalya-26.3 version (our changes do not touch any Rust code)

All feature logic is identical to the merged antalya-26.1 implementation.

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

Workflow [PR], commit [cc204b8]

…catalog support)

Forward-port of Iceberg TRUNCATE TABLE from antalya-26.1 to antalya-26.3.
Adapted to antalya-26.3 API changes in RestCatalog constructor,
DatabaseDataLakeSetting, and related interfaces.

See original implementation details in antalya-26.1 PR #1529.

Signed-off-by: Daniel Q. Kim <daniel.kim@altinity.com>
@il9ue il9ue force-pushed the feature/iceberg-truncate-26.3 branch from db43b6b to e229240 Compare April 16, 2026 08:42
@il9ue
Copy link
Copy Markdown
Author

il9ue commented Apr 16, 2026

On CI Failures & Asking a review

Flagging the CI failures for review. All observed failures are pre-existing and unrelated to the Iceberg TRUNCATE changes in this PR.

03706_statistics_preserve_checksums_on_mutations
MergeTree checksum mismatch in Statistics/mutations code path. The full stack trace contains no Iceberg frames. Pre-existing flaky test unrelated to this diff.

Docker CVEs (CVE-2026-28388, CVE-2026-28389, CVE-2026-28390, CVE-2026-31790, CVE-2026-40200)
Grype scan failures against the Alpine base image:

  • openssl 3.3.6-r0 — fixed in 3.3.7-r0 (CVEs 28388/28389/28390/31790)
  • musl 1.2.5-r9 — fixed in 1.2.5-r11 (CVE-2026-40200)

These require a base image update by the Docker/infra team and are unrelated to any C++ code changes in this PR. The same CVEs appear on the base antalya-26.3 branch independently of this PR.

This PR is a forward-port of the Iceberg TRUNCATE TABLE feature from antalya-26.1 (merged as PR #1529), adapted for antalya-26.3 API changes. All 19 integration tests pass including test_iceberg_truncate and test_iceberg_truncate_restart.

@svb-alt svb-alt added the port-antalya PRs to be ported to all new Antalya releases label May 5, 2026
@svb-alt svb-alt added the forwardport This is a frontport of code that existed in previous Antalya versions label May 12, 2026
@svb-alt svb-alt requested a review from arthurpassos May 15, 2026 01:59
Copy link
Copy Markdown
Collaborator

@arthurpassos arthurpassos left a comment

Choose a reason for hiding this comment

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

Have you submitted this to upstream?

// (distinct from snapshot ID 0 which is a valid snapshot).
Int64 parent_snapshot_id = actual_table_state_snapshot.snapshot_id.value_or(-1);

auto config_path = persistent_components.table_path;
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.

This will change once #1785 is merged. Not sure about the ordering. Looking at the "process correctness perspective", this frontport should be merged first. At the same time, that PR will certainly introduce conflicts that are best resolved by the author

@CarlosFelipeOR CarlosFelipeOR added the verified Approved for release label May 15, 2026
@CarlosFelipeOR
Copy link
Copy Markdown
Collaborator

QA Verification — ✅ Approved

PR #1655 (Iceberg engine TRUNCATE TABLE — forward-port to antalya-26.3) is safe and did not introduce any regression. This is a forward-port of PR #1529 (merged into antalya-26.1 on 2026-03-31, ~6 weeks of production exposure) — feature logic is identical; only the API-adaptation changes documented in the PR body (and the setting alias change handled at the base-branch level — see Key evidence). The CI run 25840598909 exercises the feature across stateless, integration, and Iceberg regression suites with no failures attributable to this PR. The remaining failures are pre-existing on antalya-26.3, features not yet forward-ported, or regression-suite infrastructure being addressed separately by the QA team.

Feature tests ✅

Test Type Result
03376_iceberg_truncate Stateless OK on 9 build types (Fast test, amd_asan parallel 2/4, amd_debug s3 storage parallel, amd_debug parallel, amd_msan WasmEdge 2/4, amd_tsan parallel 2/2, amd_tsan s3 storage 2/2, amd_ubsan parallel, arm_asan azure parallel 2/4, arm_binary parallel)
test_iceberg_truncate.py::test_iceberg_truncate_restart Integration OK on 5 jobs (amd_asan db disk 5/6, amd_binary 5/5, amd_msan 5/6, amd_tsan 5/6, arm_binary distributed plan 4/4)
iceberg_1 regression suite Regression 776 OKs / 0 fails on both architectures
iceberg_2 regression suite Regression 1614 OKs / 0 fails on both architectures

Summary of remaining failures

Category Tests / Jobs Status
Features not yet forward-ported to antalya-26.3 swarms (release + aarch64), parquet (release + aarch64), s3_export_part (release + aarch64) ✅ Expected, not caused by PR
Pre-existing 26.3 fails (also failing on unrelated PRs in same time window) version (release + aarch64), aggregate_functions_3 (aarch64) ✅ Not caused by PR
Regression-test infrastructure issues being addressed by QA team settings (aarch64) — missing snapshot for new version, fix in flight; tiered_storage_local (aarch64); tiered_storage_s3gcs (aarch64) ✅ Not caused by PR
Known flaky stateless 00157_cache_dictionary on arm_binary, sequential (87 fails / 738 OKs across 116 unrelated PRs in 30d) ✅ Not caused by PR
Caused by this PR 0 🟢

Key evidence

Forward-port precedent — The original PR #1529 introduced this feature into antalya-26.1 and was approved by QA on 2026-03-30 (comment). The C++ feature logic is identical; differences vs #1529 are limited to: RestCatalog constructor signature, DatabaseDataLakeSetting member names, Cargo.lock reverted to 26.3, the throwNotImplemented helper, and use of the canonical setting name allow_insert_into_iceberg (the 26.3 base — independently of this PR — registers allow_experimental_insert_into_iceberg as an alias, so the integration test added by this PR using the old name continues to work).

Cross-PR confirmation of infra failures — The mass-fails in settings (1564 failed / 5 xfail on aarch64) and tiered_storage_local (9 fails) appear identically on unrelated PR runs in the same window (e.g., run 25850287638), confirming they are regression-test infrastructure issues rather than caused by this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

antalya antalya-26.3 forwardport This is a frontport of code that existed in previous Antalya versions port-antalya PRs to be ported to all new Antalya releases verified Approved for release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants