Skip to main content

RowLockManager

Struct RowLockManager 

Source
pub struct RowLockManager { /* private fields */ }

Implementations§

Source§

impl RowLockManager

Source

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

Source

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.

Source

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.

Source

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

Source

pub fn begin_change_observation(self: &Arc<Self>) -> RowChangeObservation

Source

pub fn current_change_epoch(&self) -> u64

Source

pub fn conflicting_change_target_after( &self, table: &str, doc_id: DocId, baseline: &RowChangeBaseline, wanted: LockStrength, ) -> Result<RowChangeTarget, SQLError>

Source

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.

Source

pub fn publish_row_changes( &self, session_id: u64, changes: impl IntoIterator<Item = PendingRowChange>, ) -> Result<(), SQLError>

Source§

impl RowLockManager

Source

pub fn release_mark_above(&self, session_id: u64, mark: u32)

Source

pub fn release_session(&self, session_id: u64)

Source

pub fn rollback_acquisition(&self, acquisition: RowLockAcquisition)

Source§

impl RowLockManager

Source

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

Source

pub fn new() -> Self

Source

pub fn allocate_session(&self) -> u64

Source

pub fn allocate_transaction_xid(&self) -> Result<u32, SQLError>

Source

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.

Source

pub fn table_key(&self, table: &str) -> u64

Source

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.

Source

pub fn shared_catalog_key(&self, target: SharedCatalogLock<'_>) -> u64

Source

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.

Source

pub fn backend_writer_key(&self) -> u64

Source

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.

Source

pub fn retain_key_reservation(&self, digest: [u8; 32]) -> KeyReservationIdentity

Retain a transient key identity while constructing requests; successful grants retain it until release.

Source

pub fn scoring_parameters_key(&self, name: &str) -> u64

Coordinate one named scoring-parameter value without locking unrelated signals or SQL tables.

Source

pub fn stable_table_hash(table: &str) -> u64

Source

pub fn table_name(&self, table: u64) -> Arc<str> ⓘ

Source

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

Source

pub fn acquire_scoped_relation( &self, session_id: u64, table: u64, mode: RelationLockMode, marks: (u32, u32), cancel: &CancellationToken, ) -> Result<ScopedRelationLock<'_>, SQLError>

Source

pub fn try_acquire_scoped_relation( &self, session_id: u64, table: u64, mode: RelationLockMode, marks: (u32, u32), cancel: &CancellationToken, ) -> Result<Option<ScopedRelationLock<'_>>, SQLError>

Source

pub fn acquire_relation( &self, session_id: u64, table: u64, mode: RelationLockMode, mark: u32, cancel: &CancellationToken, ) -> Result<(), SQLError>

Source

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

Source

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.

Source

pub fn sequence_position( &self, key: SequencePositionKey, ) -> Result<Option<RecordedSequencePosition>, SQLError>

The recorded position of one sequence.

Source

pub fn sequence_positions( &self, ) -> Result<HashMap<SequencePositionKey, RecordedSequencePosition>, SQLError>

The recorded position of every sequence.

Source§

impl RowLockManager

Source

pub fn has_temporary_role_references(&self, session: u64) -> bool

Source

pub fn prepare_temporary_roles<'a>( &'a self, session: u64, roles: BTreeSet<u32>, cancel: &CancellationToken, ) -> Result<TemporaryRolePublication<'a>, SQLError>

Source

pub fn close_temporary_roles(&self, session: u64)

Source

pub fn peer_temporary_role_reference( &self, session: u64, role: u32, cancel: &CancellationToken, ) -> Result<bool, SQLError>

Source§

impl RowLockManager

Source

pub fn acquire( &self, request: &LockRequest<'_>, ) -> Result<LockAcquire, SQLError>

Trait Implementations§

Source§

impl Default for RowLockManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.