Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catalog: Fix savepoint upper calculation #28360

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

jkosh44
Copy link
Contributor

@jkosh44 jkosh44 commented Jul 18, 2024

The savepoint catalog mode creates a logical branch of catalog state. Previously, savepoint catalogs would look at the upper of the catalog persist shard to determine the current catalog upper. Looking at the persist shard gives us the upper of the "main" catalog state branch, but not the current savepoint branch upper. Instead, we should be looking at the upper saved in memory.

This commit fixes the issue by updating the fetch upper logical and adds some sanity asserts to various related spots in the code.

Fixes MaterializeInc/database-issues#8298

Motivation

This PR fixes a recognized bug.

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).
  • This PR includes the following user-facing behavior changes:
    • There are no user-facing behavior changes.

The savepoint catalog mode creates a logical branch of catalog state.
Previously, savepoint catalogs would look at the upper of the catalog
persist shard to determine the current catalog upper. Looking at the
persist shard gives us the upper of the "main" catalog state branch,
but not the current savepoint branch upper. Instead, we should be
looking at the upper saved in memory.

This commit fixes the issue by updating the fetch upper logical and
adds some sanity asserts to various related spots in the code.

Fixes #28326
@jkosh44 jkosh44 marked this pull request as ready for review July 18, 2024 22:52
@jkosh44 jkosh44 requested a review from a team as a code owner July 18, 2024 22:52
@jkosh44 jkosh44 requested review from ParkMyCar, aljoscha and def- July 18, 2024 22:52
Copy link
Contributor

@def- def- left a comment

Choose a reason for hiding this comment

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

Is it possible to write an explicit test for this? I'd sleep better knowing we have both a deterministic and randomized test catching this

@jkosh44
Copy link
Contributor Author

jkosh44 commented Jul 19, 2024

Is it possible to write an explicit test for this? I'd sleep better knowing we have both a deterministic and randomized test catching this

Done in the most recent commit.

@jkosh44 jkosh44 enabled auto-merge (squash) July 19, 2024 13:29
@jkosh44 jkosh44 merged commit 95cd54a into MaterializeInc:main Jul 19, 2024
77 checks passed
@jkosh44 jkosh44 deleted the fix-savepoint-upper branch July 19, 2024 14:36
ParkMyCar pushed a commit that referenced this pull request Jul 19, 2024
The savepoint catalog mode creates a logical branch of catalog state.
Previously, savepoint catalogs would look at the upper of the catalog
persist shard to determine the current catalog upper. Looking at the
persist shard gives us the upper of the "main" catalog state branch, but
not the current savepoint branch upper. Instead, we should be looking at
the upper saved in memory.

This commit fixes the issue by updating the fetch upper logical and adds
some sanity asserts to various related spots in the code.

Fixes #28326
sjwiesman pushed a commit to sjwiesman/materialize that referenced this pull request Jul 19, 2024
The savepoint catalog mode creates a logical branch of catalog state.
Previously, savepoint catalogs would look at the upper of the catalog
persist shard to determine the current catalog upper. Looking at the
persist shard gives us the upper of the "main" catalog state branch, but
not the current savepoint branch upper. Instead, we should be looking at
the upper saved in memory.

This commit fixes the issue by updating the fetch upper logical and adds
some sanity asserts to various related spots in the code.

Fixes #28326
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.

3 participants