Skip to content

Backport #115976 to 26.6: Fix a segfault of showCertificate when TLS certificates are provisioned by ACME - #116517

Merged
clickhouse-gh[bot] merged 2 commits into
26.6from
backport/26.6/115976
Aug 28, 2026
Merged

clickhouse-gh[bot] merged 2 commits into
26.6from
backport/26.6/115976

Conversation

@robot-clickhouse

@robot-clickhouse robot-clickhouse commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Original pull-request #115976
Cherry-pick pull-request #115996

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.6.4.33

@robot-clickhouse robot-clickhouse added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix labels Aug 26, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [7c375ba]

Summary: ✅

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged 26.6 into the branch to keep it current.

CI status of the previous run (5505de32) — two failures, both unrelated to this backport (which only touches showCertificate / CertificateReloader / X509Certificate and the test_acme_tls integration tests):

  1. test_storage_kafka/test_batch_slow_0.py::test_kafka_formats_with_broken_message[generate_old_create_table_query] — known flake, already fixed on 26.6 by Backport #111701 to 26.6: Fix flaky test_kafka_formats_with_broken_message #116741 (merged 2026-08-27). The merge in this push pulls the fix in, so this should clear on the next run.

  2. Stress test (amd_tsan) — Received signal 6 (internal): the deliberate std::terminate in MergeTreeData::loadOutdatedDataParts fires because lockForShare at src/Storages/MergeTree/MergeTreeData.cpp:2989 throws TABLE_IS_BEING_RESTARTED (code 733) while the stress runner concurrently restarts the replica:

    test_oj7l1c91.t_mutation_param_r: Loading of outdated parts failed. Will terminate to avoid
    undefined behaviour due to inconsistent set of parts.
    Exception: Code: 733. DB::Exception: Table test_oj7l1c91.t_mutation_param_r is being restarted.
      5. src/Storages/IStorage.cpp:73: DB::IStorage::lockForShare(...)
      6. src/Storages/MergeTree/MergeTreeData.cpp:2989: DB::MergeTreeData::loadOutdatedDataParts(bool)
    

    This is a pre-existing structural issue, not a regression here: CIDB shows this loadOutdatedDataParts terminate recurring roughly daily across many unrelated pull requests and on master itself (pull_request_number = 0) for the last two months. It is the same fail-fast reported in Stress test 'px != 0' residual: loadOutdatedDataParts terminate on transient MEMORY_LIMIT_EXCEEDED #106736, only with a different transient trigger (TABLE_IS_BEING_RESTARTED from lockForShare instead of MEMORY_LIMIT_EXCEEDED from part loading).

    Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=116517&sha=5505de32860ed125154c8af3e6130bbecd61fa64&name_0=BackportPR&name_1=Stress%20test%20%28amd_tsan%29

@groeneai, investigate the Stress test (amd_tsan) failure above and provide a fix in a separate pull request (a transient TABLE_IS_BEING_RESTARTED while the replica is restarting should not be treated as an inconsistent set of parts). If a fix is already in progress, link it here and on #106736.

@groeneai

Copy link
Copy Markdown
Collaborator

Already in progress, and it covers this exact shape: #107091. It replaces the lockForShare you cite (MergeTreeData.cpp:2989 on 26.6, :3507 on master) with tryLockForShare plus a reschedule, so a table that is being restarted, dropped or detached makes the loader return with a backoff instead of reaching the terminating catch; a DEADLOCK_AVOIDED from the timed acquisition takes the same path. test_restart_replica_while_loading_outdated_parts_does_not_terminate covers it.

One thing that is not obvious from that PR's title: isRetryableException has no TABLE_IS_BEING_RESTARTED arm, so its retryable-error half would not have caught this trigger. The lock replacement is what does.

26.6 is covered without any action from you: #107091 targets master but already carries v26.6-must-backport (applied by @ PedroTadim on 2026-07-23), so the robot will open the 26.6 backport once it merges.

Since you asked for a separate pull request first, one offer. #107091 has grown to +1810/-31 over 8 files and 18 integration tests, and @ PedroTadim has questioned the number of failpoints in it. The 733 fix on its own is +37/-1 in MergeTreeData.cpp plus two failpoints and two tests. If you would rather have that land separately and quickly, say so and I will split it out.

@clickhouse-gh
clickhouse-gh Bot merged commit ab7e6a2 into 26.6 Aug 28, 2026
39 of 40 checks passed
@clickhouse-gh
clickhouse-gh Bot deleted the backport/26.6/115976 branch August 28, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants