Assigner: the node's presence is read through the watchdogs client's key and codec, no seat codec of its own (ADR 0634 §4; issue 1966)
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.novox.be/novox/mesh-contracts/go/clients/nodeengineclient"
|
||||
watchdogs "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshwatchdogs"
|
||||
wdc "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshwatchdogsclient"
|
||||
mwc "git.novox.be/novox/mesh-contracts/placement/go/clients/meshwantsclient"
|
||||
"git.novox.be/novox/mesh-delivery/contracts/go/clients/meshcatalogclient"
|
||||
mdc "git.novox.be/novox/mesh-delivery/contracts/go/clients/meshdeliveryclient"
|
||||
@@ -1189,5 +1189,5 @@ func mustAskID(a asks.Ask) string {
|
||||
|
||||
// presenceValue is a node's presence as the watchman writes it.
|
||||
func presenceValue(online bool) ([]byte, error) {
|
||||
return json.Marshal(watchdogs.PresenceByNodeValue{V: 1, Online: online})
|
||||
return json.Marshal(wdc.NodePresence{V: 1, Online: online})
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"git.novox.be/novox/mesh-contracts/go/clients/nodeengineclient"
|
||||
"git.novox.be/novox/mesh-contracts/go/seats/nodeengine"
|
||||
watchdogs "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshwatchdogs"
|
||||
wdc "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshwatchdogsclient"
|
||||
mwc "git.novox.be/novox/mesh-contracts/placement/go/clients/meshwantsclient"
|
||||
"git.novox.be/novox/mesh-delivery/contracts/go/clients/meshcatalogclient"
|
||||
mdc "git.novox.be/novox/mesh-delivery/contracts/go/clients/meshdeliveryclient"
|
||||
@@ -17,7 +17,6 @@ import (
|
||||
"mesh-delivery-assigner/internal/buckets"
|
||||
"slices"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -328,14 +327,11 @@ func (w *world) records() map[string]nodeengine.NodeRecord {
|
||||
// presenceOf reads one key of the watchman's presence: a node's key (`<node>`) with the node's online or not; the keys of
|
||||
// the parts (`part.<part>.<instance>`) are not a node's and are none here.
|
||||
func presenceOf(key string, value []byte) (node string, online, ok bool) {
|
||||
if strings.Contains(key, ".") {
|
||||
node, part, _, err := wdc.ParsePresenceKey(key)
|
||||
if err != nil || node == "" || part != "" {
|
||||
return "", false, false
|
||||
}
|
||||
node, ok = watchdogs.ParsePresenceByNodeKey(key)
|
||||
if !ok {
|
||||
return "", false, false
|
||||
}
|
||||
p, err := watchdogs.DecodePresenceByNodeValue(value)
|
||||
p, err := wdc.DecodeNodePresence(value)
|
||||
if err != nil {
|
||||
return "", false, false
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ replace git.novox.be/novox/mesh-delivery/modules/mesh-grants/grantsstate => ../m
|
||||
|
||||
require git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient v0.0.0-00010101000000-000000000000
|
||||
require git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshwatchdogs v0.0.0-00010101000000-000000000000
|
||||
require git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshwatchdogsclient v0.0.0-00010101000000-000000000000
|
||||
require git.novox.be/novox/mesh-delivery/contracts/go/clients/meshcatalogclient v0.0.0-00010101000000-000000000000
|
||||
replace git.novox.be/novox/mesh-delivery/contracts/go/clients/meshcatalogclient => ../../contracts/go/clients/meshcatalogclient
|
||||
require git.novox.be/novox/mesh-delivery/contracts/go/clients/meshdeliveryclient v0.0.0-00010101000000-000000000000
|
||||
|
||||
Reference in New Issue
Block a user