Description
Versionstamps are a compelling feature that tie in closely with the tuple layer, and are the main thing currently missing from it right now.
They have a bit of a weird API, where you encode an incomplete versionstamp to a tuple, pack the tuple with a special offset (w/ different values depending on FDB client version), write the resulting bytes with the SET_VERSIONSTAMP_(KEY|VALUE)
atomic operations, and then FDB magically replaces the incomplete-versionstamp portion of the tuple with the actual commit-time versionstamp when it writes to disk.
They were recently added to the golang bindings: https://github.com/apple/foundationdb/pull/1187/files which makes for a nice distillation of what they need to work.
That said: they do puncture a bit of the clean implementation of tuples we have now, since they add some new invariants:
- vanilla packing of a tuple cannot contain an incomplete versionstamp, otherwise it fails
- versionstamp-packing a tuple must contain exactly one incomplete versionstamp, otherwise it fails