SG-replicate only replicates the document bodies. It does not replicate the metadata / _sync documents (i.e sequence numbers). So when a document is pushed from source to target, it “stamps” the document on the destination with a new sequence number.
The fact that SG-Replicate does not replicate sequence numbers is a critical element of why replication works in active-active mode with SG-Replicate . If you replicated sequence numbers from source to target clusters - bad things can/will happen. You will be stomping on previously allocated sequence numbers on target clusters.
The remote checkpoint maintained by a Couchbase Lite client is target Sync Gateway cluster specific. The checkpoint is a pair of local and remote sequence numbers that at a high level specify what was last replicated from the sync gateway to the client. In other words, when you switch client from one SGW cluster to another, the client will do a checkpoint handshake with the target sync gateway and will try to pull missing changes. Since the two sync gateway clusters are in sync, the same document pulled from either cluster should not result in a conflict. I believe it will reject the duplicate document if it already exists. There will be no data loss. There will some transfer costs associated with the additional data exchange.
BTW, what is the criteria for switching client between sync gateways ? Is it geo location based ? Asking because I am curious how often you expect the client to switch between clusters? In typical real world deployments, it’s not a regular occurrence to switch clusters (unless one goes down, or client is traveling etc) - The the redundant data exchange is not much of an issue.