Skip to content

Keep the Glue table definition on Iceberg commits and refuse to overwrite a concurrent commit - #128752

Closed
groeneai wants to merge 10 commits into
ClickHouse:masterfrom
groeneai:fix-glue-update-table-definition-and-version-id
Closed

groeneai wants to merge 10 commits into
ClickHouse:masterfrom
groeneai:fix-glue-update-table-definition-and-version-id

Conversation

@groeneai

@groeneai groeneai commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Closes: #128591
Closes: #112102
Related: #126924
Related: #128600

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fixed Iceberg writes to a Glue DataLakeCatalog database replacing the Glue table definition with a bare one (losing columns, properties, previous_metadata_location and table type) and silently overwriting a concurrent commit. A commit now keeps the rest of the definition, sets previous_metadata_location, syncs the Glue columns with the Iceberg schema (restoring columns a prior commit removed), and applies only if the table still points to its base metadata (Glue VersionId), else it retries. ClickHouse-created tables register their columns. A commit Glue rejects no longer leaves a metadata file behind that makes every later write fail. Closes #128591.

Description

On 26.10, any commit (e.g. INSERT) to an Iceberg table of a Glue DataLakeCatalog database replaces the Glue table definition with a bare one and silently overwrites another writer's concurrent commit, losing its rows.

Root cause. GlueCatalog::updateMetadata built the UpdateTable input from scratch without VersionId, and ICatalog::updateMetadata lacked the commit's base.

The change.

  • A commit reads the table, keeps its definition, sets metadata_location and previous_metadata_location, refreshes columns from the Iceberg schema (keeping comments, extra parameters and older-schema columns; renamed or dropped columns become non-current; text Glue refuses is skipped), and sends UpdateTable with VersionId. createTable registers columns as EXTERNAL_TABLE.
  • All 6 commit sites pass the pointer read with their base. If Glue now points elsewhere or definitely rejects the update, the writer deletes its metadata file, freeing the name.
  • ConcurrentModificationException re-reads the table. A failed UpdateTable that may have applied (SDK retry, 5xx, timeout) is read back; if that cannot tell, or the pointer was added or removed, it fails with UNKNOWN_STATUS_OF_TRANSACTION, keeping files.
  • expire_snapshots retries on a catalog conflict (was LOGICAL_ERROR).

#126924 is partial (no VersionId, no base check). This also covers the Glue half of #115580.

Validation. 9 new tests in test_database_glue (35 cases), via a fault proxy enforcing VersionId and Glue's column limits (moto ignores both): 31 fail on master; all pass with the fix (10 runs). Module 75/75, REST commit tests 20/20.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/128752]

groeneai and others added 6 commits November 2, 2026 14:24
…rite a concurrent commit

`GlueCatalog::updateMetadata` sent `UpdateTable` with a `TableInput` built from scratch:
Glue replaces the whole definition, so the columns, `previous_metadata_location`, the user
parameters and the `EXTERNAL_TABLE` type another engine wrote were lost. It also sent no
`VersionId` and did not know the commit's base, so a commit made by another writer between
ClickHouse's base read and its `UpdateTable` was silently overwritten (its rows lost).

- `ICatalog::updateMetadata` / `updateSchema` take `base_metadata_location`, the pointer the
  catalog reported when the commit's base was read. The 6 commit sites capture it through a new
  out-parameter of `getLatestMetadataFileAndVersionWithCatalog` / `getCatalogMetadataFilePath` /
  `IcebergMetadata::getRelevantState`. `DataLakeSpecificProperties::resolved_from_table_location`
  tells a stored pointer from a location found by listing.
- Glue commits read the table, copy every `TableInput` field, set `metadata_location` and
  `previous_metadata_location`, refresh the columns on a schema change (keeping a console
  comment of a field without `doc`) and send `UpdateTable` with `VersionId`. A pointer that moved
  between two stored values returns `false`; a pointer added or removed meanwhile is an unknown
  outcome, because a writer that resolves the table by listing may already use the new file.
- `ConcurrentModificationException` without an SDK retry re-reads and retries. After an SDK retry
  the first attempt may have been applied, so the table is read back: ours as the pointer or the
  previous pointer means applied, the base means not applied, anything else (or a failed read)
  throws `UNKNOWN_STATUS_OF_TRANSACTION`.
