[MDEV-28200] Rows just inserted sometimes not returned by select afterwards Created: 2022-03-30 Updated: 2022-08-01 Resolved: 2022-08-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.4.22 |
| Fix Version/s: | 10.3.35, 10.4.25, 10.5.16, 10.6.8, 10.7.4, 10.8.3, 10.9.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Martijn | Assignee: | Marko Mäkelä |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux |
||
| Issue Links: |
|
||||||||
| Description |
|
We have a relative simple InnoDB table with a primary key (integer; sequence number is generated by our client application) and a unique key (across several fields), that looks something like this:
A client then inserts some records into the table:
Some time later (between 0 and 30 seconds) the client performs a select, using the same still open MariaDB-connection (with no active transaction):
And sometimes gets only 2 rows returned, instead of the expected 3. Sometimes, the SELECT returns the correct number of rows, but the exact same SELECT immediately after returns the incorrect number of rows. Rows are never updated and are only deleted once a day during a nightly batch run. The problem happens a couple of times a week, for almost two years now (ever since we migrated the table from MyISAM to InnoDB). We believe it happens more frequent when the table is under high load (which seems plausible, because it appears to be a race condition of some sorts) We're currently running MariaDB 10.4.22, but the problem also occurred with older 10.4.x versions. Unfortunately we haven't been able to create a reproducible test case. This probably isn't the most helpful issue description. We're happy gather and provide more details if needed. |
| Comments |
| Comment by Marko Mäkelä [ 2022-03-30 ] |
|
tgm, does CHECK TABLE report any errors? Can you repeat the mismatches after disabling the change buffer (
|
| Comment by Martijn [ 2022-03-31 ] |
|
Interesting. The table checks out OK, no errors. I've disabled the change buffer and will report back in a week with the results (or earlier, if it still happens). |
| Comment by Martijn [ 2022-04-01 ] |
|
Unfortunately turning off the change buffer did not help. The same problem occurred twice today. |
| Comment by Martijn [ 2022-06-29 ] |
|
We've upgraded from MariaDB 10.4.22 to 10.6.5. I'll update this thread if the bug still exists (or not). |
| Comment by Martijn [ 2022-07-19 ] |
|
We have not had a single occurrence of this bug since upgrading to MariaDB 10.6. So I think it is safe to say the bug is in 10.4 and not 10.6. |
| Comment by Marko Mäkelä [ 2022-08-01 ] |
|
Let us for now assume that this was a duplicate of |