Skip to content

Fix onelake insert test - #104803

Closed
scanhex12 wants to merge 2 commits into
ClickHouse:masterfrom
scanhex12:fix_onelake_test_insert
Closed

scanhex12 wants to merge 2 commits into
ClickHouse:masterfrom
scanhex12:fix_onelake_test_insert

Conversation

@scanhex12

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

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

Fix onelake insert test

@clickhouse-gh

clickhouse-gh Bot commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [81dfd07]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_msan, WasmEdge, parallel, 1/2) FAIL
03168_query_log_privileges_not_empty FAIL cidb
Integration tests (amd_asan_ubsan, flaky) ERROR

AI Review

Summary

This PR updates OneLake handling to un-xfail insert tests and adjust Iceberg/Azure metadata behavior, but one live correctness issue remains in the DELETE path: metadata refresh is called without refreshing the metadata snapshot used for mutation validation, so validation and execution can diverge on dynamic DataLake metadata.

Findings

⚠️ Majors

  • [src/Interpreters/InterpreterDeleteQuery.cpp:103] updateExternalDynamicMetadataIfExists is invoked after metadata_snapshot is already captured, but MutationsInterpreter(...).validate() still uses that stale snapshot. On DataLake tables this can reject valid DELETE queries after external schema/snapshot updates when validate_mutation_query = 1.
    • Suggested fix: move getInMemoryMetadataPtr below the metadata refresh (or reload metadata_snapshot immediately after the refresh) so validation and execution use the same metadata snapshot.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required action: refresh metadata_snapshot after updateExternalDynamicMetadataIfExists in the DELETE path before constructing MutationsInterpreter for validation.

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label May 13, 2026
Comment thread src/Databases/DataLake/RestCatalog.h Resolved
@scanhex12
scanhex12 marked this pull request as draft May 13, 2026 09:10

mutation_commands.emplace_back(mut_command);

table->updateExternalDynamicMetadataIfExists(getContext());

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.

metadata_snapshot is read before this refresh (getInMemoryMetadataPtr near line 90) and later reused in MutationsInterpreter(...).validate().

For DataLake tables, this means validation still uses stale schema/table-state even though execution (StorageObjectStorage::mutate) runs after another metadata refresh. With validate_mutation_query = 1 this can reject valid DELETE statements right after external schema/snapshot changes.

Please reload metadata_snapshot after updateExternalDynamicMetadataIfExists (or move the original snapshot read below this call) so validation and execution use the same metadata snapshot.

@clickhouse-gh

clickhouse-gh Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.10% +0.00%
Functions 92.10% 92.10% +0.00%
Branches 76.60% 76.50% -0.10%

Changed lines: 67.57% (25/37) | lost baseline coverage: 1 line(s) · Uncovered code

Full report · Diff report

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

Labels

pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant