Spec that addWrites advances oldestVersion minimally
CI / pre-commit (push) Successful in 2m14s
CI / test (arm64, -DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, 22, https://minio.weaselab.dev/public/aarch64/msan-toolchain-22.1.8.tar.zst, debug-arm64, ubuntu-latest-arm64) (push) Successful in 3m45s
CI / test (amd64, -DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, 21, https://minio.weaselab.dev/public/x86_64/msan-toolchain-21.1.8.tar.zst, debug, ubuntu-latest-amd64) (push) Successful in 4m13s
CI / release (arm64, , ubuntu-latest-arm64) (push) Successful in 3m25s
CI / test (amd64, -DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 21, , 64-bit-versions, ubuntu-latest-amd64) (push) Successful in 3m48s
CI / test (amd64, -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, 21, , gcc, ubuntu-latest-amd64) (push) Successful in 3m43s
CI / test (amd64, -DUSE_SIMD_FALLBACK=ON, 21, , simd-fallback, ubuntu-latest-amd64) (push) Successful in 3m48s
CI / release (amd64, -DMSAN_TOOLCHAIN_PATH=/opt/msan, ubuntu-latest-amd64) (push) Successful in 6m23s
CI / coverage (push) Successful in 4m41s

The old wording only gave the lower bound oldestVersion >= newestVersion -
two billion, which an implementation could satisfy by discarding more
readable versions than necessary. State that oldestVersion becomes the
larger of its previous value and newestVersion - two billion.
This commit is contained in:
andrew committed 2026-10-10 14:04:17 -04:00
1 parent 8621662d3c
commit ba781b8875
1 file changed
+8 -10
+8 -10
View File
@@ -84,11 +84,10 @@ struct __attribute__((__visibility__("default"))) ConflictSet {
* `WriteRange` (see its field documentation); `count >= 0`; `writeVersion >= * `WriteRange` (see its field documentation); `count >= 0`; `writeVersion >=
* newestVersion`. * newestVersion`.
* @post Writes (writes[i], writeVersion) are recorded for every i < count, * @post Writes (writes[i], writeVersion) are recorded for every i < count,
* and `newestVersion` becomes `writeVersion`. `oldestVersion` advances as * and `newestVersion` becomes `writeVersion`. `oldestVersion` advances only
* needed so that `oldestVersion >= newestVersion - two billion`; * as far as necessary: it becomes the larger of its previous value and
* `oldestVersion <= newestVersion` is preserved. Calling with `count == 0` * `newestVersion - two billion`. Calling with `count == 0` adds no write;
* adds no write; `newestVersion` (and possibly `oldestVersion`) still * `newestVersion` (and possibly `oldestVersion`) still advance. */
* advance. */
void addWrites(const WriteRange *writes, int count, int64_t writeVersion); void addWrites(const WriteRange *writes, int count, int64_t writeVersion);
/** Reads where readVersion < `oldestVersion` will result in `TooOld`. /** Reads where readVersion < `oldestVersion` will result in `TooOld`.
@@ -231,11 +230,10 @@ void ConflictSet_check(const ConflictSet *cs,
* `ConflictSet_WriteRange` (see its field documentation); `count >= 0`; * `ConflictSet_WriteRange` (see its field documentation); `count >= 0`;
* `writeVersion >= newestVersion`. * `writeVersion >= newestVersion`.
* @post Writes (writes[i], writeVersion) are recorded for every i < count, * @post Writes (writes[i], writeVersion) are recorded for every i < count,
* and `newestVersion` becomes `writeVersion`. `oldestVersion` advances as * and `newestVersion` becomes `writeVersion`. `oldestVersion` advances only
* needed so that `oldestVersion >= newestVersion - two billion`; * as far as necessary: it becomes the larger of its previous value and
* `oldestVersion <= newestVersion` is preserved. Calling with `count == 0` * `newestVersion - two billion`. Calling with `count == 0` adds no write;
* adds no write; `newestVersion` (and possibly `oldestVersion`) still * `newestVersion` (and possibly `oldestVersion`) still advance. */
* advance. */
void ConflictSet_addWrites(ConflictSet *cs, void ConflictSet_addWrites(ConflictSet *cs,
const ConflictSet_WriteRange *writes, int count, const ConflictSet_WriteRange *writes, int count,
int64_t writeVersion); int64_t writeVersion);