Change Is Inevitable
  • Home
  • MySQL
    • MySQL-Articles
    • AWS RDS
    • Percona Xtradb Cluster
    • MariaDB
    • Galera Cluster
    • ProxySQL
    • MySQL-Scripts
    • MySQL tools
    • MySQL Resources
  • Tools
    • MySQL Advisor
    • MySQL Random Data Generator
    • Postgresql Random Data Generator
    • Clean Prompt
  • General
    • binary-to-decimal
    • Fermat’s Theorem
    • Review
    • Just for fun
    • Personal
  • Contact Me
    • Copyright
    • MySQL Podcast (Youtube)
    • MySQL Podcast (Spotify)
Recent Posts
  • MySQL INSTANT DDL breaks EXCHANGE PARTITION
  • How to setup and use Percona Binlog Server (PBS)
  • MySQL Major Version Upgrade Checklist – how to
  • InnoDB Flushing is simple – explained
  • MySQL Tools for Performance Tuning and Test Data Generation
Recent Comments
  • Kedar on MySQL INSTANT DDL breaks EXCHANGE PARTITION
  • Jean-François Gagné on MySQL INSTANT DDL breaks EXCHANGE PARTITION
  • Reggie on A Unique Foreign Key issue in MySQL 8.4
  • Kedar on How to fix write latency in MySQL 8.4 Upgrade
  • Kedar on How to fix write latency in MySQL 8.4 Upgrade
Home » Master Master Replication
Change Is Inevitable

Kedar Vaijanapurkar's Blog for MySQL, technology and various subjects

  • Home
  • MySQL
    • MySQL-Articles
    • AWS RDS
    • Percona Xtradb Cluster
    • MariaDB
    • Galera Cluster
    • ProxySQL
    • MySQL-Scripts
    • MySQL tools
    • MySQL Resources
  • Tools
    • MySQL Advisor
    • MySQL Random Data Generator
    • Postgresql Random Data Generator
    • Clean Prompt
  • General
    • binary-to-decimal
    • Fermat’s Theorem
    • Review
    • Just for fun
    • Personal
  • Contact Me
    • Copyright
    • MySQL Podcast (Youtube)
    • MySQL Podcast (Spotify)

Browsing Tag

Master Master Replication

1 post

MySQL Master Master Replication and auto_increment_increment / auto_increment_offset

  • Kedar
  • September 20, 2009
In this post we will see importance of replication related variables auto_increment_increment & auto_increment_offset with respect to MySQL Master Master setup. Consider we’ve already set a master-master replication. Now create…
View Post
MySQL Podcast (Youtube)
RSS feed: MySQL Podcast (Spotify) MySQL Podcast (Spotify)
  • MySQL Major Version Upgrade Checklist (Zero Downtime Strategy)
    Upgrading MySQL major versions in production is never just a version bump - it’s a carefully planned process involving compatibility checks, replication strategy, testing, and controlled cut-over.In this episode, we walk through a practical MySQL Major Version Upgrade Checklist based on real-world DBA workflows. We are covering MySQL replication as base setup for upgrade. It […]
Search:
... ...
  • MySQL INSTANT DDL breaks EXCHANGE PARTITION
  • How to setup and use Percona Binlog Server (PBS)
  • MySQL Major Version Upgrade Checklist – how to
  • InnoDB Flushing is simple – explained
  • MySQL Tools for Performance Tuning and Test Data Generation

5 responses to “MySQL Master Master Replication and auto_increment_increment / auto_increment_offset”

  1. Manjeet Avatar
    Manjeet
    February 13, 2019

    Hello Kedar,

    i have a master master replication , but they are in active / passive mod via Haproxy.

    it writes only on Master A which is active and Master B is passive , when A goes down , B takes over.

    Up to my understanding there will no conflicts on increment ID as there’s no writes or inserts on Master B, it only replicate Master A. Can you please confirm me that ?
    thanks you very much

    Reply
    1. Badal singh dudy Avatar
      Badal singh dudy
      January 2, 2020

      Hello Manjeet,

      This kind of setup is not conflicts on increment if you have active/passive M-M replication setup.

      Reply
  2. Muhammad Rashid Avatar
    Muhammad Rashid
    March 21, 2018

    I have Master/Master on two MariaDB 10.1.31 servers with GTID implementation.
    I also set the following settings for auto_increment_increment and auto_increment_offset:

    Server1:
    auto_increment_increment=2
    auto_increment_offset=1

    Server2:
    auto_increment_increment=2
    auto_increment_offset=2

    I executed the following statements on server 1:
    create table tb1 (id int AUTO_INCREMENT primary key,name varchar(45),age int);
    insert into tb1 (name,age) values (“fouad”,25);

    The problem is occurred, let say support I enter three records in server 1. We get id 1,3 and 5. When I enter two records on server 2, I get id 6 and 8.

    My Query is why server 2 does not create id of 2 and 4.

    Thanks in advance.

    Reply
    1. Kedar Avatar
      Kedar
      March 30, 2018

      Because auto increment changes as you insert the records. The values 1,3,5 are inserted on server-1 and then they got replicated to server-2.
      So the max value on server-2 is 5 as well. It will start with the next higher increment number. The same will happen if you insert 8,10,12 on server-2 -> next value on server-1 will be 13 and not 7.

      Hope this is clear.

      Reply
  3. Mohan Avatar
    Mohan
    August 13, 2015

    Kedar,

    I have Mysql Master -slave setup, Is it possible for me to convert the current setup to mysql master, if so could you please outline the steps

    Reply
Change Is Inevitable
Designed & Developed by Code Supply Co.