From 61f2936def49e9a767598a6f17e8bb39caf534d5 Mon Sep 17 00:00:00 2001 From: Sean Loiselle Date: Tue, 7 May 2024 15:56:39 -0400 Subject: [PATCH] adapter: loosen GlobalId dependency ordering invariant for system objects --- src/adapter/src/coord.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/adapter/src/coord.rs b/src/adapter/src/coord.rs index 0aace93bbb0d2..5b424d872221c 100644 --- a/src/adapter/src/coord.rs +++ b/src/adapter/src/coord.rs @@ -1491,11 +1491,18 @@ impl Coordinator { for entry in &entries { // TODO(#26794): we should move this invariant into `CatalogEntry`. mz_ore::soft_assert_or_log!( - entry - .used_by() - .iter() - .all(|dependent_id| *dependent_id > entry.id), - "item dependencies should respect `GlobalId`'s PartialOrd \ + // We only expect user objects to objects obey this invariant. + // System objects, for instance, can depend on other system + // objects that belong to a schema that is simply loaded first. + // To meaningfully resolve this, we could need more careful + // loading order or more complex IDs, neither of which seem very + // beneficial. + !entry.id().is_user() + || entry + .used_by() + .iter() + .all(|dependent_id| *dependent_id > entry.id), + "user item dependencies should respect `GlobalId`'s PartialOrd \ but {:?} depends on {:?}", entry.id, entry.used_by()