Repository navigation
ateapi: check mounted volumes are attachable and test assigned_node detach on crash - #2611
Open
Vu Le (lekhoavu2909) wants to merge 2 commits into
Open
Vu Le (lekhoavu2909) wants to merge 2 commits into
Vu Le (lekhoavu2909) wants to merge 2 commits into
Conversation
hajiler
reviewed
Oct 13, 2026
| ref := &ateapipb.ObjectRef{Atespace: actor.GetMetadata().GetAtespace(), Name: actor.GetMetadata().GetName()} | ||
| return getMountedActorVolumes(ctx, ref, actor.GetStatus().GetExternalVolumes(), tmpl) | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
nit: generally helper functions improve readability, but this is sort of a wrapper for another helper function. I'd recommend keeping it as it was
hajiler
reviewed
Oct 13, 2026
Comment on lines
+679
to
+688
| func checkVolumesAttachable(volumes []*ateapipb.ExternalVolume) error { | ||
| for _, vol := range volumes { | ||
| switch { | ||
| case vol.GetStatus() != ateapipb.ExternalVolume_STATUS_CREATED: | ||
| return apierror.FailedPrecondition("volume %q is %s, want %s before it is attached", vol.GetName(), vol.GetStatus(), ateapipb.ExternalVolume_STATUS_CREATED) | ||
| case vol.GetStorageVolumeId() == "": | ||
| return apierror.FailedPrecondition("volume %q has no storage volume ID to attach", vol.GetName()) | ||
| } | ||
| } | ||
| return nil |
Collaborator
There was a problem hiding this comment.
We are actually getting rid of volume status in #2456. I don't think you need to rebase on the change, just use the StorageVolumeID != "" check.
Vu Le (lekhoavu2909)
force-pushed
the
volume-assigned-node-detach
branch
from
October 14, 2026 18:00
58095e4 to
5567567
Compare
Vu Le (lekhoavu2909)
force-pushed
the
volume-assigned-node-detach
branch
from
October 14, 2026 20:08
5567567 to
a88d3b4
Compare
Vu Le (lekhoavu2909)
force-pushed
the
volume-assigned-node-detach
branch
from
October 14, 2026 21:08
a88d3b4 to
47d2b5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some storage backends (e.g. Cloud Filestore IP export rules) restrict a volume to the node it is published to via CSI
ControllerPublishVolume/ControllerUnpublishVolume, so every publish must be matched by an unpublish to the same node. Since #2222 , detach targetsActorStatus.assigned_node, which survives crashes and worker loss. This PR adds checks before attach and test coverage for the paths where detach used to be skipped.Follows #2094, which covers the publish side.
Changes
Worker without a node name:
assignWorkerAttemptrejects such a worker with when the actor mounts external volumes. Previously the resume failed inensureVolumesAttached, after the worker was booked.Volume checks before attach:
ensureVolumesAttachedchecks that every mounted volume isSTATUS_CREATEDand has astorage_volume_idbefore any attach call, so one bad volume can't leave earlier volumes published.Unit tests, functional tests
E2E:
assigned_nodeequals the worker'snode_namewhile RUNNING and is cleared after suspend and revert. The OSS NFS driver doesn't implementControllerPublishVolume.Tests pass