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

Rewrite Rename backend in a more atomic fashion #9575

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

mheon
Copy link
Member

@mheon mheon commented Mar 2, 2021

Move the core of renaming logic into the DB. This guarantees a lot more atomicity than we have right now (our current solution, removing the container from the DB and re-creating it, is VERY not atomic and prone to leaving a corrupted state behind if things go wrong. Moving things into the DB allows us to remove most, but not all, of this - there's still a potential scenario where the c/storage rename fails but the Podman rename succeeds, and we end up with a mismatched state.

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mheon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 2, 2021
@mheon
Copy link
Member Author

mheon commented Mar 2, 2021

I need to think of a few tests for this after lunch - we unblocked renaming containers with active exec sessions, for example.

Move the core of renaming logic into the DB. This guarantees a
lot more atomicity than we have right now (our current solution,
removing the container from the DB and re-creating it, is *VERY*
not atomic and prone to leaving a corrupted state behind if
things go wrong. Moving things into the DB allows us to remove
most, but not all, of this - there's still a potential scenario
where the c/storage rename fails but the Podman rename succeeds,
and we end up with a mismatched state.

Signed-off-by: Matthew Heon <[email protected]>
@mheon
Copy link
Member Author

mheon commented Mar 2, 2021

Test added

@mheon
Copy link
Member Author

mheon commented Mar 2, 2021

Looks like this is going green. @containers/podman-maintainers PTAL

@rhatdan
Copy link
Member

rhatdan commented Mar 2, 2021

LGTM
@containers/podman-maintainers PTAL

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

One question: Right now we do not update update the dnsname plugin dns name. Do you think we should call network reload as last step? (Not for this PR)

@rhatdan
Copy link
Member

rhatdan commented Mar 3, 2021

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 3, 2021
@mheon
Copy link
Member Author

mheon commented Mar 3, 2021

Tide is blocked on something, I'll check for what.

@Luap99 A full reload is a little expensive, it would be better if we could just update dnsname - we need some reworking of it anyways to fix the flaw where it can only handle a single network the container is connected to, we can handle this at the same time when we get around to that.

@openshift-merge-robot openshift-merge-robot merged commit 5fd8a84 into containers:master Mar 3, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants