Skip to content

Detect io_uring in tests#60373

Merged
alexey-milovidov merged 3 commits intoClickHouse:masterfrom
azat:tests/detect-io_uring
Feb 25, 2024
Merged

Detect io_uring in tests#60373
alexey-milovidov merged 3 commits intoClickHouse:masterfrom
azat:tests/detect-io_uring

Conversation

@azat
Copy link
Copy Markdown
Member

@azat azat commented Feb 24, 2024

@robot-clickhouse-ci-1
Copy link
Copy Markdown
Contributor

robot-clickhouse-ci-1 commented Feb 24, 2024

This is an automated comment for commit 554d993 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
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ 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 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. 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
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
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
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ 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
Check nameDescriptionStatus
A SyncThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS❌ failure
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❌ failure
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⏳ pending
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests❌ failure
Mergeable CheckChecks if all other necessary checks are successful❌ failure
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc❌ failure
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors❌ failure

@azat azat force-pushed the tests/detect-io_uring branch from 7cac803 to 554d993 Compare February 24, 2024 18:37
@alexey-milovidov alexey-milovidov merged commit 648e6ec into ClickHouse:master Feb 25, 2024
@alexey-milovidov alexey-milovidov self-assigned this Feb 25, 2024
@alexey-milovidov
Copy link
Copy Markdown
Member

@azat We updated to the new AMI in AWS, which does not enable uring by default.
We should either find a way to enable it (probably with some sysctl), or remove uring from the codebase as we lose the way to test it, and every untested feature is the same as nonexistent.

@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 25, 2024
@Felixoid
Copy link
Copy Markdown
Member

Felixoid commented Feb 25, 2024

The AMI is deployed in #60316

I've spun a test on some fresh host, and here's the result:

$ curl -O https://s3.amazonaws.com/clickhouse-builds/24.2/32607cc7967712890d6dd53cf82a409876bcf459/package_tsan/clickhouse -s
$ chmod +x clickhouse && ./clickhouse local -q "select * from file('/dev/null', 'LineAsString')" --storage_file_read_method io_uring
Decompressing the binary.....................
$ echo $?
0

I am not sure if the AMI is a reason here.

@Felixoid
Copy link
Copy Markdown
Member

For example, here's the failing test https://s3.amazonaws.com/clickhouse-test-reports/0/f70d4d9372e02790c7c585a41862b70efc0b6fd4/stateless_tests__tsan__[1_5].html

I open the job and see the machine type m6i.4xlarge. And the host with the same type works.

I run then the same in the same container

$ docker run -v ~/clickhouse:/clickhouse clickhouse/stateless-test:238cad023c02 /clickhouse local -q "select * from file('/dev/null', 'LineAsString')" --storage_file_read_method io_uring && echo OK || echo FAILED
OK

It's very strange, and I am open to ideas

nickitat added a commit to nickitat/ClickHouse that referenced this pull request Feb 25, 2024
…_uring"

This reverts commit 648e6ec, reversing
changes made to 273b483.
@nickitat
Copy link
Copy Markdown
Member

nickitat commented Feb 25, 2024

what are the chances that we're getting a kernel < 5.6?)
I found this code in lib tests: axboe/liburing@3508db9

@Felixoid
Copy link
Copy Markdown
Member

Felixoid commented Feb 25, 2024

what are the chances that we're getting a kernel < 5.6?) I found this code in lib tests: axboe/liburing@3508db9

I'd say 0.00000...1%

# arm64 host
$ uname -a
Linux ip-172-31-3-162 6.5.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Feb 15 19:20:45 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
# x86_64 host
$ uname -a
Linux ip-172-31-10-141 6.5.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Feb 15 15:27:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

@nickitat
Copy link
Copy Markdown
Member

I'm not 100% sure since not all checks are finished, but seems to work: #60383 (comment)

@Felixoid
Copy link
Copy Markdown
Member

Hmm, in the old AMI there's an older kernel

$ uname -a
Linux ip-172-31-45-130 6.2.0-1015-aws #15~22.04.1-Ubuntu SMP Fri Oct  6 23:21:18 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

@jrdi jrdi mentioned this pull request Feb 26, 2024
@azat azat deleted the tests/detect-io_uring branch February 26, 2024 21:03
@azat
Copy link
Copy Markdown
Member Author

azat commented Feb 26, 2024

$ curl -O https://s3.amazonaws.com/clickhouse-builds/24.2/32607cc7967712890d6dd53cf82a409876bcf459/package_tsan/clickhouse -s
$ chmod +x clickhouse && ./clickhouse local -q "select * from file('/dev/null', 'LineAsString')" --storage_file_read_method io_uring

@Felixoid this does not work without this PR

@Felixoid
Copy link
Copy Markdown
Member

What I've tried to show is that I can't reproduce the issue, unfortunately

@azat
Copy link
Copy Markdown
Member Author

azat commented Feb 27, 2024

Indeed, because you were trying binary without this PR, while this PR two things:

  • storage_file_read_method=io_uring for clickhouse-local
  • detection of io_uring via this in clickhouse-test

@Felixoid
Copy link
Copy Markdown
Member

Here we go. Compare current version 25.0.3 to 24.0.7. Docker removed the io_uring from the default allowed syscalls

@Felixoid
Copy link
Copy Markdown
Member

And that's what works:

ubuntu@ip-172-31-70-76:~$ curl -O https://s3.amazonaws.com/clickhouse-builds/24.2/648e6ec5a63f777c5c44405d45574aaebf77142b/package_release/clickhouse -s
ubuntu@ip-172-31-70-76:~$ chmod +x clickhouse && ./clickhouse local -q "select * from file('/dev/null', 'LineAsString')" --storage_file_read_method io_uring
Decompressing the binary.................
ubuntu@ip-172-31-70-76:~$ echo $?
0
ubuntu@ip-172-31-70-76:~$ docker run --security-opt seccomp=unconfined -v ~/clickhouse:/clickhouse clickhouse/stateless-test:238cad023c02 /clickhouse local -q "select * from file('/dev/null', 'LineAsString')" --storage_file_read_method io_uring && echo OK || echo FAILED
OK
ubuntu@ip-172-31-70-76:~$ docker run -v ~/clickhouse:/clickhouse clickhouse/stateless-test:238cad023c02 /clickhouse local -q "select * from file('/dev/null', 'LineAsString')" --storage_file_read_method io_uring && echo OK || echo FAILED
Code: 1. DB::Exception: io_uring is not supported by this system: While executing File. (UNSUPPORTED_METHOD)
FAILED

@Felixoid
Copy link
Copy Markdown
Member

And here's the PR implementing it moby/moby#46762

@Algunenano
Copy link
Copy Markdown
Member

I'm going to backport this change to other public releases, as otherwise the CI there is completely broken

@Algunenano Algunenano added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Mar 1, 2024
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Mar 1, 2024
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-backports-created-cloud deprecated label, NOOP label Mar 1, 2024
alexey-milovidov added a commit that referenced this pull request Mar 1, 2024
Backport #60373 to 24.1: Detect io_uring in tests
alexey-milovidov added a commit that referenced this pull request Mar 1, 2024
Backport #60373 to 23.12: Detect io_uring in tests
alexey-milovidov added a commit that referenced this pull request Mar 1, 2024
Backport #60373 to 23.8: Detect io_uring in tests
alexey-milovidov added a commit that referenced this pull request Mar 1, 2024
Backport #60373 to 23.3: Detect io_uring in tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backports-created-cloud deprecated label, NOOP pr-must-backport Pull request should be backported intentionally. Use this label with great care! 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.

10 participants