Repository navigation
Add SYSTEM DISABLE ALL FAILPOINTS - #118877
Conversation
`SYSTEM ENABLE FAILPOINT` arms a fail point for the whole server, and the only way to undo it is to name it again. Whoever needs a server that injects nothing has to know what somebody else armed, which a test harness cannot: a `.sql` test stops at its first unexpected error and a `.sh` test can be killed on timeout, so the name is exactly what is missing at that point. `SYSTEM DISABLE ALL FAILPOINTS` disables every registered fail point and resumes whoever is blocked on a pauseable one, the same way `SYSTEM DISABLE FAILPOINT` does for a single name. It takes no argument and, like the other `SYSTEM ... FAILPOINT` statements, no `ON CLUSTER` - fail points are node-local state. It requires the same `SYSTEM FAILPOINT` grant, and it is a no-op rather than an error in a build without libfiu, where nothing can be armed in the first place: failing it would only make every caller special-case a build flag to ask for a state that already holds. Suggested in the review of #118863, which is where the harness will use it. Related: #118831 Related: #118832 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
`FailPointInjection::disableFailPoint` throws `BAD_ARGUMENTS` for a name it does not know, so the names scraped out of prose or out of an `EXPLAIN` - `fp`, `this_fail_point_does_not_exist`, and a handful of English words - each produced a warning. Those names never armed anything, so skip them silently and keep the warning for a server that actually stopped answering. This goes away entirely once `SYSTEM DISABLE ALL FAILPOINTS` (#118877) is in: the whole function becomes that one statement, with no names to scrape. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [aaaf29c] Summary: ❌
AI ReviewSummaryThis PR adds Findings
Tests
Final VerdictStatus: Minimum required actions:
LLVM Coverage ReportMeasured on commit aaaf29c.
Changed lines: Changed C/C++ lines covered: 57/66 (86.36%) · Uncovered code |
|
Renamed the test files to pass the style check |
Build profile diff (arm_release)Comparing commit See the job log for details. |
…p, document it in the `SYSTEM` statement docs - `05224_system_disable_all_failpoints_access`: the statement takes no name, so its `SYSTEM FAILPOINT` check has to be pinned on its own - `ACCESS_DENIED` without the privilege or with an unrelated `SYSTEM` privilege, success after `GRANT SYSTEM FAILPOINT`. - `05225_system_disable_all_failpoints_wakes_paused`: proves the contract the statement exists for - a thread parked on `infinite_sleep` and a `SYSTEM WAIT FAILPOINT ... PAUSE` waiter are both released by `SYSTEM DISABLE ALL FAILPOINTS`, and a re-enabled fail point gets a fresh channel afterwards. Modelled on `04095_wait_fp_pause_disable`, but waits for the pause with `SYSTEM WAIT FAILPOINT ... PAUSE` instead of a fixed sleep. - The `SYSTEM` statement docs are generated from `registerStatementSystem` in `ParserSystemQuery.cpp`, which had no fail point section at all; add one covering `ENABLE`, `DISABLE`, `DISABLE ALL`, `WAIT` and `NOTIFY FAILPOINT`, the no-`ON CLUSTER` rule and the required privilege, instead of relying on the `system.fail_points` page. - Renumber `05141_system_disable_all_fault_injection_points` to `05223`, the next free number after merging master. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118877&sha=f082cbbce7e77e652b895559115023bc217a4daa&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%29 ( |
|
Investigated: this is the #111892 family, and this occurrence is a container memcg kill of the server, misnamed by the result parser. From that run's The server's ceiling was 40.33 GiB, i.e. 0.75 x 53.78: The row name is downstream of the same event: Fix status: nothing in flight covers this one. #118467 bounds path glob expansion, which was the driver on an earlier head of this family but is not the driver here. #116359 restores the named OOM result for these jobs but keeps the same three dmesg patterns, so it does not recognise a memcg kill either. I will open a separate PR that makes the fuzzer job's memory partition explicit and holds the server inside it, and extend #116359 to recognise the memcg kill rather than touch that block in two PRs. I will link the PR here. |
|
Correcting my earlier comment: the mechanism I gave was wrong, and the fix is already in progress, so I am not opening a separate PR. The job's own SELECT DISTINCT c0 FROM file(concat('{"a":[1,2,3],"b":"str"}{"a":[1,2,3],"b":"str"}...', currentDatabase())) GROUP BY 1 WITH TOTALSwith that group repeated 16 times. So #118467 is the fix for this failure: its What I got wrong is worth recording, because it is the same trap for anyone else reading this row. I attributed the failure to the fuzzer job's memory partition after reading the |
The dmesg grep in the fuzzer jobs' OOM branch matched host-global kills only: 'Out of memory: Killed process', 'oom_reaper: reaped process' and 'oom-kill:constraint=CONSTRAINT_NONE'. A cgroup-scoped kill writes none of them. The kernel prints 'oom-kill:constraint=CONSTRAINT_MEMCG' for the constraint, and its victim line reads 'Memory cgroup out of memory: Killed process', whose lowercase 'out of memory' the existing capital-O pattern cannot match. While that branch stays silent, FuzzerLogParser falls through to 'Server unresponsive: memory limit exceeded' and names whichever Code: 241 was last in the server log, that is, a bystander query instead of the kill. That fall-through name carries 90 rows across 42 pull requests in the last 30 days, 75 of them on the AST fuzzer amd_debug family. Measured on two real dmesg captures of memcg kills of clickhouse-serv, from ClickHouse#118877 head f082cbb and ClickHouse#120028 head 53f179a: the three existing patterns match 0 lines in both, and the two added patterns match 1 line each, so the branch does not fire before this change and does after it. The global-OOM capture recorded earlier on this branch still matches, and the same capture with its OOM lines removed still does not. One downstream effect is deliberate and worth naming: a cgroup-scoped row now lands as the synthetic 'OOM in dmesg' rather than as 'Server unresponsive: memory limit exceeded', so revert_ci_regressions.py treats it as an aborted run instead of investigating it. That is the intended reading, and it matches the treatment this branch already gives the host-global kill. The old name was assigned from whichever Code: 241 happened to be last in the server log, so it named a bystander query and no single change to revert, while spending one of the four investigation slots a run has. Per that file's own docstring an over-inclusive list costs at most a wasted investigation, never a wrong revert.
|
Done: Verified on this run's |
A test whose file name contains `fail` makes every log scanner that greps for a failure report it, so the style check rejects such a name. Follow `05223_system_disable_all_fault_injection_points`, which this change already named that way. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
| } | ||
|
|
||
| # --- Part 1: a thread parked on a pauseable fail point is released --- | ||
| $CLICKHOUSE_CLIENT -q "SYSTEM ENABLE FAILPOINT infinite_sleep" |
There was a problem hiding this comment.
This test starts arming server-wide failpoints here, but it never installs any EXIT cleanup. If the shell dies after this point because the job times out or the script hits an unexpected error, later stateless tests can inherit infinite_sleep / dummy_pausable_failpoint still enabled and even a paused query still parked on them. That is the same failure mode this feature exists to clean up.
Please add a trap before the first SYSTEM ENABLE FAILPOINT, e.g. trap '$CLICKHOUSE_CLIENT -q "SYSTEM DISABLE ALL FAILPOINTS" 2>/dev/null || true' EXIT, and reap any background clients if needed.
|
|
||
| # Let the waiter reach the server before disabling. If it arrives late anyway the channel is | ||
| # already gone and `WAIT` returns at once, so the assertion below cannot hang either way. | ||
| for _ in $(seq 1 100) |
There was a problem hiding this comment.
This is only a best-effort delay, but this regression is the sole proof that SYSTEM DISABLE ALL FAILPOINTS wakes a SYSTEM WAIT FAILPOINT ... PAUSE waiter through the disabled flag path. If the WAIT query has not actually entered the server within these 10 seconds, line 64 still runs and the test passes on the weaker “channel was already gone, so WAIT returned immediately” path without ever exercising waitForPause on an existing channel.
Please make the waiter-start condition part of the assertion. shell_config.sh already provides wait_for_query_to_start, and you already assign an explicit query_id, so this can be made deterministic instead of silently accepting the uncovered path.
|
|
||
| `SYSTEM WAIT FAILPOINT ... PAUSE` blocks until a thread pauses on the given pauseable fail point (or the fail point is disabled), `... RESUME` blocks until the paused thread is resumed, and `SYSTEM NOTIFY FAILPOINT` resumes the paused threads without disabling the fail point. | ||
|
|
||
| Fail points are node-local state, so none of these statements accept `ON CLUSTER`. All of them require the `SYSTEM FAILPOINT` privilege. |
There was a problem hiding this comment.
This section correctly says that all of these statements use SYSTEM FAILPOINT, but the structured privilege description in src/Access/Common/AccessType.h still advertises only SYSTEM ENABLE FAILPOINT, SYSTEM DISABLE FAILPOINT, and SYSTEM WAIT FAILPOINT (it also misses the pre-existing SYSTEM NOTIFY FAILPOINT). Adding a new surface without updating that source of truth leaves system.privileges / grant documentation stale for users trying to discover what GRANT SYSTEM FAILPOINT covers.
Please extend the SYSTEM_FAILPOINT description while you are here so it enumerates the full statement set guarded by that privilege.
Related: #118863
Related: #118831
Related: #118832
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added
SYSTEM DISABLE ALL FAILPOINTS, which disables every fail point at once and resumes any thread blocked on a pauseable one.Description
Requested in the review of #118863.
SYSTEM ENABLE FAILPOINTarms a fail point for the whole server, and the only way to undo it is to name it again. Whoever needs a server that injects nothing has to know what somebody else armed - which a test harness cannot: a.sqltest stops at its first unexpected error and a.shtest can be killed on timeout, so the name is exactly what is missing at that point. That is how one racy test took04340_distributed_plan_status_reenqueue_faultdown with it for three days (#118832).SYSTEM DISABLE ALL FAILPOINTSdisables every registered fail point and resumes whoever is blocked on a pauseable one, exactly asSYSTEM DISABLE FAILPOINTdoes for a single name.ON CLUSTER- fail points are node-local state, and none of the otherSYSTEM ... FAILPOINTstatements accept it either. Both are rejected as a syntax error, which the test asserts.SYSTEM FAILPOINTgrant, so no new access type and no change tosystem.privileges.SYSTEM ... FAILPOINTstatements throw there, but failing this one would only make every caller special-case a build flag in order to ask for a state that already holds.ASTSystemQuery::Typereflects throughmagic_enum, so the new value gives the statement its keyword and its formatting for free; the enum'senum_rangeis already widened to 512 and 143 values fit. Two switches over the enum are exhaustive without adefaultand were extended, one of which (getRequiredAccessForDDLOnCluster) fails the build if a value is missed.Verified by compiling the four changed translation units with the project's own flags (
-Weverything -Werror), including a negative control: dropping the new value fromgetRequiredAccessForDDLOnClusterreproducesenumeration value 'DISABLE_ALL_FAILPOINTS' not handled in switch [-Werror,-Wswitch], so the check is not passing vacuously.Documentation entry for user-facing changes
Workflow [PR]
Sync PR [sync-upstream/pr/118877]
Version info
26.10.1.303-master(included in26.10and later)