SlideShare a Scribd company logo
1 of 18
Download to read offline
Group Replication In MYSQL 8.0
A walk through
Presented by
VIGNESH PRABHU S
www.mydbops.com info@mydbops.com
About Mydbops
● Founded in 2015, HQ in Bangalore India with 450+ customer base across the globe.
● Mydbops is on Database Consulting with core specialization on MySQL ,MongoDB & PostgreSQL
Administration and Support.
● We have expert team with 30+ certified DBA’s providing full time support and currently managing 300+
servers on cloud.
● Mydbops was created with a motto of developing a Devops model for Database administration offering
24*7 expert remote DBA support.
● We help organisations to architect and scale systems in MySQL/Mongo by implementing the advanced
technologies in industry which are completely open source.
● We are a leading solution provider in the market for all sort of cloud based deployments and management.
Agenda
● Group Replication - Introduction
● Group Replication - Architecture
● Group Replication - Monitoring
● Group Replication - Modes
● Primary Member Change - Cases
● Primary Election Algorithm
● Conditions for using online UDF
● Communication Protocol
● Transaction Consistency
Group Replication - Introduction
● High Availability Solution
● To create a fault tolerant System.
● Supports Server side failover.
● Client side failover is not supported by GR.
● Distributed functionality.
● Based on the GCS protocol and paxos algorithm.
● Split brain issue is avoided by Quorum.
Group Replication - Introduction
Services of Group Replication:-
● Group Membership (VIEW)
● Failure Detection (Detect the failure & update the VIEW)
● Fault-tolerance ( QUORUM condition n = 2 x f + 1. )
● Monitoring ( performance schema tables )
All these Services are built into the GCS Protocol.
Group Replication - Architecture
Group Replication - Architecture
Functionality of Each Component:-
● Capture :Keep track of all the local transactions.
● Applier :Remote transactions.
● Recovery :Manage the distributed recovery.
● Replication :Define the replication protocol & handle the
conflict detection in the group.
● GCS & Xcom :GR Services & communication protocol.
Group Replication - ( Commit )
Group Replication - Monitoring
Tables in Perf schema:-
● replication_group_member_stats ( info about certification process)
● replication_group_members ( info about the group members )
● replication_connection_status ( info about the queue )
● replication_applier_status ( shows state of replication worker
thread )
Replication Channel:-
● group_replication_recovery - ( Channel for the recovery process)
● group_replication_applier - ( transactions from the other members
or from the group )
Group Replication - Monitoring
Group Replication Server States:-
● Online :will accept the connection from the client.
● Recovering :Applying the events from the donor.
● Offline :Member doesn’t belong to any group.
● ERROR :Member is in the group but not working properly.
“group_replication_exit_state_action”
● UNREACHABLE :It is mostly because of the network failure.
Group Replication - Modes
● Based on the variable - (group_replication_single_primary_mode)
● Single Primary Mode
○ One member accept the writes.
○ group_replication_enforce_update_everywhere_checks (off)
● Multi Primary Mode
○ All the members can accept the writes.
○ group_replication_enforce_update_everywhere_checks (ON)
Group Replication - Modes
● From MySQL version 8.0.13 we can change the modes in
online Using the UDF’s
○ group_replication_switch_to_single_primary_mode()
○ group_replication_switch_to_multi_primary_mode()
● From Version 8.0.13 to 8.0.16, no check for the safeguard.
● From Version 8.0.17, GR has safeguard check.
○ (i.e) Lower MySQL version member will become the
Primary.
Primary Member Change - Cases
● Primary leaves the group .
● While Changing the primary member manually using UDF.
● While Changing the multi primary to single primary.
Primary Election Algorithm
First Election Check:-
● Ordering based on MySQL major Version & patch Version.
Second Election Check:-
● Based on lowest member weight. ( group_replication_member_weight ).
Third Election Check:-
● Based on the lowest server UUID.
Conditions for using online UDF
1. All members must be in ONLINE state
2. No members can join in the group during a configuration change.
3. Only one configuration at once.
4. All members must be running MySQL 8.0.13 or higher
Communication Protocol
● From MySQL 8.0.16, Configure different versions of MySQL members.
● Group must use same communication protocol Version.
Reason:-
● From MySQL 5.7.14, allow compression of messages
● From MySQL 8.0.16, allow fragmentation of messages
Functions:-
● group_replication_get_communication_protocol();
● group_replication_set_communication_protocol(“version”);
Transaction Consistency.
● Controlled by group_replication_consistency variable.
○ EVENTUAL
○ BEFORE_ON_PRIMARY_FAILOVER
○ BEFORE ( RO trx wait for preceding trx to apply )
○ AFTER ( RW trx wait for preceding trx to apply in other members )
○ BEFORE_AND_AFTER
Email Us : Info@mydbops.com
Thank you

