Result of an optimistic-concurrency write. Split on ok — success gives you
the new row version; failure gives you the current version the store has on
disk (or null if the row doesn't exist) so you can re-read, re-compute, and retry.
Conflict semantics: currentVersion is a best-effort snapshot of the row
at conflict-report time, which may be later than the exact moment the CAS
failed — another writer can slip in between the failed write and the follow-up
read. This is fine for the retry loop in patchWithRetry (which just
re-reads anyway). Direct callers using currentVersion for anything beyond
"retry if it changed" should account for that race.
Result of an optimistic-concurrency write. Split on
ok— success gives you the new row version; failure gives you the current version the store has on disk (ornullif the row doesn't exist) so you can re-read, re-compute, and retry.Conflict semantics:
currentVersionis a best-effort snapshot of the row at conflict-report time, which may be later than the exact moment the CAS failed — another writer can slip in between the failed write and the follow-up read. This is fine for the retry loop in patchWithRetry (which just re-reads anyway). Direct callers usingcurrentVersionfor anything beyond "retry if it changed" should account for that race.