When using a DR cluster, my understanding is that the DR cluster’s keys and values will not be perfectly identical, if one uses set_versionstamped_key, because the DR cluster will call set_versionstamped_key itself, and its clock is not synchronized. Is that right?
In application code, if I call set_versionstamped_keyget_range (to find the key) clear(complete_versionstamp), when those operations are copied over to the DR cluster, the clear will not be effective, because the key on disk has a different complete versionstamp. Is that correct?
No, set_versionstamped_key won’t cause difference in the DR cluster. The reason is that versionstamp operations are converted into SET mutation at the commit proxy via transformVersionstampMutation() calls. DR will copy the converted mutations to the destination cluster. Thus, the destination side applies the same mutation as the source cluster. I.e., the source and the destination cluster are identical.
Are there guarantees that versionstamps continue to be unique and absolutely ordered (i.e. no new versionstamps will overlap or be older than any that previously got copied over via DR) in various recovery scenarios:
If we failover and make the DR cluster active?
If we restore the main cluster from the DR cluster by a second fdbdr switch or similar?
A second fdbdr switch will follow the same process and a version bump. So the main cluster will have a higher version, thus providing the guarantee.
There is no guarantee for 3, because no such version bump exists for restore. Someone has to use fdbcli> advanceversion command to advance the commit version.
I notice you specifically call out fdbdr switch, but to our understanding in a ‘true’ disaster scenario (where the source cluster has become unavailable for some reason) you’d want to run fdbdr abort --dstonly. Would the same guarantees apply in that case as with fdbdr switch?
From my reading of the code you linked it looks like yes, but I’ve never written C++ before and it’s about 20 years since I last wrote C, so I don’t trust my own evaluation