types: add Unhealthy and SessionEpoch fields to Node

Runtime-only fields (gorm:"-") that the upcoming refactor folds
into NodeStore's snapshot:

  - Unhealthy: replaces routes.PrimaryRoutes.unhealthy set; written
    by HA prober.
  - SessionEpoch: replaces the external connectGen sync.Map; bumped
    inside Connect's NodeStore update closure so stale Disconnect
    rejection becomes atomic with the mutation.

No behaviour change yet — fields are unread.

Updates #3203
This commit is contained in:
Kristoffer Dalby
2026-04-28 12:40:57 +00:00
parent 4320aa1348
commit 6baee3e6c3
3 changed files with 24 additions and 1 deletions
+10
View File
@@ -154,6 +154,16 @@ type Node struct {
DeletedAt *time.Time
IsOnline *bool `gorm:"-"`
// Unhealthy excludes the node from primary route election while
// online. Written by the HA prober. Runtime-only.
Unhealthy bool `gorm:"-"`
// SessionEpoch identifies a poll session. Connect bumps it; a
// Disconnect carrying a stale value is dropped, so a deferred
// disconnect from a previous session cannot overwrite a newer
// Connect. Runtime-only.
SessionEpoch uint64 `gorm:"-"`
}
type Nodes []*Node