fix ownership
This commit is contained in:
@@ -37,5 +37,5 @@ type Host interface {
|
|||||||
Close() error
|
Close() error
|
||||||
Ping() bool
|
Ping() bool
|
||||||
IsHealthy() bool
|
IsHealthy() bool
|
||||||
AnnounceOwnership(ids []uint64)
|
AnnounceOwnership(ownerHost string, ids []uint64)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ func (p *SimpleGrainPool[V]) broadcastOwnership(ids []uint64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p.forAllHosts(func(rh Host) {
|
p.forAllHosts(func(rh Host) {
|
||||||
rh.AnnounceOwnership(ids)
|
rh.AnnounceOwnership(p.hostname, ids)
|
||||||
})
|
})
|
||||||
log.Printf("taking ownership of %d ids", len(ids))
|
log.Printf("taking ownership of %d ids", len(ids))
|
||||||
// go p.statsUpdate()
|
// go p.statsUpdate()
|
||||||
|
|||||||
@@ -117,9 +117,9 @@ func (h *RemoteHost) GetActorIds() []uint64 {
|
|||||||
return reply.GetIds()
|
return reply.GetIds()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *RemoteHost) AnnounceOwnership(uids []uint64) {
|
func (h *RemoteHost) AnnounceOwnership(ownerHost string, uids []uint64) {
|
||||||
_, err := h.controlClient.AnnounceOwnership(context.Background(), &messages.OwnershipAnnounce{
|
_, err := h.controlClient.AnnounceOwnership(context.Background(), &messages.OwnershipAnnounce{
|
||||||
Host: h.host,
|
Host: ownerHost,
|
||||||
Ids: uids,
|
Ids: uids,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user