Repository navigation
Reject unknown fail point names in SYSTEM FAILPOINT statements - #112680
Conversation
`FailPointInjection::disableFailPoint` accepted any string and silently did nothing when the name was not a registered fail point, while its sibling `enableFailPoint` rejected it with `BAD_ARGUMENTS`. A typo in `SYSTEM DISABLE FAILPOINT` therefore reported success and left the intended fail point armed, with no diagnostic. Root cause: `disableFailPoint` never consulted the `APPLY_FOR_FAILPOINTS` registry that `enableFailPoint` validates against. `fiu_disable` does return -1 on a miss, but that value cannot be used as the trigger because it is also -1 for a registered name that is simply not currently enabled. Add the missing registry check, mirroring `enableFailPoint`. The check is deliberately on registration and never on enabled state: disabling a registered fail point that is not currently enabled must stay a silent no-op, because callers do idempotent cleanup such as a trap on EXIT, a `SCOPE_EXIT`, or a bulk reset that reads names out of `system.fail_points`. Two in-tree tests carried exactly this typo and are corrected here: `02718_insert_meet_hardware_error` and `02919_insert_meet_eternal_hardware_error` both disabled `replicated_commit_zk_fail_after_op`, which is missing the `_merge_tree` infix and matches no registry entry. They passed only because their fail point is ONCE and fires before the mistyped disable is reached, so it had already self-disarmed. Without the test edits they would newly fail on the checked build, which is what makes them part of this change. The new test uses `clickhouse-local` rather than the shared server because fail point state is process global; a shared-server test asserting that state races concurrent copies of itself, so this form stays parallel safe without a no-parallel tag. Co-Authored-By: Claude Fable 5 <[email protected]>
The Style check's `check_functional_test_cases` rejects any functional test whose path contains the substring `fail`, and it traverses the whole `tests/queries` tree rather than the pull request diff, so the previous name `04657_disable_failpoint_unknown_name` turned the check red regardless of what this branch touches. It would have been the first such path among the 12978 traversal-eligible files, which is why no existing fail point test hit it. The abbreviation `fp` is the form already used by `04095_wait_fp_pause_disable` and `02294_fp_seconds_profile`. Renumber to 04658 at the same time: master landed `04657_cuturlparameter_documented_behavior` while this branch was open, so 04657 had become a duplicate number. Nothing in CI catches that, because the gap check keys on a set of integers and the test runner has no duplicate guard, but it is still a numbering collision a reader would trip over. 04658 is free and keeps the large-gap count at zero. Also condense the comment header. The bug narrative it carried is already in the commit message of the fix and in the pull request description, and a comment that restates them goes stale independently. The rationale a future editor cannot recover from elsewhere is kept verbatim: why the test uses `clickhouse-local` rather than the shared server, why `dummy_failpoint` is the carrier, and which rows are must-not-change controls rather than evidence. No behaviour change: the executable lines are byte-identical and the reference file is unchanged. Co-Authored-By: Claude Fable 5 <[email protected]>
Internal second-model review (2 rounds, 12 findings, click to expand)Two independent review rounds ran against this change: a cold read of the resulting code, plus a Fixed in this PR
Raised and refuted before adjudicationThree candidate blockers were self-raised against the new
The full sweep is 260 Noted, not blocking
Both directions are Build-ID verified: pristine master fails the new test, the fix passes it, a Session id: cron:clickhouse-review-slot-10:20260730-224300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-review-slot-10:20260730-224300 |
|
cc @Algunenano @nikitamikhaylov, could you review this? |
|
Workflow [PR], commit [cb53297] Summary: ❌
AI ReviewSummaryThis PR makes unknown fail point names reject consistently across the Documented surface
Final Verdict✅ No new review findings. |
SYSTEM DISABLE FAILPOINTSYSTEM FAILPOINT statements
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 23/23 (100.00%) · Uncovered code |
CI finish ledger - cb53297Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20260801-003000 |
|
Fixing PR for the |
d34a7fa
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
SYSTEM DISABLE FAILPOINTnow rejects a fail point name that does not exist, raisingBAD_ARGUMENTSlikeSYSTEM ENABLE FAILPOINTalready did. Previously a mistyped name reported success while leaving the intended fail point enabled, with no indication that nothing had been disabled.Description
FailPointInjection::disableFailPointaccepted any string and silently did nothing when thename was not a registered fail point, while its sibling
enableFailPointrejected it withBAD_ARGUMENTS. A typo inSYSTEM DISABLE FAILPOINTtherefore reported success and left theintended fail point armed, with no diagnostic.
Two in-tree tests carry exactly that typo today:
02718_insert_meet_hardware_errorand02919_insert_meet_eternal_hardware_errorboth disablereplicated_commit_zk_fail_after_op, which is missing the_merge_treeinfix and matches noregistry entry. They pass only because their fail point is
ONCEand fires before the mistypeddisable is reached, so it has already self-disarmed.
Root cause:
disableFailPointnever consulted theAPPLY_FOR_FAILPOINTSregistry thatenableFailPointvalidates against, andfiu_disablereturns-1for both an unknown nameand a known-but-not-enabled one, so its return value cannot distinguish them. The fix adds the
missing registry check, mirroring
enableFailPoint, and corrects the two mistyped tests.The check is deliberately on registration and never on enabled state: disabling a registered
fail point that is not currently enabled stays a silent no-op, because callers do idempotent
cleanup (a
traponEXIT, aSCOPE_EXIT, the bulk reset proposed in #105942). Those bulkdisables read names out of
system.fail_points, so they stay registered and keep working.This changes documented behaviour for one input class: an unregistered name now raises
BAD_ARGUMENTSinstead of returning success. It is reachable only with theSYSTEM_FAILPOINTgrant.
All 113 registered fail point names disabled by any stateless or integration test were issued
against the fixed server, and none was rejected. The new test uses
clickhouse-localbecausefail point state is process global, which keeps it parallel safe without a
no-paralleltag.SYSTEM WAIT FAILPOINThas the same silence for an unregistered name, but there it isload-bearing for a registered name with no active channel, so it is left for a follow-up.