-
Notifications
You must be signed in to change notification settings - Fork 2k
host volumes: add configuration to GC on node GC #25903
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
Conversation
5c86d79
to
bdcb86e
Compare
bdcb86e
to
e19fbfa
Compare
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.
Thanks for updating the docs!
When a node is garbage collected, any dynamic host volumes on the node are orphaned in the state store. We generally don't want to automatically collect these volumes and risk data loss, and have provided a CLI flag to `-force` remove them in #25902. But for clusters running on ephemeral cloud instances (ex. AWS EC2 in an autoscaling group), deleting host volumes may add excessive friction. Add a configuration knob to the client configuration to remove host volumes from the state store on node GC. Ref: #25902 Ref: #25762 Ref: https://hashicorp.atlassian.net/browse/NMD-705
e19fbfa
to
f4a28f5
Compare
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.
LGTM!
🫸 🔉 🗑️ (push volume into the garbage)
raw := req.URL.Query().Get("force") | ||
var force bool | ||
if raw != "" { | ||
var err error | ||
force, err = strconv.ParseBool(raw) | ||
if err != nil { | ||
return nil, CodedError(400, "invalid force value") | ||
} | ||
} | ||
args.Force = force |
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.
@@ -671,7 +671,7 @@ func (v *HostVolume) Delete(args *structs.HostVolumeDeleteRequest, reply *struct | |||
// serialize client RPC and raft write per volume ID | |||
index, err := v.serializeCall(vol.ID, "delete", func() (uint64, error) { | |||
if err := v.deleteVolume(vol); err != nil { | |||
if structs.IsErrUnknownNode(err) { | |||
if structs.IsErrUnknownNode(err) || structs.IsErrNoNodeConn(err) { |
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.
orrr was this the bug?
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.
Both 🤦
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.
LGTM!
When a node is garbage collected, any dynamic host volumes on the node are orphaned in the state store. We generally don't want to automatically collect these volumes and risk data loss, and have provided a CLI flag to
-force
remove them in #25902. But for clusters running on ephemeral cloud instances (ex. AWS EC2 in an autoscaling group), deleting host volumes may add excessive friction. Add a configuration knob to the client configuration to remove host volumes from the state store on node GC.(This also fixes a bug I discovered in #25902)
Ref: #25902
Ref: #25762
Ref: https://hashicorp.atlassian.net/browse/NMD-705
Contributor Checklist
changelog entry using the
make cl
command.ensure regressions will be caught.
and job configuration, please update the Nomad website documentation to reflect this. Refer to
the website README for docs guidelines. Please also consider whether the
change requires notes within the upgrade guide.
Reviewer Checklist
backporting document.
in the majority of situations. The main exceptions are long-lived feature branches or merges where
history should be preserved.
within the public repository.