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

dynamic host volumes: ensure unique name per node #24748

Draft
wants to merge 3 commits into
base: dhv-misc-daniel-tidying
Choose a base branch
from

Conversation

gulducat
Copy link
Member

Volume name must be unique per node.

For existing static host vols, the scheduler will prevent creation of duplicate names ("no node meets constraints"), and it will similarly prevent duplicate dynamic vols after fingerprint (node re-registration), but we need to prevent concurrent duplicate creation that may happen within a fingerprint interval, too.

Here a lock is set for name+id during Create (and restore), then released when Deleted to prevent such very-fast or concurrent creates.

If the a volume spec is submitted again with a valid id set, it can still update the volume, and the plugin's Create will be run with the new spec. I'm guessing that folks may want to do this if either A) the plugin has been updated and folks want to regenerate their vols in place? or B) to increase the vol size (in CSI parlance, "expand"). Not sure if perhaps any other reasons, but I wanted to leave this door open.

A last funny caveat is if a static host volume is added to agent config after a dynamic one has been created, and the agent restarted to use it, the dynamic one will take precedence. A warning is logged to inform the user if this happens.

users may modify an existing volume
(probably to change the size? why else?)
by setting an `id` in the volume spec
and re-issuing create
with the same name -- the static vol is discarded,
dynamic takes precedence, and log to warn the user
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.

1 participant