Module mz_adapter::coord::catalog_oracle
source · Expand description
A timestamp oracle that relies on the Catalog
for persistence/durability
and reserves ranges of timestamps.
Structs
- A type that wraps a
InMemoryTimestampOracle
and provides durable timestamps. This allows us to recover a timestamp that is larger than all previous timestamps on restart. The protocol is based on timestamp recovery from Percolator https://research.google/pubs/pub36726/. We “pre-allocate” a group of timestamps at once, and only durably store the largest of those timestamps. All timestamps within that interval can be served directly from memory, without going to disk. On restart, we re-initialize the current timestamp to a value one larger than the persisted timestamp. - A
TimestampPersistence
that is backed by aCatalog
. - A type that provides write and read timestamps, reads observe exactly their preceding writes.
Constants
- The Coordinator tries to prevent the persisted timestamp from exceeding a value
TIMESTAMP_INTERVAL_UPPER_BOUND
timesTIMESTAMP_PERSIST_INTERVAL
larger than the current system time.
Statics
- Interval used to persist durable timestamps. See
CatalogTimestampOracle
for more details.
Traits
- Provides persistence of timestamps for
CatalogTimestampOracle
.
Functions
- Returns the current system time while protecting against backwards time jumps.
- Convenience function for calculating the current upper bound that we want to prevent the global timestamp from exceeding.