MDEV-17746: perfschema.dml_threads failed in buildbot with wrong errno#5395
MDEV-17746: perfschema.dml_threads failed in buildbot with wrong errno#5395gkodinov wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the dml_threads performance schema test to query the current connection's thread ID before attempting an invalid update, ensuring the target row exists. It also introduces a master option file setting performance_schema_max_thread_instances to 50,000. The reviewer pointed out that this value is higher than the 10,000 specified in the pull request description, which could cause unnecessary memory consumption, and recommended lowering it to 10,000 and adding a trailing newline.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
3ea6257 to
da86bb0
Compare
There was a problem hiding this comment.
Pull request overview
Stabilizes the perfschema.dml_threads MTR test under heavy concurrency by ensuring the session’s performance_schema.threads row exists before running an UPDATE ... WHERE PROCESSLIST_ID=CONNECTION_ID() that is expected to error, and by increasing the PFS thread-instance sizing for this test run.
Changes:
- Adds a deterministic
SELECT(with--replace_column) to confirm a matchingperformance_schema.threadsrow exists before the error-expected update. - Increases
performance_schema_max_thread_instancesfor the test via a newdml_threads-master.opt. - Updates the expected result output accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| mysql-test/suite/perfschema/t/dml_threads.test | Adds a pre-check SELECT (with column replacement) before the error-expected update. |
| mysql-test/suite/perfschema/t/dml_threads-master.opt | Sets a higher performance_schema_max_thread_instances for this test to reduce flakiness under load. |
| mysql-test/suite/perfschema/r/dml_threads.result | Records the new SELECT output in the expected result. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
da86bb0 to
0196864
Compare
The test was trying to update the performance_schema.threads row for
the current connection. And if that row was not found there's nothing
to update hence no update not allowed error.
If the maximum number of instrumented threads is hit the assumption
that there's always a row in performance_schema.thread for the current
thread does not hold. This can happen under heavy concurrent load.
mtr sets the maximum number of instrumented threads to 400. This is
not much.
Stabilized the test as follows:
* Added a SELECT with the same conditon to ensure there's a row to
be updated by the UPDATE following the select.
* Increased the performance_schema_max_thread_instances to 50k
for the test.
0196864 to
7597a99
Compare
|
Looks strange. What do you mean "can happen under heavy concurrent load" ? There is no concurrent load in mtr, every test always runs on a dedicated server, "concurrent" mtr means many servers running concurrently, not all tests on a single server. |
|
Hitting that limit is the only possible explanation on why this particular query fails to update and the one prior to it is passing. What causes the thread depletion is a subject to a whole different study. But this bug is about stability of the test. |
|
|
|
Simplified test: ./mtr --repeat=2 It demonstrates a valid row in the table whereas update still succeeds. |
The test was trying to update the performance_schema.threads row for the current connection. And if that row was not found there's nothing to update hence no update not allowed error.
If the maximum number of instrumented threads is hit the assumption that there's always a row in performance_schema.thread for the current thread does not hold. This can happen under heavy concurrent load. mtr sets the maximum number of instrumented threads to 400. This is not much.
Stabilized the test as follows: