feat(workers): add VerifyKnownWorkers repo function (#5189)

This commit is contained in:
Irena Rindos authored and GitHub committed 2024-10-23 13:41:44 -04:00
1 parent dfde64e648
commit 36158056d9
5 files changed
+101 -6

No files matched your search

+2 -4
View File
@@ -12,9 +12,7 @@ import (
"github.com/hashicorp/boundary/internal/daemon/cluster"
"github.com/hashicorp/boundary/internal/errors"
"github.com/hashicorp/boundary/internal/event"
"github.com/hashicorp/boundary/internal/server"
"github.com/hashicorp/boundary/internal/server/store"
"github.com/hashicorp/boundary/internal/types/scope"
)
// In the future we could make this configurable
@@ -198,12 +196,12 @@ func (c *Controller) startWorkerConnectionMaintenanceTicking(cancelCtx context.C
event.WriteError(cancelCtx, op, err, event.WithInfoMsg("error fetching server repository for cluster connection maintenance"))
break
}
knownWorker, err := serverRepo.ListWorkers(cancelCtx, []string{scope.Global.String()}, server.WithWorkerPool(connectionState.WorkerIds()), server.WithLiveness(-1))
knownWorkers, err := serverRepo.VerifyKnownWorkers(cancelCtx, connectionState.WorkerIds())
if err != nil {
event.WriteError(cancelCtx, op, err, event.WithInfoMsg("couldn't get known workers from repo"))
break
}
connectionState.DisconnectMissingWorkers(server.WorkerList(knownWorker).PublicIds())
connectionState.DisconnectMissingWorkers(knownWorkers)
}
if len(connectionState.UnmappedKeyIds()) > 0 {