pub enum RetireMatch {
Containment,
Overlap,
}Expand description
Which SQL predicate retire_partitions uses to find partitions to replace.
There is no JIT registry to infer “this view regroups blocks across runs” from
view_set_name/view_instance_id alone, so callers must say which rule applies to them.
Variants§
Containment
The existing partition is fully contained in the new
[begin_insert_time, end_insert_time] range (begin_insert_time >= $3 AND end_insert_time <= $4, with an exact-match special case when the new range is degenerate). Correct
whenever a view’s cut points are stable across materialization runs: a rewritten range
either exactly reproduces an old partition’s range (matched by the exact-match case) or
strictly extends it (matched by containment). This holds for every JIT view under
BlockOrder::InsertTime and for every non-JIT (batch/merge) partition write. Used by
everything except the two BlockOrder::EventTime JIT views.
Overlap
An inclusive insert-range intersection test – tstzrange(begin, end, '[]') && tstzrange($3, $4, '[]') – with same-run siblings excluded by identity (see
same_run_ranges below). The '[]' bounds matter twice over: a partition’s
[begin_insert_time, end_insert_time] is the inclusive min/max of its blocks’ insert
times, so two partitions that merely touch at one instant can both contain a block at
that instant and must be considered intersecting; and an inclusive range is never empty,
so degenerate [t, t] partitions (on either side) intersect anything containing t –
with Postgres’s default half-open ranges, tstzrange(t, t) is empty and && is
vacuously false.
Required by thread_spans_view.rs / net_spans_view.rs, whose BlockOrder::EventTime
grouping can move an earlier cut point between jit_update runs (see
jit_partitions::group_blocks_into_partitions), so a later run’s narrower spec can leave
behind a stale, wider partition that merely overlaps the new range instead of being
contained by it – Containment alone would never retire it, and the subsequent insert
would trip the lakehouse_partitions_no_overlap exclusion constraint.
Tolerated gap: retiring the stale partition and inserting the new, narrower one are two
statements in one transaction, so a range the old partition covered but the new one does not
yet (a sibling later in the same jit_update loop covers it) is transiently missing until
that sibling is written – or, if the loop fails, until the next successful jit_update.
Tolerable because JIT partitions are regenerated on demand from blocks_view and are not
the source of truth for their own data.
Trait Implementations§
Source§impl Clone for RetireMatch
impl Clone for RetireMatch
Source§fn clone(&self) -> RetireMatch
fn clone(&self) -> RetireMatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RetireMatch
Source§impl Debug for RetireMatch
impl Debug for RetireMatch
impl Eq for RetireMatch
Source§impl PartialEq for RetireMatch
impl PartialEq for RetireMatch
impl StructuralPartialEq for RetireMatch
Auto Trait Implementations§
impl Freeze for RetireMatch
impl RefUnwindSafe for RetireMatch
impl Send for RetireMatch
impl Sync for RetireMatch
impl Unpin for RetireMatch
impl UnsafeUnpin for RetireMatch
impl UnwindSafe for RetireMatch
Blanket Implementations§
impl<T> Allocation for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].