From f245ba91c4f4d2820987ea3053e354e73d5b200f Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Mon, 10 Aug 2020 18:15:29 -0400 Subject: [PATCH] nomad/state/state_store: two cases of incorrect CSIPlugin in-place (#8630) --- nomad/state/state_store.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index 3c4196c3d..d7c8cc70e 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -1099,7 +1099,7 @@ func upsertNodeCSIPlugins(txn *memdb.Txn, node *structs.Node, index uint64) erro if raw == nil { break } - plug := raw.(*structs.CSIPlugin) + plug := raw.(*structs.CSIPlugin).Copy() var hadDelete bool if _, ok := inUseController[plug.ID]; !ok { @@ -4740,6 +4740,7 @@ func (s *StateStore) updatePluginWithAlloc(index uint64, alloc *structs.Allocati // became healthy, just move on return nil } + plug = plug.Copy() err = plug.DeleteAlloc(alloc.ID, alloc.NodeID) if err != nil { return err