Skip to content

ci: use tmpfs for temporary ClickHouse files#73097

Merged
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
azat:ci-tmpfs
Dec 30, 2024
Merged

ci: use tmpfs for temporary ClickHouse files#73097
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
azat:ci-tmpfs

Conversation

@azat
Copy link
Copy Markdown
Member

@azat azat commented Dec 11, 2024

Some tests can be flaky due to very slow disks 1:

2024.12.08 23:41:38.215684 [ 436 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Debug> executeQuery: (from [::1]:38036) (comment: 00110_external_sort.sql) -- { echoOn }
 SELECT number FROM (SELECT number FROM system.numbers LIMIT 10000000) ORDER BY number * 1234567890123456789 LIMIT 9999990, 10 SETTINGS max_memory_usage='300Mi', max_bytes_before_external_sort='20M', min_external_sort_block_bytes='70M'; (stage: Complete)
2024.12.08 23:41:40.203353 [ 2005 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Trace> MergeSortingTransform: Will dump sorting block to disk (66.75 MiB > 19.07 MiB)
2024.12.08 23:41:40.204872 [ 2005 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Trace> TemporaryFileOnLocalDisk: Creating temporary file 'tmp50027017-924a-4723-83a3-221e37c78e69'
2024.12.08 23:41:40.205973 [ 2005 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Trace> DiskLocal: Reserved 66.78 MiB on local disk `_tmp_default`, having unreserved 125.12 GiB.
2024.12.08 23:41:40.208425 [ 2005 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Information> MergeSortingTransform: Sorting and writing part of data into temporary file disk(_tmp_default):///var/lib/clickhouse/tmp//tmp50027017-924a-4723-83a3-221e37c78e69
2024.12.08 23:43:09.177947 [ 2005 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Information> MergeSortingTransform: Done writing part of data into temporary file disk(_tmp_default):///var/lib/clickhouse/tmp//tmp50027017-924a-4723-83a3-221e37c78e69, compressed 55.08 MiB, uncompressed 69.88 MiB

Here it takes 2 minutes to write 55 MiB

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Dec 11, 2024
@robot-clickhouse
Copy link
Copy Markdown
Member

robot-clickhouse commented Dec 11, 2024

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

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

Check nameDescriptionStatus
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc❌ failure
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
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ 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. Integration 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
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
Stateful testsRuns stateful 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

@azat azat marked this pull request as ready for review December 11, 2024 17:00
@azat
Copy link
Copy Markdown
Member Author

azat commented Dec 11, 2024

Can someone also verify that the /tmp is the tmpfs on CI runners?

@alexey-milovidov
Copy link
Copy Markdown
Member

alexey-milovidov commented Dec 25, 2024

I have no idea, but CI uses Ubuntu, and on my machine, /tmp has the same filesystem as /, while /dev/shm is in RAM.

@azat azat marked this pull request as draft December 28, 2024 21:30
Some tests can be flaky due to very slow disks [1]:

    2024.12.08 23:41:38.215684 [ 436 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Debug> executeQuery: (from [::1]:38036) (comment: 00110_external_sort.sql) -- { echoOn }
     SELECT number FROM (SELECT number FROM system.numbers LIMIT 10000000) ORDER BY number * 1234567890123456789 LIMIT 9999990, 10 SETTINGS max_memory_usage='300Mi', max_bytes_before_external_sort='20M', min_external_sort_block_bytes='70M'; (stage: Complete)
    2024.12.08 23:41:40.203353 [ 2005 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Trace> MergeSortingTransform: Will dump sorting block to disk (66.75 MiB > 19.07 MiB)
    2024.12.08 23:41:40.204872 [ 2005 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Trace> TemporaryFileOnLocalDisk: Creating temporary file 'tmp50027017-924a-4723-83a3-221e37c78e69'
    2024.12.08 23:41:40.205973 [ 2005 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Trace> DiskLocal: Reserved 66.78 MiB on local disk `_tmp_default`, having unreserved 125.12 GiB.
    2024.12.08 23:41:40.208425 [ 2005 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Information> MergeSortingTransform: Sorting and writing part of data into temporary file disk(_tmp_default):///var/lib/clickhouse/tmp//tmp50027017-924a-4723-83a3-221e37c78e69
    2024.12.08 23:43:09.177947 [ 2005 ] {168c6479-53fd-4946-8475-1adc0ba4dedb} <Information> MergeSortingTransform: Done writing part of data into temporary file disk(_tmp_default):///var/lib/clickhouse/tmp//tmp50027017-924a-4723-83a3-221e37c78e69, compressed 55.08 MiB, uncompressed 69.88 MiB

Here it takes 2 minutes to write 55 MiB

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/72598/90ec40e2c1c07e8627619c8d3fbf1a298560fc11/stateless_tests_flaky_check__asan_.html

Note that /tmp and /dev/shm cannot be used due to their limitations:
/tmp is not mounted in Ubuntu (and is also not mounted by Docker), while
/dev/shm has a default size limit of 64MB. However, it is beneficial to
have this option explicitly configurable for flexibility.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
@azat
Copy link
Copy Markdown
Member Author

azat commented Dec 30, 2024

/dev/shm is no good, since on CI there is one more layer - docker, that mounts it with size=64M, so instead, I've added explicit --tmpfs /tmp/clickhouse

@azat azat marked this pull request as ready for review December 30, 2024 08:34
@azat
Copy link
Copy Markdown
Member Author

azat commented Dec 30, 2024

Stateless tests (tsan, s3 storage) [2/3] — fail: 1, passed: 2388, skipped: 71

  • S3_ERROR No such key thrown (see clickhouse-server.log or no_such_key_errors.txt)

@alexey-milovidov alexey-milovidov merged commit e2c010f into ClickHouse:master Dec 30, 2024
@azat azat deleted the ci-tmpfs branch December 30, 2024 19:12
@azat
Copy link
Copy Markdown
Member Author

azat commented Dec 30, 2024

I've looked briefly thought some tests that uses external sort/aggregation, and some of them apparently became slightly faster (i.e. 00284_external_aggregation)

@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Dec 30, 2024
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 pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants