mz_adapter::coord::appends

Function waiting_on_startup_appends

Source
pub(crate) fn waiting_on_startup_appends(
    catalog: &Catalog,
    session: &mut Session,
    plan: &Plan,
) -> Option<(BTreeSet<CatalogItemId>, BoxFuture<'static, ()>)>
Expand description

When we start a Session we need to update some builtin tables, we don’t want to wait for these writes to complete for two reasons:

  1. Doing a write can take a relatively long time.
  2. Decoupling the write from the session start allows us to batch multiple writes together, if sessions are being created with a high frequency.

So as an optimization we do not wait for these writes to complete. But if a Session tries to query any of these builtin objects, we need to block that query on the writes completing to maintain linearizability.