returns a int64. I was wondering if there was some reason to return a int64 instead of a uint64 for these APIs? I should have noticed this before, but somehow missed it.
I had previously assumed GRV was a cluster-wide 64 bit positive counter.
I see. So, if we are going to rely on GRV to infer happens before relation between two transactions, then its our (caller’s) responsibility to transmute the int64 to uint64.
Yes, the caller has to do that. However, I want to point out that the GRV that the caller gets should always be positive numbers. Negative version number only exists internally for initializations of some version numbers.
BTW, GRV only implies happen-before for read-only transactions. For read-write transactions, they happen at the commit version, which should be used to reason about happen-before relationship.