Skip to content

Commit

Permalink
adapter: loosen GlobalId dependency ordering invariant for system obj…
Browse files Browse the repository at this point in the history
…ects
  • Loading branch information
Sean Loiselle authored and guswynn committed May 8, 2024
1 parent 3f29855 commit 61f2936
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/adapter/src/coord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 61f2936

Please sign in to comment.