-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Core: Reset to main as part of replace shouldn't remove main ref #11819
base: main
Are you sure you want to change the base?
Core: Reset to main as part of replace shouldn't remove main ref #11819
Conversation
6c4287d
to
94e317b
Compare
94e317b
to
621b7af
Compare
if (refName.equals(SnapshotRef.MAIN_BRANCH)) { | ||
metadataBuilder.resetMainBranch(); | ||
} else { | ||
metadataBuilder.removeRef(refName); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah at this point we may as well make TableMetadata.removeRef not clear the log if it's main, and just have the consistent behavior for resetting to main. I feel like that's the sane default for that API now but the only issue is if others depend on that behavior
Yeah sorry it's possibly a way to solve #11777, sorry I didn't quite mark it yet with "fixes" as I'm still mulling through the tradeoffs and wanted to see if CI broke with this change. @ebyhr what do you think? I was largely trying to think of simple ways to avoid a protocol change , and making the "RemoveRef(Main)" update not clear the snapshot history seemed to be the best way. There's the TableMetadata.removeRef API which will just clear the snapshot log , and we may just want to either change the behavior of that/add a separate removeRefAndHistory API for use cases which require clearing the snapshot log. |
RemoveRef(main) will clear history, we don't want to do that during a replace.