Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Will auto_increment always grow in master-master setup?

$
0
0

Let's suppose I have mysql master-master replication setup with only one server active at a time (i.e. all writes going to one server), and I have ability to manually switch to another master.

Next, I have auto_increment_increment and auto_increment_offset setup:

Master1

auto_increment_increment = 2
auto_increment_offset = 1 

Master2

auto_increment_increment = 2
auto_increment_offset = 2 

Master1 is now active master, and I have a table "users", and insert few recrods: 1,3,5,7

then I switch to Master2, all writes going to Master2.

Question is: will next inserted record to users have auto_increment ID "2" or ID "8" ? Where is this documented?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>