Liking cljdoc? Tell your friends :D

igeldb.tx


clear-pending!clj

(clear-pending! registry keys seq)

Drop each of keys whose pending seq is still exactly seq. Called by the worker after it has applied this tx's batch to the memtable, so the read path already sees the write. The equality guard is essential: a newer in-flight commit may have raised the entry to a higher seq, and that must survive until its own apply -- never evict a newer pending seq.

Drop each of `keys` whose pending seq is still exactly `seq`. Called by the
worker after it has applied this tx's batch to the memtable, so the read path
already sees the write. The equality guard is essential: a newer in-flight
commit may have raised the entry to a higher seq, and that must survive until
its own apply -- never evict a newer pending seq.
sourceraw docstring

create-registryclj

(create-registry)
(create-registry init-seq)

Create the global tx registry. init-seq seeds both the commit-order counter and the applied high-water mark (on startup the replayed/recovered data is already materializable by the read path, so applied == init-seq; 0 for a fresh store).

Create the global tx registry. `init-seq` seeds both the commit-order counter
and the applied high-water mark (on startup the replayed/recovered data is
already materializable by the read path, so applied == init-seq; 0 for a fresh
store).
sourceraw docstring

current-appliedclj

(current-applied registry)

The max seq the worker has applied to the memtable. begin-tx pins its snapshot to this (see the applied note above).

The max seq the worker has applied to the memtable. `begin-tx` pins its
snapshot to this (see the `applied` note above).
sourceraw docstring

current-seqclj

(current-seq registry)

The highest commit-order seq assigned so far. A begin-tx pins this as its snapshot; non-tx reads use Long/MAX_VALUE instead (always latest).

The highest commit-order seq assigned so far. A begin-tx pins this as its
snapshot; non-tx reads use `Long/MAX_VALUE` instead (always latest).
sourceraw docstring

deregister-snapshot!clj

(deregister-snapshot! registry s)

Remove one live tx pinned at snapshot seq s (decrement, dropping the key at zero). Called on commit-tx / rollback-tx.

Remove one live tx pinned at snapshot seq `s` (decrement, dropping the key at
zero). Called on commit-tx / rollback-tx.
sourceraw docstring

mark-applied!clj

(mark-applied! registry seq)

Advance the applied high-water mark to seq (monotonic max). Called by the group-commit worker AFTER it has published the memtable apply, so any reader that observes the new applied value can materialize every seq <= it.

Advance the applied high-water mark to `seq` (monotonic max). Called by the
group-commit worker AFTER it has published the memtable apply, so any reader
that observes the new applied value can materialize every seq <= it.
sourceraw docstring

min-active-snapshot-seqclj

(min-active-snapshot-seq registry)

The minimum snapshot seq over all live txs, or -- when none is active -- the current seq (nothing older than 'now' needs preserving).

Reads current-seq FIRST, then the active set, and returns their min. Order matters for the no-active-tx race: any tx that begins after this read pins a snapshot >= the current-seq we observed (the counter only grows), so a floor of the observed current-seq never exceeds a future live tx's snapshot -- GC stays safe.

The minimum snapshot seq over all live txs, or -- when none is active -- the
current seq (nothing older than 'now' needs preserving).

Reads `current-seq` FIRST, then the active set, and returns their `min`. Order
matters for the no-active-tx race: any tx that begins after this read pins a
snapshot >= the `current-seq` we observed (the counter only grows), so a floor
of the observed current-seq never exceeds a future live tx's snapshot -- GC
stays safe.
sourceraw docstring

next-seq!clj

(next-seq! registry)

Atomically assign and return the next commit-order seq.

Atomically assign and return the next commit-order seq.
sourceraw docstring

pending-seqclj

(pending-seq registry k)

The in-flight committed seq for user_key k, or nil. Read under the commit lock as part of conflict detection.

The in-flight committed seq for user_key `k`, or nil. Read under the commit
lock as part of conflict detection.
sourceraw docstring

record-pending!clj

(record-pending! registry keys seq)

Mark each of keys as having an in-flight commit at seq (the larger seq wins if one is already pending -- commits are ordered by the commit lock, but max keeps it order-independent). Called under the commit lock after seq assignment.

Mark each of `keys` as having an in-flight commit at `seq` (the larger seq wins
if one is already pending -- commits are ordered by the commit lock, but `max`
keeps it order-independent). Called under the commit lock after seq assignment.
sourceraw docstring

register-snapshot!clj

(register-snapshot! registry s)

Register a live tx pinned at snapshot seq s (increment its multiset count). Called on begin-tx.

Register a live tx pinned at snapshot seq `s` (increment its multiset count).
Called on begin-tx.
sourceraw docstring

seed-seq!clj

(seed-seq! registry n)

Reset the commit-order counter AND the applied high-water mark to n (recovery seeds them to the max replayed seq: later writes get strictly higher seqs, and the recovered data is already materializable so applied == n). Init only.

Reset the commit-order counter AND the applied high-water mark to `n` (recovery
seeds them to the max replayed seq: later writes get strictly higher seqs, and
the recovered data is already materializable so applied == n). Init only.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close