Rindle docs and package mapSkip to main content

execute_public_ddl

Function execute_public_ddl 

pub fn execute_public_ddl(
    backend: &mut impl OneShotBackend,
    statement: &SqlStatementRequest,
    idempotency_key: &str,
    result_byte_limit: usize,
    now_ms: i64,
) -> Result<PublicOperationCommit, WritePlaneError>
Expand description

Execute one public DDL operation: validate the idempotency key against the caller’s now_ms, refuse non-DDL statements before any backend call, check for an exact replay, then hand the fresh apply to the backend’s critical section as one atomic unit (OneShotBackend::apply_public_ddl).

The replay check deliberately runs OUTSIDE that critical section (decision C5) — which keeps this surface’s replays-before-refusing order: a stored replay answers even while interactive writers hold the pool open. The cost is a window where a concurrent same-key DDL slips between the miss and the apply; the winner’s unique co-transactional outcome insert fails the loser’s apply, and the lost-race re-read returns the winner’s exact stored bytes. An apply error with nothing stored surfaces unchanged.