However, the remaining code still applies millisecond while computing elapsed time (ex.2pc.go/txnLockTTL), which will add a relatively large bias on the basic formula ttl = ttlFactor * sqrt(sizeInMiB).
In addition, ttlEquals ignores case that x < y, where float(x - y) will result in a wrong answer given x and y of uint type.
In
lock_test.go
, settings of lock TTL are shrunk together to speed up tests:However, the remaining code still applies
millisecond
while computing elapsed time (ex.2pc.go/txnLockTTL
), which will add a relatively large bias on the basic formulattl = ttlFactor * sqrt(sizeInMiB)
.In addition,
ttlEquals
ignores case thatx < y
, wherefloat(x - y)
will result in a wrong answer given x and y ofuint
type.