2. Interested in Open Source technologies
Building Solutions on MySQL, Cloud & MongoDB
Active Tech Speaker/Blogger
AWS community Builder
Co-Founder, Mydbops
Kabilesh PR
About Me
7. Open source replication plugin for synchronous and multi master
replication
Read and write can be made on any node
No complex failover solutions
What is Galera?
WSREP (Write Set REPlication) is an API to connect the Galera
library and control the characteristics of Galera
Implement Certificate based replication and multi master
replication
11. What is a state transfer ?
State transfer is a way in which the nodes in
clusters connect with each other and transfer
states(data) with each other to come in sync
with each other
12. When is state transfer needed ?
Network partitions
Node failures
Planned Maintanence
Node addition
Manual state transfers
Human err
Software failures (bug)
14. Incremental State transfer (IST)
As the name indicates it sync back with the incremental changes
from the last seen sequence number of its own(grastate.dat)
Gcache aka Ring Buffer files stores the recent write-set, based
on its size default 128MB
Larger the size of Gcache greater the chances for IST
IST less intrusive and fastest way of joining the node back to
group
15. Incremental State transfer (IST)
Node 1 Node 2
Donor
Joiner
Grastate.dat
Gcache
Gcache
Request to join
Seq.no=n+m
GTID: Seq.no
GroupID: Seqno
Seq.no=n
16. Node 1 Node 2
Donor
Joiner
Gcache Gcache
Seq.no=n+m
}
Send IST Events
Grastate.dat
Apply
GroupID: Seqno
Incremental State transfer (IST)
17. State Snapshot Transfer (SST)
State Snapshot Transfer (SST) is a way for Galera to
transfer a full data copy from an existing node (donor) to
a new node (joiner)
SST is slow and high performance impacting process
SST Method:
Mysqldump
RSYNC
Xtrabackup/Mariabackup
Clone(8.0.22)
Logical Transfer
Physical Transfer
18. Logical Transfer - Mysqldump
Least preferred method of state transfer because of the slowness(dump
restore)
Cause locking in Donor node
Independent of the environment comparing to other methods
Requires the receiving node to have a fully functional database
Needs root creds same as donor and accessibility
Work well for smaller dataset
19. Physical State Transfer
Transfers physical copy from donor to joiner
No working DB is needed, overwrites disk in joiner node
Physical transfers are usally faster(network)
Depends on the physical layout such as disk,storage engine
20. SST Method - RSYNC
Uses rsync method for physical transfer
Blocks the donor during copy
Donot require root DB access
Ability to have only change data copy with rsync-wan
(delta transfer algorithm)
Recommended to have same version at both ends
wsrep_sst_method = RSYNC
21. SST Method - Xtrabackup
Most recommended and popular method
Virtually non-blocking on donor except for MyISAM table
Resource utilisation may go high in donor
Recommended to have exact same version in source
and destination
wsrep_sst_auth = <wsrep_sst_user>:<password>
wsrep_sst_method = xtrabackup
22. SST Method - Clone
Available from 8.0.22 mysql and 10.5 Mariadb
Based on native clone plugin introduced in 8.0.17
Much faster than xtrabackup
Blocks donor on DDL
wsrep_sst_method=clone
wsrep_sst_auth=<admin user>:<admin password>