PREFIX
PREFIX = 'refs'
Key prefix refs are written under.
Holds the pointers that say where history currently ends.
A ref is a mutable name for one commit. heads/main is the tip a flush advances; a restore moves
it, and a drill reads it without touching it.
A ref is the only mutable object in the store, so it is also the only place two writers can
collide. Where the endpoint honours a conditional write, RefStore::compareAndSet() uses one, and
a caller that loses the race is told rather than silently overwriting the winner. Where it does
not, the same call still verifies the expected value first, which narrows the window without
closing it; the flush lease in strata_lock is what actually serialises writers.
$provider : \Drupal\strata\Storage\StorageProviderInterface
compareAndSet(string|null $expected, string $commit, string $name = \self::MAIN) : bool
Advances a ref only if it still points where the caller thinks it does.
| string|null | $expected | The commit id the ref should currently hold, or NULL to require that it does not exist. |
| string | $commit | The commit id to write. |
| string | $name | Ref name. |
When the commit id is not a valid digest.
When the write fails for a reason other than losing the race.
TRUE when the ref was advanced, FALSE when another writer had already moved it.