[MDEV-32871] A table is missing inserted entries from concurrent processes Created: 2023-11-24 Updated: 2023-12-04 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Insert |
| Affects Version/s: | 11.0.2, 10.11.5, 11.1.2, 11.2.2 |
| Fix Version/s: | 10.6, 10.11, 11.0, 11.1, 11.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Jiri Slaby | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
openSUSE Tubleweed, x86_64 |
||
| Attachments: |
|
| Description |
|
I create a db and table using the attached cr.sql Then from my c code, using connector-c, I do:
And then a lot of:
src is composed of pid and values from 0 to 49. So they are all unique.
If I run the c code (it creates 10 parallel children), I see:
I.e. Some of pids stored only last 40 values, numbers 0..9 are missing in the table:
Is this a bug in my program (attached) or the db? If I look into the general log, I see the inserts which apparently did not get into the table:
Note also the repeated inserts. They come from a deadlock, so I repeat the exec in a loop (see the code). |
| Comments |
| Comment by Jiri Slaby [ 2023-11-27 ] | |||||||||||||||
|
Forgot to note, running with libmariadb3-3.3.7-1.1.x86_64. | |||||||||||||||
| Comment by Jiri Slaby [ 2023-11-30 ] | |||||||||||||||
|
Running mysqld 8.2.0 from mysql:latest docker image:
I.e. everything seemingly as expected. But mysql does not support UNIQUE on VARCHAR(1024). | |||||||||||||||
| Comment by Jiri Slaby [ 2023-11-30 ] | |||||||||||||||
|
Dockers with
are broken the same way. (It does not reproduce with VARCHAR(256) column.) | |||||||||||||||
| Comment by Jiri Slaby [ 2023-12-01 ] | |||||||||||||||
|
The maximum length of UNIQUE column in mysql is 3072 bytes, i.e. 768 utf8mb4 chars. So if I do this in mariadb:
everything works. If I enlarge to 769, it breaks:
|