Not the answer you need?
Register and ask your own question!

Conflicts and wsrep_sync_wait

jorangjorang EntrantInactive User Role Beginner
Does the use of wsrep_sync_wait reduces the probability of conflicts?

For example, if we have two concurrent inserts on the same table from different nodes, if wsrep_sync_wait is set to 4 or 6, does this avoid the insert conflict, in particular, a conflict that results from a gap lock on a primary key?

Thank you.


  • krunalbauskarkrunalbauskar Advisor Inactive User Role Novice
    Not necessarily but can.
    wsrep_sync_wait is designed to reflect the latest data. So imagine it like a hook that is added when you execute it. But the point is not directly controlled by end-user.

    Said that, it is not recommended option to control conflict. It is surely recommended option to fetch refreshed data.
  • jorangjorang Entrant Inactive User Role Beginner
    Thank you for your reply. So, is there an effective way of avoid conflicts resulting from a gap lock, besides issuing write statements to only one master?
  • krunalbauskarkrunalbauskar Advisor Inactive User Role Novice
    You can split your workload. Each node can dealt with different table there-by reducing conflict.
    If this is not feasible then I don't foresee any other way out. It is like even on single server if all user threads are trying to access same table then they need to wait.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.