We basically need 2 brokers to compare their current state and ensure they are both in exactly the same state.
- both brokers checkpoint
- they perform a database merge
- they can now continue being a master-slave pair
Maybe the easiest implementation is to find the list of all unique message producers then perform a 'sequence-range' comparison.
producer1: 1-100, 102-142, 145
then we send from broker1 to broker2 producer1: 13-100, 102-142, 145