More Related Content

What's hot

Achieving a 50% Reduction in Cross-AZ Network Costs from Kafka (Uday Sagar Si...
Achieving a 50% Reduction in Cross-AZ Network Costs from Kafka (Uday Sagar Si...Achieving a 50% Reduction in Cross-AZ Network Costs from Kafka (Uday Sagar Si...
Achieving a 50% Reduction in Cross-AZ Network Costs from Kafka (Uday Sagar Si...
confluent
 
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Masahiko Sawada
 
Unify Stream and Batch Processing using Dataflow, a Portable Programmable Mod...
Unify Stream and Batch Processing using Dataflow, a Portable Programmable Mod...Unify Stream and Batch Processing using Dataflow, a Portable Programmable Mod...
Unify Stream and Batch Processing using Dataflow, a Portable Programmable Mod...
DataWorks Summit
 

What's hot (20)

Achieving a 50% Reduction in Cross-AZ Network Costs from Kafka (Uday Sagar Si...
Achieving a 50% Reduction in Cross-AZ Network Costs from Kafka (Uday Sagar Si...Achieving a 50% Reduction in Cross-AZ Network Costs from Kafka (Uday Sagar Si...
Achieving a 50% Reduction in Cross-AZ Network Costs from Kafka (Uday Sagar Si...
 
Percona XtraDB Cluster ( Ensure high Availability )
Percona XtraDB Cluster ( Ensure high Availability )Percona XtraDB Cluster ( Ensure high Availability )
Percona XtraDB Cluster ( Ensure high Availability )
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScale
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
What is new in MariaDB 10.6?
What is new in MariaDB 10.6?What is new in MariaDB 10.6?
What is new in MariaDB 10.6?
 
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1
 
Postgresql database administration volume 1
Postgresql database administration volume 1Postgresql database administration volume 1
Postgresql database administration volume 1
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance Optimisation
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
 
MySQL enterprise edition
MySQL enterprise edition MySQL enterprise edition
MySQL enterprise edition
 
MySQL Data Encryption at Rest
MySQL Data Encryption at RestMySQL Data Encryption at Rest
MySQL Data Encryption at Rest
 
Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
Handling Schema Changes Using pt-online-schema change.
Handling Schema Changes Using pt-online-schema change.Handling Schema Changes Using pt-online-schema change.
Handling Schema Changes Using pt-online-schema change.
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL Architectures
 
M|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write PathsM|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write Paths
 
Unify Stream and Batch Processing using Dataflow, a Portable Programmable Mod...
Unify Stream and Batch Processing using Dataflow, a Portable Programmable Mod...Unify Stream and Batch Processing using Dataflow, a Portable Programmable Mod...
Unify Stream and Batch Processing using Dataflow, a Portable Programmable Mod...
 

Similar to Group Replication in MySQL 8.0 ( A Walk Through )

Similar to Group Replication in MySQL 8.0 ( A Walk Through ) (20)

Sprint 71
Sprint 71Sprint 71
Sprint 71
 
AutoDOPandRest
AutoDOPandRestAutoDOPandRest
AutoDOPandRest
 
What is new in Galera 4 ?
What is new in Galera 4 ?What is new in Galera 4 ?
What is new in Galera 4 ?
 
InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)InnoDB Cluster Experience (MySQL User Camp)
InnoDB Cluster Experience (MySQL User Camp)
 
Sprint 44 review
Sprint 44 reviewSprint 44 review
Sprint 44 review
 
Customer Experience: InnoDB Cluster Implementation by PR Karthik
Customer Experience: InnoDB Cluster Implementation by PR KarthikCustomer Experience: InnoDB Cluster Implementation by PR Karthik
Customer Experience: InnoDB Cluster Implementation by PR Karthik
 
Insight on MongoDB Change Stream - Abhishek.D, Mydbops Team
Insight on MongoDB Change Stream - Abhishek.D, Mydbops TeamInsight on MongoDB Change Stream - Abhishek.D, Mydbops Team
Insight on MongoDB Change Stream - Abhishek.D, Mydbops Team
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
 
Cloudify 4.2 Webinar - Agility & Control
Cloudify 4.2 Webinar - Agility & ControlCloudify 4.2 Webinar - Agility & Control
Cloudify 4.2 Webinar - Agility & Control
 
MySQL Live Migration - Common Scenarios
MySQL Live Migration - Common ScenariosMySQL Live Migration - Common Scenarios
MySQL Live Migration - Common Scenarios
 
Managing 600 instances
Managing 600 instancesManaging 600 instances
Managing 600 instances
 
Heart of the SwarmKit: Store, Topology & Object Model
Heart of the SwarmKit: Store, Topology & Object ModelHeart of the SwarmKit: Store, Topology & Object Model
Heart of the SwarmKit: Store, Topology & Object Model
 
Sprint 68
Sprint 68Sprint 68
Sprint 68
 
MySQL Workbench for DFW Unix Users Group
MySQL Workbench for DFW Unix Users GroupMySQL Workbench for DFW Unix Users Group
MySQL Workbench for DFW Unix Users Group
 
SVCC-2014
SVCC-2014SVCC-2014
SVCC-2014
 
Slack in the Age of Prometheus
Slack in the Age of PrometheusSlack in the Age of Prometheus
Slack in the Age of Prometheus
 
Scaling Monitoring At Databricks From Prometheus to M3
Scaling Monitoring At Databricks From Prometheus to M3Scaling Monitoring At Databricks From Prometheus to M3
Scaling Monitoring At Databricks From Prometheus to M3
 
Sprint 50 review
Sprint 50 reviewSprint 50 review
Sprint 50 review
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major Features
 
Upgrade your mongo the right way linkedin
Upgrade your mongo the right way linkedinUpgrade your mongo the right way linkedin
Upgrade your mongo the right way linkedin
 

More from Mydbops

More from Mydbops (20)

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQL
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDB
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificates
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQL
 
Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Group Replication in MySQL 8.0 ( A Walk Through )

  • 1. Group Replication In MYSQL 8.0 A walk through Presented by VIGNESH PRABHU S www.mydbops.com info@mydbops.com
  • 2. About Mydbops ● Founded in 2015, HQ in Bangalore India with 450+ customer base across the globe. ● Mydbops is on Database Consulting with core specialization on MySQL ,MongoDB & PostgreSQL Administration and Support. ● We have expert team with 30+ certified DBA’s providing full time support and currently managing 300+ servers on cloud. ● Mydbops was created with a motto of developing a Devops model for Database administration offering 24*7 expert remote DBA support. ● We help organisations to architect and scale systems in MySQL/Mongo by implementing the advanced technologies in industry which are completely open source. ● We are a leading solution provider in the market for all sort of cloud based deployments and management.
  • 3. Agenda ● Group Replication - Introduction ● Group Replication - Architecture ● Group Replication - Monitoring ● Group Replication - Modes ● Primary Member Change - Cases ● Primary Election Algorithm ● Conditions for using online UDF ● Communication Protocol ● Transaction Consistency
  • 4. Group Replication - Introduction ● High Availability Solution ● To create a fault tolerant System. ● Supports Server side failover. ● Client side failover is not supported by GR. ● Distributed functionality. ● Based on the GCS protocol and paxos algorithm. ● Split brain issue is avoided by Quorum.
  • 5. Group Replication - Introduction Services of Group Replication:- ● Group Membership (VIEW) ● Failure Detection (Detect the failure & update the VIEW) ● Fault-tolerance ( QUORUM condition n = 2 x f + 1. ) ● Monitoring ( performance schema tables ) All these Services are built into the GCS Protocol.
  • 6. Group Replication - Architecture
  • 7. Group Replication - Architecture Functionality of Each Component:- ● Capture :Keep track of all the local transactions. ● Applier :Remote transactions. ● Recovery :Manage the distributed recovery. ● Replication :Define the replication protocol & handle the conflict detection in the group. ● GCS & Xcom :GR Services & communication protocol.
  • 8. Group Replication - ( Commit )
  • 9. Group Replication - Monitoring Tables in Perf schema:- ● replication_group_member_stats ( info about certification process) ● replication_group_members ( info about the group members ) ● replication_connection_status ( info about the queue ) ● replication_applier_status ( shows state of replication worker thread ) Replication Channel:- ● group_replication_recovery - ( Channel for the recovery process) ● group_replication_applier - ( transactions from the other members or from the group )
  • 10. Group Replication - Monitoring Group Replication Server States:- ● Online :will accept the connection from the client. ● Recovering :Applying the events from the donor. ● Offline :Member doesn’t belong to any group. ● ERROR :Member is in the group but not working properly. “group_replication_exit_state_action” ● UNREACHABLE :It is mostly because of the network failure.
  • 11. Group Replication - Modes ● Based on the variable - (group_replication_single_primary_mode) ● Single Primary Mode ○ One member accept the writes. ○ group_replication_enforce_update_everywhere_checks (off) ● Multi Primary Mode ○ All the members can accept the writes. ○ group_replication_enforce_update_everywhere_checks (ON)
  • 12. Group Replication - Modes ● From MySQL version 8.0.13 we can change the modes in online Using the UDF’s ○ group_replication_switch_to_single_primary_mode() ○ group_replication_switch_to_multi_primary_mode() ● From Version 8.0.13 to 8.0.16, no check for the safeguard. ● From Version 8.0.17, GR has safeguard check. ○ (i.e) Lower MySQL version member will become the Primary.
  • 13. Primary Member Change - Cases ● Primary leaves the group . ● While Changing the primary member manually using UDF. ● While Changing the multi primary to single primary.
  • 14. Primary Election Algorithm First Election Check:- ● Ordering based on MySQL major Version & patch Version. Second Election Check:- ● Based on lowest member weight. ( group_replication_member_weight ). Third Election Check:- ● Based on the lowest server UUID.
  • 15. Conditions for using online UDF 1. All members must be in ONLINE state 2. No members can join in the group during a configuration change. 3. Only one configuration at once. 4. All members must be running MySQL 8.0.13 or higher
  • 16. Communication Protocol ● From MySQL 8.0.16, Configure different versions of MySQL members. ● Group must use same communication protocol Version. Reason:- ● From MySQL 5.7.14, allow compression of messages ● From MySQL 8.0.16, allow fragmentation of messages Functions:- ● group_replication_get_communication_protocol(); ● group_replication_set_communication_protocol(“version”);
  • 17. Transaction Consistency. ● Controlled by group_replication_consistency variable. ○ EVENTUAL ○ BEFORE_ON_PRIMARY_FAILOVER ○ BEFORE ( RO trx wait for preceding trx to apply ) ○ AFTER ( RW trx wait for preceding trx to apply in other members ) ○ BEFORE_AND_AFTER
  • 18. Email Us : Info@mydbops.com Thank you