08-10-2017 08:08 AM - edited 03-01-2019 03:57 AM
In an HA setup, what would be the best way to identify that CDB is in sync? Is ‘waiting-for-replication-sync=false’ from ‘sh ncs-state datastore running’ on the master a reliable way to tell that? Should we compare the transaction-ids?
Solved! Go to Solution.
08-11-2017 04:11 AM
Yes, if the CDBs give you the same transaction ID, then they are in sync. Or at least they were. As always, this may have changed by the time you have figured out that they were in sync
waiting-for-replication-sync should be a good indicator at most times, but I guess there are corner cases where the CDBs may be out of sync even when the master is not waiting for sync to happen. E.g. initially before the slave relationship has been fully established or if it has ended (slave evicted).
As long as you leave the HA sync/async mode in nso.conf in sync mode (default), the CDB instances will never be further apart than at most one transaction, and NSO can replay that transaction if required.
Don't set HA to async mode unless you know perfectly well what you are doing. You might be building a Low Availability system instead :/
08-11-2017 04:11 AM
Yes, if the CDBs give you the same transaction ID, then they are in sync. Or at least they were. As always, this may have changed by the time you have figured out that they were in sync
waiting-for-replication-sync should be a good indicator at most times, but I guess there are corner cases where the CDBs may be out of sync even when the master is not waiting for sync to happen. E.g. initially before the slave relationship has been fully established or if it has ended (slave evicted).
As long as you leave the HA sync/async mode in nso.conf in sync mode (default), the CDB instances will never be further apart than at most one transaction, and NSO can replay that transaction if required.
Don't set HA to async mode unless you know perfectly well what you are doing. You might be building a Low Availability system instead :/
08-11-2017 05:36 AM
Thank you Jan. This is in the context of forcing a switchover for maintenance purposes. In order to avoid what you highlighted in the first paragraph, I understand that it is best to set master to RO, then check sync status before proceeding with the switchover.
08-11-2017 05:49 AM
Yes, sounds like a good idea, in order to raise the dependability/avoid a race condition. And if that waiting-for-replication-sync is true, you can be pretty sure they are (were) not in sync. You can probably have that as a first check before you even turn the node RO.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide