[MDEV-29989] binlog_do_db option breaks importing sql dumps Created: 2022-11-09 Updated: 2023-12-11 Resolved: 2023-09-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.4, 10.5, 10.6, 10.9, 10.10, 10.11 |
| Fix Version/s: | 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Anton Avramov | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | regression | ||
| Environment: |
Debian GNU/Linux 10 (buster) |
||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
If you have binlog enabled and binlog_do_db set to some table and then make a mariadb-dump and import the dump to some database different of the one set in binlog_do_db, then all the Innodb tables in that database have no records. I'm attaching a bash script to demonstrate the problem. That behaviour wasn't observed in 10.5 versions. It appeared after upgrade to 10.8. |
| Comments |
| Comment by Sergei Golubchik [ 2022-11-18 ] | |||||||||||||||||||||||||||||||
|
Sorry, I wasn't able to repeat the bug with your script. It shows
on
The issue will be closed as not reproducible, but don't worry, if you provide more info we'll reopen it | |||||||||||||||||||||||||||||||
| Comment by Anton Avramov [ 2022-11-18 ] | |||||||||||||||||||||||||||||||
|
That is very interesting. I'll try to find out what else it depends on. | |||||||||||||||||||||||||||||||
| Comment by Anton Avramov [ 2022-11-18 ] | |||||||||||||||||||||||||||||||
|
Got it. bin_log should be enabled. It is disabled by default. | |||||||||||||||||||||||||||||||
| Comment by Anton Avramov [ 2022-11-18 ] | |||||||||||||||||||||||||||||||
|
I've updated the script, so it should be reproducible now | |||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-11-18 ] | |||||||||||||||||||||||||||||||
|
this seems related to innodb bulk insert.
this shows the table empty. If the server is started with --log-bin --binlog-do-db=foo | |||||||||||||||||||||||||||||||
| Comment by Jan Middelkoop [ 2023-09-06 ] | |||||||||||||||||||||||||||||||
|
Hi. I can confirm this issue still exists in MariaDB, tested on MariaDB 10.11 on AlmaLinux 9.2. | |||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-09-11 ] | |||||||||||||||||||||||||||||||
|
This bug does not seem to affect MariaDB Server 10.6, which was the first major version to include | |||||||||||||||||||||||||||||||
| Comment by Thirunarayanan Balathandayuthapani [ 2023-09-20 ] | |||||||||||||||||||||||||||||||
|
During commit, InnoDB does apply the buffered bulk insert operation in innodb_prepare_commit_versioned().
But rw_trans is disabled if we use the above option.
binlog_do_db disables the binlog for test database. So it sets rw_trans to false. To verify the claim, ran the versioning suite with
I think prepare_commit_versioned should be called irrespective of binlog state. So I added the patch in bb-10.10- |