Skip to content

Fix flaky test_multiple_disks#51821

Merged
alexey-milovidov merged 5 commits intomasterfrom
less-flaky-test_start_stop_moves
Jul 7, 2023
Merged

Fix flaky test_multiple_disks#51821
alexey-milovidov merged 5 commits intomasterfrom
less-flaky-test_start_stop_moves

Conversation

@antonio2368
Copy link
Copy Markdown
Member

@antonio2368 antonio2368 commented Jul 5, 2023

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

The test creates 5 parts and we check that the first part is moved to the external disk. The problem is after START MOVE only subset of parts can be moved, increasing the modification time of the first part. The oldest part becomes a later insert because it was not moved so modification time is lower. Multiple moves are also done in parallel so later insert can also be moved before the first inserted part.
All in all, we need to check explicitly until the first part is moved to the external

Fix #45404

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

@antonio2368 antonio2368 changed the title Properly check the disk of the first part in test_start_stop_moves Fix flaky test_multiple_disks::test_start_stop_moves Jul 5, 2023
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 5, 2023
@robot-ch-test-poll2
Copy link
Copy Markdown
Contributor

robot-ch-test-poll2 commented Jul 5, 2023

This is an automated comment for commit 0b0ce51 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🟡 pending
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🔴 failure
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🟢 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

@alesapin alesapin self-assigned this Jul 5, 2023
@antonio2368
Copy link
Copy Markdown
Member Author

I suspect test_background_move has the same problem, will change it also

@antonio2368 antonio2368 force-pushed the less-flaky-test_start_stop_moves branch from 18b2f61 to 47cffa6 Compare July 5, 2023 10:41
@antonio2368 antonio2368 changed the title Fix flaky test_multiple_disks::test_start_stop_moves Fix flaky test_multiple_disks Jul 5, 2023
@CheSema
Copy link
Copy Markdown
Member

CheSema commented Jul 5, 2023

Hi. It happens that I'm also looking at this.
According to your explanation, some moves are take place after that is done

node1.query("SYSTEM START MOVES {}".format(name))

However Im reading the logs.
That for example https://s3.amazonaws.com/clickhouse-test-reports/51696/7b6b406af1dfa3f658b80c1f977375d053ae559f/integration_tests__asan__[4_6].html
I do not see any moves for all the time after START MOVES.
There should be a message Got {} parts to move.

My theory is that somehow background_moves_assignee.postpone() has been called too much times. I'm checking it right now. If you are sure that you fixed it totally, I will stop digging.

@antonio2368
Copy link
Copy Markdown
Member Author

antonio2368 commented Jul 5, 2023

@CheSema funny you mentioned this because I was looking at the exact issue now.
Noticed that a different assert failed in these 2 runs:
https://s3.amazonaws.com/clickhouse-test-reports/0/2575db15221dbe3ebbf3c109ea67c1255dfb7b1b/integration_tests__tsan__[4_6].html
https://s3.amazonaws.com/clickhouse-test-reports/0/41783c47d1fead9e8094dc460038e6571de1e83a/integration_tests__asan__[4_6].html

and they are the same as the ones you mentioned.

I quickly checked the logs and the only thing I noticed for now that moves are completely blocked for some reason like you said. I started digging deeper into the logic of assigning the move task but now I saw your message.

As you already started looking at it, can you continue on this branch so we completely fix the test with this PR? My PR solves only one of the issues and I hope you will fix the second part.

@CheSema
Copy link
Copy Markdown
Member

CheSema commented Jul 5, 2023

mine 5 cents here would be

max_replicated_merges_in_queue=0

explanation
#45404 (comment)

@alexey-milovidov alexey-milovidov merged commit 1fa2170 into master Jul 7, 2023
@alexey-milovidov alexey-milovidov deleted the less-flaky-test_start_stop_moves branch July 7, 2023 10:29
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.

Flaky test_multiple_disks

5 participants