Skip to content

Respect max_block_size while generating rows for system.stack_trace (will fix flakiness of the test) - #54946

Merged
robot-ch-test-poll3 merged 4 commits into
ClickHouse:masterfrom
azat:system.stack_trace-max_block_size
Sep 24, 2023
Merged

robot-ch-test-poll3 merged 4 commits into
ClickHouse:masterfrom
azat:system.stack_trace-max_block_size

Conversation

@azat

@azat azat commented Sep 23, 2023 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Respect max_block_size while generating rows for system.stack_trace (will fix flakiness of the test)

CI: https://s3.amazonaws.com/clickhouse-test-reports/54873/fbadf604096edfe435da2ac6944b896d745b2412/fast_test.html
Fixes: 01051_system_stack_trace

@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Sep 23, 2023
@robot-ch-test-poll3

robot-ch-test-poll3 commented Sep 23, 2023 •

Copy link
Copy Markdown
Contributor

This is an automated comment for commit 907d385 with description of existing statuses. It's updated for the latest CI running

✅ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR✅ success
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker image for serversThe check to build and optionally push the mentioned image to docker hub✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integrational tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Mergeable CheckChecks if all other necessary checks are successful✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Push to DockerhubThe check for building and pushing the CI related docker images to docker hub✅ success
SQLTestThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
SQLancerFuzzing tests that detect logical bugs with SQLancer tool✅ success
SqllogicRun clickhouse on the sqllogic test set against sqlite and checks that all statements are passed✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success
Style CheckRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

Reading from system.stack_trace can be very slow, especially if you read
all columns (there are some optimizations to avoid doing some actions),
that requires:
- reading /proc/self/task
- reading /proc/self/task/*/comm
- sending signal to each of the thread (to read query_id and trace_id)

And even if you have some conditions (for which there are some
optimizations, i.e. not sending signal to the thread which is the
slowest operation under load) it will still send signals to every thread
and wait for result.

This patch implements reading from system.stack_trace with respect to
max_block_size, that will make queries with lower max_block_size and
LIMIT works significantly faster.

Signed-off-by: Azat Khuzhin <[email protected]>
@azat
azat force-pushed the system.stack_trace-max_block_size branch from a4f210c to 907d385 Compare September 24, 2023 12:02
@azat

azat commented Sep 24, 2023

Copy link
Copy Markdown
Member Author

Conflicting files
tests/queries/0_stateless/01051_system_stack_trace.reference
tests/queries/0_stateless/01051_system_stack_trace.sql

Rebased on top of #54951

@alexey-milovidov alexey-milovidov self-assigned this Sep 24, 2023
@robot-ch-test-poll3
robot-ch-test-poll3 merged commit f23339b into ClickHouse:master Sep 24, 2023
@azat
azat deleted the system.stack_trace-max_block_size branch September 25, 2023 06:54
@alexey-milovidov

Copy link
Copy Markdown
Member

Instead of fixing the flakiness of the test, this change made it more flaky:

check_start_time check_name test_name report_url
2022-07-21 11:38:03 Stateless tests (debug, actions) [2/3] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/c24800c7d5693e7c595c10c8506aef2044f0a227/stateless_tests__debug__actions__[2/3].html
2022-07-22 02:38:14 Stateless tests (debug, actions) [2/3] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/e756144a6b192e0cc789551e02a2a5feea72828d/stateless_tests__debug__actions__[2/3].html
2022-07-25 22:11:35 Stateless tests (debug) [2/3] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/b6cb0e33f59458f96634c380c3b6f976b19c5981/stateless_tests__debug__[2/3].html
2022-08-02 04:13:16 Stateless tests (debug) [2/3] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/8a3ec52b5e06f20ccd3472aed7fa440b625ebc0e/stateless_tests__debug__[2/3].html
2022-08-05 14:37:17 Stateless tests (memory) [2/3] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/c983f14ed143a964c3daac12a6867d072027da1e/stateless_tests__memory__[2/3].html
2022-08-10 21:46:54 Stateless tests (debug) [2/3] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/1dcc1c6b7351912f03ff9908b71826ea1dbf587e/stateless_tests__debug__[2/3].html
2022-08-12 19:38:07 Stateless tests (debug) [2/3] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/a9c6a883dc6587c792e786c18552cd7ee7c8bc21/stateless_tests__debug__[2/3].html
2022-08-25 12:17:59 Stateless tests (debug) [2/3] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/c4f88117013874353123ce54367074659652fb75/stateless_tests__debug__[2/3].html
2023-02-25 20:59:51 Stateless tests (asan) [2/2] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/93dffb13c2e0f949465bc6a08591228b6e678056/stateless_tests__asan__[2/2].html
2023-07-17 13:57:41 Stateless tests (aarch64) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/db1b17277021be053475c34c5e988aa156d837a1/stateless_tests__aarch64_.html
2023-09-05 11:48:04 Stateless tests (aarch64) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/5da7133c9421873c86bf7d5d71e699267fcefbff/stateless_tests__aarch64_.html
2023-09-20 12:04:26 Stateless tests (aarch64) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/49ee14f70123298c8fcbef7494a30f7ff67b1b89/stateless_tests__aarch64_.html
2023-09-24 18:22:47 Stateless tests (release, analyzer) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/477922617c2823879383e2e75a73f98e2fc40346/stateless_tests__release__analyzer_.html
2023-11-03 10:16:34 Stateless tests (aarch64) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/55a1baf029ac1232fa302b874e6299eb38b0c4ed/stateless_tests__aarch64_.html
2023-11-13 10:48:17 Stateless tests (release, analyzer) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/d50b6deeee47dd977429a035a1e456a55eca57f9/stateless_tests__release__analyzer_.html
2023-11-15 18:58:09 Stateless tests (release, analyzer) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/bf1098951508dff6f1ec5e1787aaf4cae6f3de25/stateless_tests__release__analyzer_.html
2023-11-22 13:40:40 Stateless tests (release, analyzer) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/96a3cefff622b56ab40bc3de21e490fffbbe587c/stateless_tests__release__analyzer_.html
2023-11-24 00:17:44 Stateless tests (release, analyzer) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/e7d01cd0fa4910e05e2e6ec3cbff581406edef9c/stateless_tests__release__analyzer_.html
2023-11-24 11:34:26 Stateless tests (release, analyzer) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/650c1e959d133c35532f042cc4239ec54f94b011/stateless_tests__release__analyzer_.html
2023-11-27 00:54:39 Stateless tests (tsan) [4/5] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/de0876ed6804b23e281521ece4c701209e9299e6/stateless_tests__tsan__[4_5].html
2023-11-27 18:00:35 Stateless tests (release, analyzer) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/b38469ddf8b408c02896667f7207cbfcc489896f/stateless_tests__release__analyzer_.html
2023-11-29 08:33:32 Stateless tests (release, DatabaseReplicated) [4/4] 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/93360e4e2cb845fea316f6a43682234e637a52c2/stateless_tests__release__databasereplicated__[4_4].html
2023-11-29 17:53:27 Stateless tests (release, DatabaseOrdinary) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/97b63bbbca138f2821e92631a7359d816b67513c/stateless_tests__release__databaseordinary_.html
2023-12-04 11:51:55 Stateless tests (release, analyzer) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/4d3fde3624d4d8dbf1a5031233e0c04938c75539/stateless_tests__release__analyzer_.html
2023-12-07 12:38:28 Stateless tests (release, analyzer) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/a1e8c064337a2aa0313e48d5d475e513a7f54c8f/stateless_tests__release__analyzer_.html
2023-12-07 13:57:47 Stateless tests (release, DatabaseOrdinary) 01051_system_stack_trace https://s3.amazonaws.com/clickhouse-test-reports/0/6e813d66b290b1988a5975caafeed46e104346ca/stateless_tests__release__databaseordinary_.html

azat added a commit to azat/ClickHouse that referenced this pull request Dec 8, 2023
Before rewriting system.stack_trace to handle max_block_size (in ClickHouse#54946)
parallel reading from system.stack_trace was prohibited, because this
could lead to hang of system.stack_trace table.

But that rewrite broke this guarantee, so let's fix it to avoid possible
hung.

Signed-off-by: Azat Khuzhin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants