Bug #10178 | failure to find a row in heap table by concurrent UPDATEs | ||
---|---|---|---|
Submitted: | 26 Apr 2005 14:01 | Modified: | 28 Jun 2005 14:01 |
Reporter: | Andrei Elkin | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.1.11 | OS: | Linux (Linux Deb ker 2.4.26, libc2.3.2) |
Assigned to: | Ingo Strüwing | CPU Architecture: | Any |
[26 Apr 2005 14:01]
Andrei Elkin
[27 Apr 2005 10:32]
Geert Vanderkelen
Hi Andrei, Thanks for your Makefile and nice code! I was able to reproduce it. Some extra findings: - These are MEMORY (or HEAP) tables using HASH indexes (the default). - Small, only an int and double field, never comes near (any) limit - After a while, this fails "UPDATE t30 SET count = count + 1 WHERE col_key = 2;", randomly over 40 tables; col_key = 1 or = 2 or = 3, doesn't matter, no update goes. Table is not big, it happens randomly. Sometimes after 30k runs, sometimes 12k.. - ALTER TABLE t30 ENGINE=myisam; ALTER TABLE t30 ENGINE=memory; -- UPDATE works again on the table - If you update all rows "UPDATE t23 SET count= count +1", this works. Then normal updates like "UPDATE t23 SET count = count + 1 WHERE col_key = 1" again work Reproducable in 4.1.10a, 4.1.11, 5.0.4beta. Regards, Geert
[27 Apr 2005 10:57]
Geert Vanderkelen
Doesn't seem to to happen in 4.0.24. Geert
[10 Jun 2005 10:54]
Ingo Strüwing
Some progress information: - The test works like a charm on Linux 2.6.8. For hours. Without any failure or warning. - The msyqld server built on Linux 2.6 refuses to start on Linux 2.4. Error Message in the error log: [ERROR] bdb: unable to initialize mutex: Function not implemented - Completely rebuilt on Linux 2.4.27 (including make clean; configure; make; make install), the described failure message appears after a short time and the tests stops. - Also on Linux 2.4.27 I get a lot of warning messages saying "too many threads", but this does not affect the test. - The failure happens also with --debug=t:d, so that there might be an infinitesimal chance to locate the problem.
[10 Jun 2005 20:30]
Ingo Strüwing
My test script based on the bug report.
Attachment: bug10178-1.sh (application/x-sh, text), 10.23 KiB.
[10 Jun 2005 20:34]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/25893
[17 Jun 2005 7:44]
Ingo Strüwing
Patch approved with small changes by Email from Sergei.
[20 Jun 2005 9:01]
Ingo Strüwing
Review changes do not work. Need further investigation.
[22 Jun 2005 12:03]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/26298
[22 Jun 2005 12:27]
Ingo Strüwing
Back to patch approved as I made only the changes requested by the review. The problems turned out as explainable. Since the key statistics are now updated in info() only, and the updating methods did only update the statistics for bigger changes, it could happen that a command started with old statistics (the surprising thing is that open() is not always called at the beginning of a command). This can happen now too, but if a command does multiple changes, it can happen that the margin for "bigger" changes is triggered in the middle of the command. Formerly the statistics were updated at that moment, while now they are updated at the start of the next command (when info() is called).
[24 Jun 2005 15:47]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/26411
[24 Jun 2005 17:19]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/26414
[24 Jun 2005 17:41]
Ingo Strüwing
Fixed in 4.1.13 and 5.0.9.
[28 Jun 2005 14:01]
Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html Additional info: Documented fix in change history for 4.1.13 and 5.0.9. Closed.