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

Core: Reset to main as part of replace shouldn't remove main ref #11819

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amogh-jahagirdar
Copy link
Contributor

RemoveRef(main) will clear history, we don't want to do that during a replace.

@github-actions github-actions bot added the core label Dec 19, 2024
@amogh-jahagirdar amogh-jahagirdar force-pushed the fix-reset-main-for-rest branch 2 times, most recently from 6c4287d to 94e317b Compare December 19, 2024 01:37
Comment on lines +341 to +345
if (refName.equals(SnapshotRef.MAIN_BRANCH)) {
metadataBuilder.resetMainBranch();
} else {
metadataBuilder.removeRef(refName);
}
Copy link
Contributor Author

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

@ebyhr
Copy link
Contributor

ebyhr commented Dec 19, 2024

This PR resolves #11777, right? #11779 is my another PR with a different approach.
I will close mine if we want to avoid changing a spec. Actually, I was thinking this approach as a plan B when preparing my PR.

@amogh-jahagirdar
Copy link
Contributor Author

amogh-jahagirdar commented Dec 19, 2024

This PR resolves #11777, right? #11779 is my another PR with a different approach.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants