pub struct RowLockManager { /* private fields */ }Implementations§
Source§impl RowLockManager
impl RowLockManager
Sourcepub fn acquire_batch(
&self,
requests: &[LockRequest<'_>],
) -> Result<Vec<LockAcquire>, SQLError>
pub fn acquire_batch( &self, requests: &[LockRequest<'_>], ) -> Result<Vec<LockAcquire>, SQLError>
Acquire pre-evaluated reservations in their original order. A group with no conflicting holder publishes all its grants under one claim-table lock. A conflict leaves that attempt unchanged and uses ordinary single-request waits, preserving prefix retention, wait diagnostics and deadlock detection. Callers must not put observable work between requests and must refresh their data view unconditionally after the batch; preliminary conflicts need not cause a later individual wait.
Source§impl RowLockManager
impl RowLockManager
Sourcepub fn begin_change_preparation(
&self,
cancel: &CancellationToken,
) -> Result<RowChangePreparation<'_>, SQLError>
pub fn begin_change_preparation( &self, cancel: &CancellationToken, ) -> Result<RowChangePreparation<'_>, SQLError>
Serialize writer preparation through final publication. Snapshot readers do not acquire this guard. Acquire it before the snapshot/publication gate and release it after metadata publication.
Sourcepub fn begin_change_snapshot(
&self,
cancel: &CancellationToken,
) -> Result<RowChangeSnapshot<'_>, SQLError>
pub fn begin_change_snapshot( &self, cancel: &CancellationToken, ) -> Result<RowChangeSnapshot<'_>, SQLError>
Hold the shared commit/snapshot gate while a storage snapshot is pinned and its row-change baseline is captured.
Sourcepub fn begin_change_publication(
&self,
cancel: &CancellationToken,
) -> Result<RowChangePublication<'_>, SQLError>
pub fn begin_change_publication( &self, cancel: &CancellationToken, ) -> Result<RowChangePublication<'_>, SQLError>
Hold the exclusive commit/snapshot gate from immediately before the backend commit through publication of its row-change metadata.
Source§impl RowLockManager
impl RowLockManager
pub fn begin_change_observation(self: &Arc<Self>) -> RowChangeObservation
pub fn current_change_epoch(&self) -> u64
pub fn conflicting_change_target_after( &self, table: &str, doc_id: DocId, baseline: &RowChangeBaseline, wanted: LockStrength, ) -> Result<RowChangeTarget, SQLError>
Sourcepub fn row_successor_after(
&self,
table: &str,
doc_id: DocId,
baseline: &RowChangeBaseline,
) -> Result<RowChangeTarget, SQLError>
pub fn row_successor_after( &self, table: &str, doc_id: DocId, baseline: &RowChangeBaseline, ) -> Result<RowChangeTarget, SQLError>
Follow committed primary-key rewrites from doc_id to the final identity, considering only rewrites newer than the statement snapshot. This prevents an old update chain from attaching to a later row that reused the same primary key.
pub fn publish_row_changes( &self, session_id: u64, changes: impl IntoIterator<Item = PendingRowChange>, ) -> Result<(), SQLError>
Source§impl RowLockManager
impl RowLockManager
pub fn release_mark_above(&self, session_id: u64, mark: u32)
pub fn release_session(&self, session_id: u64)
pub fn rollback_acquisition(&self, acquisition: RowLockAcquisition)
Source§impl RowLockManager
impl RowLockManager
Sourcepub fn physical_row_successor_after(
&self,
table: &str,
doc_id: DocId,
baseline: &RowChangeBaseline,
) -> Result<PhysicalRowChangeTarget, SQLError>
pub fn physical_row_successor_after( &self, table: &str, doc_id: DocId, baseline: &RowChangeBaseline, ) -> Result<PhysicalRowChangeTarget, SQLError>
Follow committed rewrites while retaining the physical relation as well as the document id. Partition movement changes both halves of the tuple identity, so DML rechecks must not collapse the successor back onto the source leaf.
Source§impl RowLockManager
impl RowLockManager
pub fn new() -> Self
pub fn allocate_session(&self) -> u64
pub fn allocate_transaction_xid(&self) -> Result<u32, SQLError>
Sourcepub const fn catalog_oids(&self) -> &CatalogOidCounter
pub const fn catalog_oids(&self) -> &CatalogOidCounter
The database’s OID counter for storage without durable identifier reservations; storage with them keeps the counter’s position itself.
pub fn table_key(&self, table: &str) -> u64
Sourcepub fn index_key(&self, identity: [u8; 16]) -> u64
pub fn index_key(&self, identity: [u8; 16]) -> u64
An index keeps its relation lock across renames and receives a new one after same-name recreation.
Sourcepub fn document_identity_key(&self, table: &str) -> u64
pub fn document_identity_key(&self, table: &str) -> u64
Reserve generated identities independently of tuple locks and SQL constraint keys. One namespace per table keeps registry metadata independent of the number of allocated rows.
pub fn backend_writer_key(&self) -> u64
Sourcepub fn key_reservation_key(&self, digest: [u8; 32]) -> u64
pub fn key_reservation_key(&self, digest: [u8; 32]) -> u64
Retain a permanent numeric key for existing callers. SQL requests use retain_key_reservation so completed keys can be reclaimed.
Sourcepub fn retain_key_reservation(&self, digest: [u8; 32]) -> KeyReservationIdentity
pub fn retain_key_reservation(&self, digest: [u8; 32]) -> KeyReservationIdentity
Retain a transient key identity while constructing requests; successful grants retain it until release.
Sourcepub fn scoring_parameters_key(&self, name: &str) -> u64
pub fn scoring_parameters_key(&self, name: &str) -> u64
Coordinate one named scoring-parameter value without locking unrelated signals or SQL tables.
pub fn stable_table_hash(table: &str) -> u64
pub fn table_name(&self, table: u64) -> Arc<str> ⓘ
Sourcepub fn has_cross_process_coordination(&self) -> bool
pub fn has_cross_process_coordination(&self) -> bool
Whether this manager has durable cross-process coordination. Unlike a peer-liveness check, this remains true after a peer exits, because commits made by that peer can still be newer than a statement snapshot.
Source§impl RowLockManager
impl RowLockManager
pub fn acquire_scoped_relation( &self, session_id: u64, table: u64, mode: RelationLockMode, marks: (u32, u32), cancel: &CancellationToken, ) -> Result<ScopedRelationLock<'_>, SQLError>
pub fn try_acquire_scoped_relation( &self, session_id: u64, table: u64, mode: RelationLockMode, marks: (u32, u32), cancel: &CancellationToken, ) -> Result<Option<ScopedRelationLock<'_>>, SQLError>
pub fn acquire_relation( &self, session_id: u64, table: u64, mode: RelationLockMode, mark: u32, cancel: &CancellationToken, ) -> Result<(), SQLError>
Sourcepub fn try_acquire_relation(
&self,
session_id: u64,
table: u64,
mode: RelationLockMode,
mark: u32,
cancel: &CancellationToken,
) -> Result<bool, SQLError>
pub fn try_acquire_relation( &self, session_id: u64, table: u64, mode: RelationLockMode, mark: u32, cancel: &CancellationToken, ) -> Result<bool, SQLError>
Acquire a relation lock without waiting for conflicting holders. Short internal admission serialization is independent of the SQL wait policy; a failed attempt preserves this session’s earlier modes and savepoint marks.
Source§impl RowLockManager
impl RowLockManager
Sourcepub fn lock_sequence_position(
&self,
key: SequencePositionKey,
) -> Result<SequencePositionGuard<'_>, SQLError>
pub fn lock_sequence_position( &self, key: SequencePositionKey, ) -> Result<SequencePositionGuard<'_>, SQLError>
Hold the position of one sequence until the guard is dropped. Sessions of this process wait for each other here, and other processes wait at the sidecar.
Sourcepub fn sequence_position(
&self,
key: SequencePositionKey,
) -> Result<Option<RecordedSequencePosition>, SQLError>
pub fn sequence_position( &self, key: SequencePositionKey, ) -> Result<Option<RecordedSequencePosition>, SQLError>
The recorded position of one sequence.
Sourcepub fn sequence_positions(
&self,
) -> Result<HashMap<SequencePositionKey, RecordedSequencePosition>, SQLError>
pub fn sequence_positions( &self, ) -> Result<HashMap<SequencePositionKey, RecordedSequencePosition>, SQLError>
The recorded position of every sequence.
Source§impl RowLockManager
impl RowLockManager
pub fn has_temporary_role_references(&self, session: u64) -> bool
pub fn prepare_temporary_roles<'a>( &'a self, session: u64, roles: BTreeSet<u32>, cancel: &CancellationToken, ) -> Result<TemporaryRolePublication<'a>, SQLError>
pub fn close_temporary_roles(&self, session: u64)
pub fn peer_temporary_role_reference( &self, session: u64, role: u32, cancel: &CancellationToken, ) -> Result<bool, SQLError>
Source§impl RowLockManager
impl RowLockManager
pub fn acquire( &self, request: &LockRequest<'_>, ) -> Result<LockAcquire, SQLError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RowLockManager
impl !RefUnwindSafe for RowLockManager
impl !UnwindSafe for RowLockManager
impl Send for RowLockManager
impl Sync for RowLockManager
impl Unpin for RowLockManager
impl UnsafeUnpin for RowLockManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more