[MDEV-11154] Write_on_release_cache(log_event.cc) function will not write "COMMIT", if use "mysqlbinlog ... | mysql ..." Created: 2016-10-27 Updated: 2023-11-28 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Update, Replication |
| Affects Version/s: | 10.1.17 |
| Fix Version/s: | 10.4, 10.5, 10.6, 10.11, 11.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | vincen | Assignee: | Kristian Nielsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
suse 11 |
||
| Attachments: |
|
| Description |
|
Executing command, "mysqlbinlog --read-from-remote-server --host='xx.xx.xx.xx' --port=3306 --user=xxx --password=xxx --database=mysql --to-last-log mysql-bin.000001 --start-position=1098699 --stop-never |mysql -uxxx -pxxx", we found that last data read from remote couldn't commit. Write_on_release_cache(log_event.cc) function may have some problems. In Write_on_release_cache(log_event.cc) function have following code:
The right code maybe:
|
| Comments |
| Comment by Elena Stepanova [ 2016-11-03 ] | |||||||||||||||||||||||||||||
|
Can you demonstrate the problem somehow, and/or describe the steps to reproduce? | |||||||||||||||||||||||||||||
| Comment by vincen [ 2016-11-03 ] | |||||||||||||||||||||||||||||
|
before change: According to these steps above, we can find that last data read from remote doesn't commit. However, we solved this problem by changing the code described above. | |||||||||||||||||||||||||||||
| Comment by vincen [ 2016-11-03 ] | |||||||||||||||||||||||||||||
|
After querying current events in local server(10.10.10.1), we can find there is an event have not been committed. | |||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-11-03 ] | |||||||||||||||||||||||||||||
|
What is the relation between "remote server" and "local server"? Is "remote" a master, and "local" is a slave? | |||||||||||||||||||||||||||||
| Comment by vincen [ 2016-11-04 ] | |||||||||||||||||||||||||||||
|
No. They don't have any relations. We just want to synchronize data of remote server to the local by using this method. | |||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-11-04 ] | |||||||||||||||||||||||||||||
|
Okay, so you basically "replicate" by means of mysqlbinlog – you make it read from a "remote" server, and write into the "local" one. Thanks, I understand now. | |||||||||||||||||||||||||||||
| Comment by vincen [ 2016-11-08 ] | |||||||||||||||||||||||||||||
|
OK. And then, in which version will this bug be fixed? | |||||||||||||||||||||||||||||
| Comment by Sujatha Sivakumar (Inactive) [ 2019-07-09 ] | |||||||||||||||||||||||||||||
|
Hello Andrei, Please review the fix for MDEV-11154. Patch: https://github.com/MariaDB/server/commit/2cb0fdd7b54d46f153a66462f1e78c3cee47c9f2 Thank you | |||||||||||||||||||||||||||||
| Comment by Andrei Elkin [ 2019-07-09 ] | |||||||||||||||||||||||||||||
|
Sujatha, thanks for a good piece of analysis! The patch is fine. | |||||||||||||||||||||||||||||
| Comment by Andrei Elkin [ 2019-07-11 ] | |||||||||||||||||||||||||||||
|
The 10.2 commit looks good, Sujatha. | |||||||||||||||||||||||||||||
| Comment by Sujatha Sivakumar (Inactive) [ 2019-07-15 ] | |||||||||||||||||||||||||||||
|
Fix has been implemented in 10.1.41. There are some additional changes required for 10.2+ versions. Please refer The patch has been tested on all higher versions. | |||||||||||||||||||||||||||||
| Comment by Yury Chaikou [ 2023-06-14 ] | |||||||||||||||||||||||||||||
|
This patch should also be ported to 10.5 and all later versions, including the latest 11.1 | |||||||||||||||||||||||||||||
| Comment by Andrei Elkin [ 2023-06-15 ] | |||||||||||||||||||||||||||||
|
yury.chaikou, do you mean the bug is present in higher versions (than those in Fixed box)? Just in case the higher version are not listed 'cos they did not exist at time | |||||||||||||||||||||||||||||
| Comment by Yury Chaikou [ 2023-06-15 ] | |||||||||||||||||||||||||||||
|
Andrei, correct, the bug is present in any version higher than those in Fixed box.
| |||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2023-06-16 ] | |||||||||||||||||||||||||||||
|
As Yury Chaikou noticed, the fix for this MDEV-11154 was merged incorrectly to 10.5:
The fix got null-merged to 10.5, which probably is not what was intended, as now all the logic using FLUSH_F is dead code:
However, the original bug, which is missing fflush() by mysqlbinlog on the output, seems nevertheless to not occur. The reason for this is another merge:
I think this occured because the mysqlbinlog code is somewhat different between 10.1 and 10.2, so the MDEV-11154 flush bug is fixed differently with the new code with this fflush(). Interestingly, the test case for this bug (binlog_mysqlbinlog_stop_never.test) seems also to be wrong now. It is trying to do something like:
But the problem is that the events will be applied by the `mysql` command with binlogging enabled, which will loop around and endlessly stream events through mysqlbinlog (or rather, until a duplicate GTID or row error stops it); in any case it doesn't reliably test the missing fflush() reliably. So this should also be fixed. I think can be fixed with something like this:
Since the bug itself seems to not be present, reopening with a low priority. Hope this helps, - Kristian. |