Skip to content

Antalya-26.3 Frontport of #1659 - Add ALTER TABLE MODIFY SETTING support for Hybrid watermarks#1723

Merged
zvonand merged 4 commits into
antalya-26.3from
frontport/antalya-26.3/hybrid-move-watermark
May 12, 2026
Merged

Antalya-26.3 Frontport of #1659 - Add ALTER TABLE MODIFY SETTING support for Hybrid watermarks#1723
zvonand merged 4 commits into
antalya-26.3from
frontport/antalya-26.3/hybrid-move-watermark

Conversation

@mkmkme
Copy link
Copy Markdown
Collaborator

@mkmkme mkmkme commented May 2, 2026

Antalya 26.1 - Add ALTER TABLE MODIFY SETTING support for Hybrid watermarks

Changelog category (leave one):

  • New Feature

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

Added support for moving Hybrid table watermarks (#1659 by @mkmkme)

Documentation entry for user-facing changes

...

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)

Antalya 26.1 - Add ALTER TABLE MODIFY SETTING support for Hybrid watermarks
@mkmkme mkmkme added antalya hybrid antalya-26.3 forwardport This is a frontport of code that existed in previous Antalya versions labels May 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Workflow [PR], commit [ee97139]

Comment thread src/Storages/StorageDistributed.cpp Outdated
const ASTPtr & base_predicate, const std::vector<StorageDistributed::HybridSegment> & segs)
{
std::unordered_map<String, String> result;
std::function<void(const ASTPtr &)> walk = [&](const ASTPtr & node)
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 function looks very similar to replace_hybrid_params, maybe there is a way to reduce the code duplication?

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 see this function only validates it, which seems to be a copy and paste of replace_hybrid_params without the replace logic. Maybe you can clone the original ast and just call replace? This will also make the maintainance better

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I tried to address it in 9c92e1d by:

  1. Moving the checks into a separate function
  2. Moving the iterating routine into a visitor

Comment thread src/Storages/StorageDistributed.cpp Outdated
const auto & param_name = name_lit->value.safeGet<String>();
const auto & type_name = type_lit->value.safeGet<String>();

if (!watermark_snapshot)
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.

Can't this be checked on line 1234? Right after auto watermark_snapshot = hybrid_watermark_params.get();

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It can, but in this case we won't have a watermark name to put into the exception message



/// Extract declared hybridParam types from all Hybrid predicate ASTs.
static std::unordered_map<String, String> collectHybridParamTypes(
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.

Does it really extract types? It seems to me it actually builds a map from the hybrid args, not only type names.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The map stores {name1: type1, ...} so I don't really see the conflict here. I mean, yeah, it does build a map for the hybrid args, but it's only the mapping from the name to the type.

Comment thread src/Storages/StorageDistributed.cpp Outdated
Comment on lines +2790 to +2807
if (auto * func = node->as<ASTFunction>(); func && func->name == "hybridParam")
{
auto * arg_list = func->arguments ? func->arguments->as<ASTExpressionList>() : nullptr;
if (!arg_list || arg_list->children.size() != 2)
throw Exception(ErrorCodes::BAD_ARGUMENTS,
"hybridParam() requires exactly 2 arguments: (name, type)");

auto * name_lit = arg_list->children[0]->as<ASTLiteral>();
auto * type_lit = arg_list->children[1]->as<ASTLiteral>();
if (!name_lit || name_lit->value.getType() != Field::Types::String)
throw Exception(ErrorCodes::BAD_ARGUMENTS,
"hybridParam() first argument (name) must be a string literal");
if (!type_lit || type_lit->value.getType() != Field::Types::String)
throw Exception(ErrorCodes::BAD_ARGUMENTS,
"hybridParam() second argument (type) must be a string literal");

const auto & param_name = name_lit->value.safeGet<String>();
const auto & type_name = type_lit->value.safeGet<String>();
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.

IMHO we should abstract away these checks. Searching for type_lit->value.getType() != Field::Types::String shows 3 occurrences.

@svb-alt svb-alt added the port-antalya PRs to be ported to all new Antalya releases label May 5, 2026
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.

lgtm

@alsugiliazova
Copy link
Copy Markdown
Member

Verification report: Altinity/ClickHouse PR #1723

PR: #1723
Title: Antalya-26.3 frontport of #1659 — Add ALTER TABLE MODIFY SETTING support for Hybrid watermarks
Base: antalya-26.3 · State: OPEN, mergeable
Head SHA: ee97139559e9a1849045aa6133825e4a026b8bc9
Diff: +862 / -13 across 8 files · Labels: antalya, port-antalya, hybrid, antalya-26.3, forwardport.
CI run analyzed: latest run on PR head.
Sources: GitHub check-runs API + `gh-data`.checks + `gh-data`.clickhouse_regression_results.


Conclusion

CI red on head, but every failure is either a pre-existing flake or a regression-suite scenario already broken at baseline on antalya-26.3. No PR-caused regression found. Safe to merge.

Caveat — partial frontport (same as #1640 / #1646 / #1687 / #1694). Companion antalya-26.1 frontports are still missing on antalya-26.3; chronic regression failures here are branch-level missing-dependency symptoms. Note that this run does not include the Iceberg suites in failure (the iceberg jobs ran clean for this set), so the typical --iceberg_partition_timezone missing-dep signal is absent — but the same other chronic baselines (swarms, parquet, s3_export_partition) fire as expected.


CI on head ee971395 — failures

PR test workflow (3 failed checks, 42 success)

Check Test FAIL Class
Stateless tests (amd_debug, sequential) 00157_cache_dictionary Pre-existing flake — 106 / 25 PRs / 90d
Stateless tests (arm_asan, azure, sequential, 2/2) 03443_shared_storage_snapshots Pre-existing flake — 30 / 18
Stress test (arm_asan) Unknown error (job-level) Pre-existing instability — 5 occurrences / 5 PRs / 30d on antalya-26.3

Regression workflow (8 failed checks)

Check Top failing tests on PR-1723 builds (30d) Baseline (antalya-26.3, 30d) Class
Swarms (Release + Aarch64) node failure / initiator out of disk space (×8), swarm joins / join clause (×8) 78% / 49% Pre-existing broken
S3Export (partition) (Release + Aarch64) sanity / mismatched columns, partition export tight pool lock inside task, no partition by (×8 each) 50–60% Pre-existing broken
S3Export (part) (Release + Aarch64) /s3 suite-level fails flaky Pre-existing flaky
Parquet (Release + Aarch64) postgresql/mysql round-trip compression-type variants (×8 each) ~36% Pre-existing flaky

Regression DB on /PRs/1723/ builds (30d): 751 Fail / 23,591 OK ≈ 3.1%. Every top failure matches the all-PR baseline fail rate on antalya-26.3.


Related to PR diff?

PR is the 26.3 frontport of upstream #1659ALTER TABLE MODIFY SETTING for Hybrid table watermarks (8 files in Hybrid storage / settings plumbing).

Failing test Diff overlap Related?
00157_cache_dictionary, 03443_shared_storage_snapshots none No
Stress arm_asan Unknown error none — recurring on 5 unrelated PRs on antalya-26.3 No
swarms / *, parquet / *, s3_export_partition / *, s3_export_part / * none (Hybrid watermarks ≠ swarm clusters / parquet round-trip / export-partition) No

No failing test intersects the Hybrid-watermark code path or fails above the all-PR baseline.


Recommendations

  1. Safe to merge. Rerunning the 3 flaky PR-test jobs may clear them, but it is not blocking.
  2. Re-verify after the companion 26.1 → 26.3 frontports land (Antalya 26.1; Remote initiator improvements 2 #1608/Antalya 25.8: Remote initiator improvements 2 #1638, Fix attempt to create table from table function #1701, Cherry-pick: Fix: system.databases always shows data lake catalog databases #1690) — the chronic regression failures should drop noticeably once those land.
  3. The Stress arm_asan Unknown error recurring across 5 PRs on antalya-26.3 since late April is worth one shared investigation/tracking issue if not already filed.
  4. Same chronic-baseline cleanup recommendation as VERIFICATION_PR_1640.md for swarms / parquet / s3_export_partition scenarios.

Local checkout

cd /Users/alsugilyazova/workspace/altinity-clickhouse/ClickHouse
gh pr checkout 1723 --repo Altinity/ClickHouse
# HEAD: ee97139559e9a1849045aa6133825e4a026b8bc9

@alsugiliazova
Copy link
Copy Markdown
Member

PR #1723 audit — Hybrid watermarks ALTER TABLE ... MODIFY SETTING

PR: Antalya-26.3 Frontport of #1659 - Add ALTER TABLE MODIFY SETTING support for Hybrid watermarks

AI audit note: This review comment was generated by AI (gpt-5.3-codex).

Audit update for PR #1723 (Hybrid hybrid_watermark_* engine settings, runtime snapshot via MultiVersion, query-time substitution in StorageDistributed::read, ALTER validation and loadHybridWatermarkParams):

Confirmed defects

No confirmed defects in reviewed scope.

@alsugiliazova alsugiliazova added the verified Approved for release label May 11, 2026
@zvonand zvonand merged commit 4403244 into antalya-26.3 May 12, 2026
290 of 313 checks passed
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 hybrid 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.

5 participants