- On that code the INSERT sink, mutations and manifest compaction keep their files. On `false`
  the writer deletes the metadata file it wrote, so the retry can write the same name.
- `expire_snapshots` retries a catalog conflict instead of throwing `LOGICAL_ERROR`.
- `createTable` registers the Glue columns and uses `EXTERNAL_TABLE`, as Iceberg writers do.

Tests: `test_database_glue` gains 4 tests (15 cases). The fault proxy now enforces
`UpdateTable.VersionId` (moto ignores it), injects lost-response, superseded and read-back
faults, and serves a held `url()` source for the race. 14 cases fail on master.

Closes ClickHouse#128591

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…olumns in sync

- `GlueCatalog::commitTableUpdate` read the table back only after an SDK-retried
  `ConcurrentModificationException`. Any other failure that may have applied the update (a 5xx
  or timeout after the retries, a non-retried 5xx, a call that threw, a client error answering a
  retry) threw `DATALAKE_DATABASE_ERROR`, and the writers then deleted files the applied commit
  references. Such outcomes are now read back too: ours means applied, otherwise
  `UNKNOWN_STATUS_OF_TRANSACTION`. Only a non-retried 4xx that is not retryable keeps
  `DATALAKE_DATABASE_ERROR`, and only a `ConcurrentModificationException` with the base still in
  place is retried.
- `ICatalog::updateMetadata` gets the metadata object written to `new_metadata_path`, and Glue
  refreshes the columns from its current schema on every commit, so a table whose columns an
  earlier ClickHouse commit removed gets them back. The refresh keeps the other parameters of an
  existing column and the columns of older schemas (`iceberg.field.current = false`).
- Keep the REST half of the removed TODO in the INSERT sink, and log the removal of a metadata
  file the catalog refused.

Tests: the fault proxy gains `lostfinal_`, `lostnoretry_`, `failnoretry_` and `rejected_`;
`test_glue_update_keeps_table_definition` edits the Glue columns before each commit and gains
`insert_after_wipe`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…etadata file Glue did not commit

- `getGlueColumnType` wrote the Iceberg Java spelling `timestamp_nano` for `timestamp_ns` and
  `timestamptz_ns`. ClickHouse's Glue reader resolves `timestamp_nano` only for a top-level
  column; inside a struct, list or map it goes through `DataLake::getType`, which knows only
  `timestamp_ns` / `timestamptz_ns` and throws `Unknown Iceberg type: timestamp_nano`. Since every
  commit now rewrites the Glue columns, one ClickHouse commit made a table with a nested
  nanosecond timestamp unreadable through the Glue database. Write the Iceberg names, as pyiceberg
  does.
