Skip to content

Conversation

@DAlperin
Copy link
Member

@DAlperin DAlperin commented Sep 3, 2025

The exert function is called exclusively by the catalog force compaction code path. In the case that there was only one spine batch with multiple hollow batches, the exert function would incorrectly introduce empty SpineBatches. The behavior of the reduced function was always using the number of HollowBatches as a proxy for the structural shape of the spine. With incremental compaction, there might be only one run with a number of empty HollowBatches. This is totally legal, and not a reason to try and force structural merges.

Motivation

Tips for reviewer

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@DAlperin DAlperin requested a review from a team as a code owner September 3, 2025 21:56
// parts can be cleaned up by compaction, which we intentionally ignore here to
// avoid repeatedly injecting empty batches when only structure-level compaction
// remains.
self.spine_batches().count() < 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this again from scratch, it feels like the "real criteria" for whether there's any real work to do would be whether there are <2 runs, like we do in is_compact.

Anyways I think this is probably an improvement, but consider that change pre-approved if it tests well!

The exert function is called exclusively by the catalog force compaction
code path. In the case that there was only one spine batch with multiple
hollow batches, the exert function would incorrectly introduce empty
SpineBatches. The behavior of the `reduced` function was always using
the number of HollowBatches as a proxy for the structural shape of the
spine. With incremental compaction, there might be only one run with
a number of empty HollowBatches. This is totally legal, and not a reason
to try and force structural merges.
@DAlperin DAlperin force-pushed the dov/simplify-reduced-semantics branch from 0ae6036 to 8ea5f07 Compare September 11, 2025 16:48
@DAlperin DAlperin merged commit 8c72acb into MaterializeInc:main Sep 11, 2025
128 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants