Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new profile events for queries with subqueries #50204

Merged
merged 2 commits into from May 30, 2023

Conversation

azat
Copy link
Collaborator

@azat azat commented May 24, 2023

Changelog category (leave one):

  • Improvement

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

Add new profile events for queries with subqueries (QueriesWithSubqueries/SelectQueriesWithSubqueries/InsertQueriesWithSubqueries)

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-improvement Pull request with some product improvements label May 24, 2023
@robot-clickhouse-ci-1
Copy link
Contributor

robot-clickhouse-ci-1 commented May 24, 2023

This is an automated comment for commit 2e34700 with description of existing statuses. It's updated for the latest CI running
The full report is available here
The overall status of the commit is 🔴 failure

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🔴 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🟢 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🔴 failure
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
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🔴 failure
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors🔴 failure
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

@CheSema
Copy link
Member

CheSema commented May 26, 2023

Well. I think it is a good PR.
Could you implement Queries with proper explanation? After SelectQueriesand InsertQueries could refer to the Queries as the same way as SelectQuery/InsertQuery refer to the Query.
Does it include subqueries as well? If so it deserves to be mentioned and tested.

@CheSema CheSema self-assigned this May 26, 2023
@CheSema
Copy link
Member

CheSema commented May 26, 2023

What happens if InterpreterSelectQueryAnalyzer runs instead when allow_experimental_analyzer is true?

@alexey-milovidov
Copy link
Member

@azat ok, but the name is confusing. Let's rename it to something else, like SelectQueriesWithViews...

@azat azat marked this pull request as draft May 26, 2023 15:01
@azat azat marked this pull request as ready for review May 26, 2023 16:15
Differs from SelectQuery/InsertQuery that it could be > 1 (in case of
MATERIALIZED VIEW attached to the table), since each local SELECT/INSERT
query is accounted, not only initial.

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

azat commented May 26, 2023

@azat ok, but the name is confusing. Let's rename it to something else, like SelectQueriesWithViews...

@alexey-milovidov Indeed, though this is not only about views, but subqueries as well, I think SelectQueriesWithSubqueries suits better.

Could you implement Queries with proper explanation?

@CheSema Ok, let's do this to make it less transparent for user.

Does it include subqueries as well? If so it deserves to be mentioned and tested.

Now it does (tests had been updated as well).

What happens if InterpreterSelectQueryAnalyzer runs instead when allow_experimental_analyzer is true?

Good catch! Fixed.

@azat azat changed the title Add new profile events SelectQueries/InsertQueries Add new profile events for queries with subqueries May 27, 2023
Settings does not contains unchanged values, and the value is considered
unchanged, if it matches the default.

So simply use the shell variable instead of Settings.

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

azat commented May 28, 2023

Test failures does not looks related:

Stateless tests (release, analyzer) — fail: 4, passed: 5290, skipped: 19

AST fuzzer (ubsan) — Received signal -1
Integration tests (tsan) [6/6] — fail: 1, passed: 443, flaky: 0

2023.05.27 15:03:19.946601 [ 148 ] {} <Fatal> BaseDaemon: Code: 439. DB::Exception: Cannot schedule a task: no free thread (timeout=0) (threads=32, jobs=10000). (CANNOT_SCHEDULE_TASK), Stack trace (when copying this message, always include the lines below):

[ClickHouse Integration Tests (release) 4/4

  • test_ssl_cert_authentication/test.py::test_https_non_ssl_auth - flaky

ClickHouse Stateless Tests (release, DatabaseReplicated) [2/4]

  • 02125_many_mutations - flaky
  • 02703_keeper_map_concurrent_create_drop

ClickHouse Stress Test (msan)

elapsed:              1491.543326
query:                SELECT CounterID, quantileTiming(0.5)(SendTiming) AS qt, least(30000, quantileExact(0.5)(SendTiming)) AS qe, count() AS c, round(abs(qt - qe) / greatest(qt, qe) AS diff, 3) AS rounded_diff FROM test.hits WHERE SendTiming != -1 GROUP BY CounterID HAVING diff != 0 ORDER BY diff D
...
::__pthread_mutex_lock
./build_docker/./contrib/llvm-project/libcxx/src/mutex.cpp:39::std::__1::mutex::lock()
./build_docker/./contrib/llvm-project/libcxx/include/__mutex_base:0::DB::FileSegment::state() const
./build_docker/./src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp:1011::DB::CachedOnDiskReadBufferFromFile::nextImplStep()
./build_docker/./src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp:770::DB::CachedOnDiskReadBufferFromFile::nextImpl()
$ zstd -cd clickhouse-server.stress.log.zst | grep -F '[ 3347 ]' | head -n1
2023.05.27 15:13:32.065877 [ 3347 ] {42153e7f-c8d6-4c5c-ace6-829bdd7a52f4} <Test> ReadBufferFromRemoteFSGather: Reading from file: 00170_test/drx/advzchhrlwnogapbcjxocapaphdba (store/575/575b7ef0-5282-4ebb-9c45-59477d59bc62/201403_1_7_1/SendTiming.bin)
$ zstd -cd clickhouse-server.stress.log.zst | grep -F '[ 3347 ]' | tail -n1
2023.05.27 15:47:57.998183 [ 3347 ] {ad0fcc57-7e83-4754-b0dd-a6804494ce71} <Test> CachedOnDiskReadBufferFromFile: Key: 7bd7e731c5586ccb4581623965894460. Returning with 2 bytes, buffer position: 1643590 (offset: 0, predownloaded: 0), buffer available: 2, current range: [1254434, 2018644], file offset of buffer end: 1643592, impl offset: 1643592, file segment state: PARTIALLY DOWNLOADED NO CONTINUATION, current write offset: 1262022, read_type: REMOTE_FS_READ_BYPASS_CACHE, reading until position: 2018645, started with offset: 0, remaining ranges: [1254434, 2018644]
$ zstd -cd clickhouse-server.stress.log.zst | tail -n2
2023.05.27 15:47:58.000452 [ 35581 ] {11f95335-ebfe-4827-8871-42df91ea7323} <Test> CachedOnDiskReadBufferFromFile: Read 2 bytes, read type REMOTE_FS_READ_BYPASS_CACHE, position: 1635466, offset: 1635468, segment end: 2018644
2023.05.27 15:48:00.750074 [ 1662 ] {} <Information> Application: Child process exited normally with code 0.

Maybe it looks similar to #49714? cc @kssenii

@CheSema CheSema merged commit 84d6bfe into ClickHouse:master May 30, 2023
251 of 257 checks passed
@azat azat deleted the InsertSelectQueries-pe branch May 30, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-improvement Pull request with some product improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants