[MDEV-23109] Move `flush()` function call into `inc_group_relay_log_pos()` Created: 2020-07-07  Updated: 2023-12-15

Status: In Review
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.6

Type: Bug Priority: Critical
Reporter: Sujatha Sivakumar (Inactive) Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Relocate `flush()` into `inc_group_relay_log_pos()` to avoid invocation of mysql_mutex_lock(&data_lock)/unlock twice.



 Comments   
Comment by Sujatha Sivakumar (Inactive) [ 2020-12-08 ]

Hello Andrei,

I didn't relocate 'flush()' function call into 'inc_group_relay_log_pos'.
I have provided the reasons in the patch.

https://github.com/MariaDB/server/commit/4d2b40dde11522dd67b7f93f81b609132441ed3e
Testing: http://buildbot.askmonty.org/buildbot/grid?category=main&branch=bb-10.6-sujatha
Please review the changes.

Thank you.

Comment by Sujatha Sivakumar (Inactive) [ 2020-12-18 ]

Hello Elkin

Please find the following comment which explains the reason for not flushing relay-log.info and the end of event
when GTID mode is being used.

MDEV-4506: Parallel replication.

Do not update relay-log.info and master.info on disk after every event
when using GTID mode:

  • relay-log.info and master.info are not crash-safe, and are not used
    when slave restarts in GTID mode (slave connects with GTID position
    instead and immediately rewrites the file with the new, correct
    information found).
  • When using GTID and parallel replication, the position in
    relay-log.info is misleading at best and simply wrong at worst.
  • When using parallel replication, the fact that every single
    transaction needs to do a write() syscall to the same file is
    likely to become a serious bottleneck.

The files are still written at normal slave stop.

In non-GTID mode, the files are written as normal (this is needed to
be able to restart after slave crash, even if such restart is then not
crash-safe, no change).

Comment by Andrei Elkin [ 2023-12-15 ]

The status confirmed. The review should be completed, preferably by myself, to make the patch into the upcoming CS release.

Generated at Thu Feb 08 09:19:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.