From 9859f4a140d8cda1ca0de0dd562fe5001ff9380d Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Mon, 4 Aug 2025 12:07:27 -0400 Subject: [PATCH] document version check requirement on Raft message types (#26411) Whenever we add a new Raft message type, we almost always need to add a new version check to ensure that leaders aren't trying to write unknown Raft entries to older followers. Leave a note about this where the edits happen to reduce the risk of this unfortunately common bug. Ref: https://github.com/hashicorp/nomad-enterprise/pull/2973 --- nomad/structs/structs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 0693427ef..847764f77 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -140,6 +140,9 @@ const ( // NOTE: MessageTypes are shared between CE and ENT. If you need to add a // new type, check that ENT is not already using that value. + // + // NOTE: Adding a new MessageType above? You need to have a version check + // for the feature to avoid panics during upgrades. ) const (