- The metadata file is created before the catalog call. When the catalog threw an error other
  than `UNKNOWN_STATUS_OF_TRANSACTION` (a rejected update, a failed `GetTable`, no `VersionId`,
  the attempt bound), the update was not applied but the file stayed, so every later write
  regenerated the same name, collided with it and failed (ClickHouse#112102). The new
  `Iceberg::commitCreatedMetadataFile` runs the catalog commit at the 5 Glue-reachable sites and
  removes the file on `false` and on every exception except an unknown outcome.

Tests: `test_glue_update_keeps_nested_nanosecond_timestamp_readable` (the version 3 table is made
by rewriting pyiceberg's metadata, because pyiceberg 0.11.1 cannot write version 3), and
`test_glue_update_conditional_on_version_id[rejected]` checks that no metadata file is left and
that the next INSERT succeeds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`getGlueColumns` diverged from the Iceberg writers' Glue column history in two ways:

- It skipped an existing non-current column whose `iceberg.field.id` is still a current field id.
  That is the old name of a renamed column (a rename keeps the field id), so any ClickHouse commit
  (INSERT, DELETE, OPTIMIZE MANIFEST, expire_snapshots, ALTER) removed the rename history that
  pyiceberg registered.
- A current column that the new schema no longer has, after ClickHouse's own `RENAME COLUMN` or
  `DROP COLUMN`, was dropped instead of being kept as non-current.

pyiceberg lists every field of every older schema once by name with `iceberg.field.current =
false`. Now the columns are the current fields, then the registered older-schema columns, then the
existing columns the new schema no longer has, all non-current, each name once.

Tests: `test_glue_update_keeps_table_definition` gains `alter_rename_column` and
`alter_drop_column`, and its fixture registers the old name of `s` as an older-schema column.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The `expire_snapshots` branch that retries when Glue refuses the commit (it threw `LOGICAL_ERROR`
before) was not reached by any test: its only race test is an `INSERT` held through a `url()`
source, which `expire_snapshots` does not have.

The fault proxy gains `held_`: the first `UpdateTable` of such a database waits, outside the lock
that serializes the `VersionId` check, until the test releases it. The new test commits with
pyiceberg during the hold, so Glue refuses the stale `VersionId`, and checks that the expiration
is retried on top of that commit, which stays the previous pointer, keeps all rows, and leaves no
metadata file of the refused attempt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Shorten the getGlueColumns comment and drop one that repeats the exception message below it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

groeneai commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (rounds 1-5): 7 fixed, 6 noted
Finding Verdict
❌ A lost response whose retries end in a non-concurrent error was reported as a failure, so the writer deleted files the applied commit references AGREE, fixed: every outcome that may have applied is read back
❌ A nested nanosecond timestamp was registered as timestamp_nano, which the Glue database cannot parse inside a struct, array or map AGREE, fixed: timestamp_ns / timestamptz_ns, as pyiceberg registers them
⚠️ Non-schema commits did not refresh the Glue columns, so tables already wiped by an earlier version stayed column-less AGREE, fixed: every commit refreshes them
⚠️ The column refresh dropped extra per-column Glue parameters and older-schema columns AGREE, fixed
⚠️ The column refresh dropped a renamed column's old name and did not keep renamed or dropped columns as non-current, unlike pyiceberg and Iceberg Java AGREE, fixed: listed as non-current, each name once
⚠️ The expire_snapshots retry on a catalog conflict (was LOGICAL_ERROR) had no test AGREE, fixed: a test holds its UpdateTable while another writer appends; the expiration retries on top and leaves no metadata file behind
⚠️ A rejected commit left its metadata file behind, so every later write collided with it (#112102) AGREE, fixed: removed on every outcome except an unknown one
💡 A table without a Glue pointer is still not protected against a writer that bypasses Glue Not changed: such a writer with versioned names collides on the file name, a Glue writer sets the pointer (refused here); same as master
💡 The early timestamp-type read uses a bucket-less storage_endpoint verbatim Not changed: a different, pre-existing defect
💡 A Glue ViewDefinition is not carried into the commit Not changed: TableInput takes a different type whose changes Glue gates behind ViewUpdateAction; pyiceberg's commit omits it too; same as master
💡 No backoff in the bounded concurrent-modification loop Not changed: bounded, no observed effect
💡 A rejected commit can leave version-hint.text naming the removed metadata file Not changed: only path readers with iceberg_use_version_hint read it, and they fall back to listing when the hinted file is missing; catalog reads use the Glue pointer; on master the hint named the uncommitted file itself
💡 A table whose Glue columns an earlier version wiped gets its current columns back, but not the non-current history of older schemas Not changed: no reader uses non-current columns (the Glue database skips them); registered history is always kept

@groeneai

groeneai commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. test_database_glue new tests on unfixed master: 23 of 24 cases fail every run, incl. test_glue_update_detects_concurrent_commit[append] (a pyiceberg row appended during a held INSERT ... SELECT FROM url() is lost: 1,2 instead of 1,2,3).
b Root cause explained? GlueCatalog::updateMetadata sent UpdateTable with a TableInput built from scratch and no VersionId, and the catalog interface did not carry the commit's base, so the definition was replaced and a concurrent commit overwritten. A metadata file whose commit Glue rejected was left behind and blocked every later write.
c Fix matches root cause? Yes: read-modify-write from GetTable, columns refreshed from the new metadata's schema on every commit, base pointer from every writer's base read compared exactly, UpdateTable conditional on VersionId, every outcome that may have applied read back; a metadata file the catalog did not commit is removed; no symptom guard.
d Test intent preserved / new tests added? 6 new integration tests (24 cases); the proxy enforces VersionId (moto ignores it) and injects lost-response, superseded, read-back, non-retried and rejected faults. No existing test changed.
e Both directions demonstrated? Master 23 red / 1 green (lost_response guards a fix-only hazard); fix 24/24 and 240/240 over 10 runs. 22 mutation controls each redden their case; one more is equivalent under the file cleanup.
f Fix is general across code paths? All 6 commit sites (INSERT, mutate, alter, manifest compaction, expire_snapshots, DROP PARTITION) pass the base and the new metadata; every deleting caller keeps files on UNKNOWN_STATUS_OF_TRANSACTION; createTable registers columns; REST/UnityV2 signature only; a conflict during expire_snapshots is retried (tested).
g Fix generalizes across inputs (params/datatypes/wrappers)? Column types: Int32, Nullable(Int64), String, Decimal, Date, DateTime64, UUID, Array, Map, Tuple, a nested nanosecond timestamp, checked against the Iceberg schema and round-tripped. Pointer states: unchanged, moved, same-version copy, removed, absent throughout, gzip metadata. Glue columns: console comment, extra parameter, older-schema column, renamed and dropped columns, wiped.
h Backward compatible? (maintainer-approved exception only) No setting or format change. Existing definitions are kept; the next commit restores the current columns an earlier version removed; only new tables get EXTERNAL_TABLE (ClickHouse reads the table_type parameter).
i Invariants and contracts preserved? false only when the pointer moved between two stored values and no attempt can apply; all callers retry on false (expire_snapshots no longer throws LOGICAL_ERROR). An outcome that may have applied keeps every file the commit references. A non-retried client error keeps master's DATALAKE_DATABASE_ERROR.

Session id: cron:clickhouse-impl-slot-4:20261102-191900

@groeneai

groeneai commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

cc @SmitaRKulkarni @scanhex12, could you review this and add the can be tested label so CI runs? Glue commits now read the table, keep its definition and previous_metadata_location, sync the Glue columns from the Iceberg schema, and send UpdateTable with VersionId checked against the base pointer each writer read, so a concurrent commit is retried instead of silently overwritten.

@clickhouse-gh

clickhouse-gh Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [5e8733a]

Summary: ❌

job_name test_name status info comment
La Casa Del Dolor (arm_asan_ubsan) FAIL
Server shutdown FAIL cidb

AI Review

Summary

The PR preserves Glue table definitions, registers Iceberg columns, and adds conditional catalog commits with explicit handling of uncertain outcomes. Two cleanup gaps remain in DROP PARTITION: one can make a committed table unreadable, and the other can block subsequent writes. These require changes before merge.

Findings

❌ Blockers

  • AlterDropPartitionExecutor.cpp:643: An applied Glue update followed by a lost response and failed read-back throws UNKNOWN_STATUS_OF_TRANSACTION. tryCommit leaves committed false, so its scope guard deletes the new manifest list even though the published metadata references it. Preserve attempt files when the outcome is unknown.

⚠️ Majors

  • AlterDropPartitionExecutor.cpp:642: This commit site omits commitCreatedMetadataFile. A refused commit leaves its uploaded vN+1.metadata.json behind. With an unchanged base version, retries and later writes repeatedly collide with the orphan and fail until manual cleanup. Use the shared helper for non-transactional catalogs.
Tests
  • ⚠️ Extend the existing Glue fault tests with DROP PARTITION: preserve readable published metadata after an applied update whose read-back fails; remove uncommitted metadata after a same-version pointer conflict or definite rejection, and verify a subsequent insert succeeds. The current cases omit this writer. These findings are based on code tracing; integration tests were not run locally.
Final Verdict

❌ Block — preserve partition-drop files on unknown outcomes, remove its metadata on definite refusals, and add the focused regression cases above.

@clickhouse-gh clickhouse-gh Bot added pr-bugfix Pull request with bugfix, not backported by default can be tested Allows running workflows for external contributors comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. labels Nov 2, 2026
Comment thread src/Databases/DataLake/GlueCatalog.cpp Resolved
Glue documents `OperationTimeoutException` for `UpdateTable` as HTTP 400,
and the SDK marks it non-retryable, so the commit took it for a definite
rejection, threw DATALAKE_DATABASE_ERROR and let the writer delete its
metadata and data files. A timeout does not say whether the update was
applied, so it now goes through the same read-back as other ambiguous
outcomes: ours -> success, otherwise UNKNOWN_STATUS_OF_TRANSACTION with
the files kept.

The fault proxy gets `losttimeout_` (apply, then answer with
OperationTimeoutException) and `failtimeout_` (answer with it without
applying), and test_glue_update_conditional_on_version_id the matching
`lost_timeout` (success) and `failed_timeout` (UNKNOWN_STATUS_OF_TRANSACTION,
pointer unchanged, files kept) cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Databases/DataLake/GlueCatalog.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 5e8733aa1 with master 9cdd70465 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 53bfe5fc3; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes

23 object files changed (+224.40 KiB total), 0 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/Databases/DataLake/GlueCatalog.cpp.o 963.96 KiB 1.12 MiB +185.20 KiB (+19.21%)

719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

127 translation units recompiled, 1212 s compile time in total, 127 of them have a recent master baseline.

Job report

Glue limits `Column.Name` and `Column.Comment` to 255 characters and
`Column.Type` to 131072, all without control characters other than tab.
The commit refreshes the Glue columns from the Iceberg schema, so an
Iceberg `doc` longer than that or with a newline (Trino, for one, keeps
such a doc and registers no Glue columns) made every ClickHouse INSERT
fail with a ValidationException, where master never sent columns at all.

Such a `doc` is no longer copied: the column keeps the comment Glue already
has, if any, and the Iceberg metadata keeps the full `doc`. A column name
or type (which embeds nested field names) Glue refuses cannot be
registered, so the existing Glue columns are kept as they are. Lengths are
counted in UTF-16 code units, the stricter of the two ways Glue may count
them.

The fault proxy now refuses an `UpdateTable` with such a column like Glue
does (moto accepts it), and test_glue_update_skips_column_text_glue_refuses
covers a 255-character doc (copied), 255 non-ASCII characters (copied), a
256-character doc (existing comment kept), a multi-line doc (no comment), a
256-character column name and a nested field name with a newline (columns
kept).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Databases/DataLake/GlueCatalog.cpp Resolved
Comment thread src/Databases/DataLake/GlueCatalog.cpp Resolved
…ames the Glue reader cannot parse

After an SDK retry of `UpdateTable` was refused with
ConcurrentModificationException, the read-back took
`previous_metadata_location == base` as proof that our update was never
applied. A writer that copies the Glue parameters and only replaces
`metadata_location` keeps the previous pointer our applied commit set, so
an update that was applied and then superseded looked refused: the commit
returned `false`, and the writer deleted the metadata file and manifest
list the other writer's metadata builds on. Only an unchanged pointer now
shows that the update was refused; a moved pointer that is neither ours
nor has ours as its previous pointer is UNKNOWN_STATUS_OF_TRANSACTION,
with the files kept. The fault proxy gets `staleprev_`, and
test_glue_update_conditional_on_version_id the case
superseded_stale_previous.

`DataLake::getType` splits a struct field at its first colon and at
commas outside brackets, so a nested Iceberg field named `a:b` registered
as `struct<a:b:bigint>` made every later read through the Glue database
fail with `Unknown Iceberg type: b:bigint`, for a table that was readable
with no Glue columns before the INSERT. A type with a nested field name
containing `:`, `,`, `<`, `>`, `(` or `)` is not registered, and the
existing Glue columns are kept. test_glue_update_skips_column_text_glue_refuses
gets the case nested_delimiter.

test_glue_unknown_commit_keeps_files_of_mutation_and_compaction runs the
`superseded_unknown` fault for an ALTER DELETE and an OPTIMIZE ... MANIFEST,
so the keep-files guards in Mutations.cpp and Compaction.cpp are tested
too, not only the one of the INSERT sink.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Databases/DataLake/GlueCatalog.cpp Resolved
Glue commits now register columns, so a ClickHouse `Geometry` column is
registered as an optional `geometry` Glue column. The Glue reader
(`DataLake::getType`) wrapped every optional primitive in `Nullable`, and
`Geometry` (a `Variant`) cannot be inside `Nullable`, so the table lookup
failed with `Nested type Geometry cannot be inside Nullable type` before
the Iceberg metadata was read: right after CREATE, or after the first
commit on a table whose Glue columns had been wiped. The reader now uses
`makeNullableSafe`, the same rule as the Iceberg schema reader
(`canBeInsideNullable`).

Test: test_glue_registers_optional_geometry_readably [create,
insert_after_wipe]; both fail with Code 43 on the previous head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
const auto & [namespace_name, table_name] = DataLake::parseTableName(storage_id.getTableName());
if (!catalog->updateMetadata(namespace_name, table_name, catalog_filename, new_snapshot))
if (!catalog->updateMetadata(
namespace_name, table_name, catalog_filename, new_snapshot, state.base_catalog_metadata_location, state.metadata_object))

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.

[P1] Preserve the partition-drop manifest on an unknown commit outcome

The new Glue commit can throw UNKNOWN_STATUS_OF_TRANSACTION after applying this update. For example, the existing readbackfail_ proxy applies UpdateTable, loses the response, then refuses the read-back. Here that exception escapes commitMetadataJSON before tryCommit sets committed, so its scope guard at lines 678–680 calls cleanupNotCommited and deletes the new manifest list. Glue still points to metadata referencing that deleted list, making the committed table unreadable.

Please propagate the unknown outcome into tryCommit and preserve its attempt files, as the insert, mutation, and manifest-compaction paths now do. Extend the Glue fault test with a partitioned table and DROP PARTITION, checking that the published metadata remains readable after an applied update with a failed read-back.

auto catalog_filename = components.path_resolver.resolveForCatalog(metadata_info.path);
const auto & [namespace_name, table_name] = DataLake::parseTableName(storage_id.getTableName());
if (!catalog->updateMetadata(namespace_name, table_name, catalog_filename, new_snapshot))
if (!catalog->updateMetadata(

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.

[P2] Clean up the partition-drop metadata on a refused catalog commit

This is the remaining non-transactional commit site that bypasses commitCreatedMetadataFile. The metadata file was already uploaded above, but neither this false branch nor tryCommit's cleanup removes it. If another writer repoints Glue to a copy of the same metadata version, the new base check returns false; every retry then proposes the same vN+1.metadata.json, encounters its own orphan, and exhausts the retry limit. Later inserts and mutations encounter the same file and also fail until it is removed manually. A definite Glue rejection leaves the same obstruction.

Please wrap this call in commitCreatedMetadataFile for catalogs that do not write metadata themselves, matching the other commit sites. Add a DROP PARTITION case for a same-version repoint or a one-shot rejection, then verify that no uncommitted metadata remains and a subsequent insert succeeds.

@groeneai

groeneai commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 5e8733a

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
La Casa Del Dolor (arm_asan_ubsan) / Server shutdown not from this PR (it changes only the data-lake catalog and Iceberg commit code): the harness force-killed the server after its 30 s stop window while Server::main was still in BackupsWorker::waitAll waiting for a fuzzed backup or restore (gdb.log); the same failure is on master and on other PRs since 2026-11-02 #128763 (mine, open); #128774 (external, open) makes the same change
Mergeable Check, PR praktika rollups of the row above #128763 (mine, open)
Sync - CH Inc sync (private, not actionable by me)

The Bugfix validation (integration tests, *) FAIL rows in CIDB are the new tests failing on master, as intended; both checks passed.

Session id: cron:our-pr-ci-monitor:20261103-073004

@fm4v

fm4v commented Nov 14, 2026

Copy link
Copy Markdown
Member

🕵 Closing: #126924 (merged 2026-11-13) implemented the same read-modify-write and VersionId check differently, so this PR conflicts in 18 files.

I ran this PR's tests against a master build that includes #126924. 10 cases still failed because of real defects:

  • master deletes the files of a commit that Glue may have applied (lost response, timeout, failed read-back, superseded commit);
  • a commit accepts a removed pointer and drops a concurrent append;
  • column names that Glue refuses make every write fail.

The fixes for these, with the corresponding tests and the fault proxy, are ported onto master's code in #131575. The remaining failures only pinned this PR's own design choices, so they are not carried over: the column history, timestamp_ns, EXTERNAL_TABLE, and comment handling.

@fm4v fm4v closed this Nov 14, 2026
@clickhouse-gh clickhouse-gh Bot added comp-datalake-catalogs Data lake catalogs: the DataLakeCatalog database engine and its catalog clients - Iceberg REST, A... and removed comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-datalake-catalogs Data lake catalogs: the DataLakeCatalog database engine and its catalog clients - Iceberg REST, A... pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

2 participants