From de62b0664d14cdeffaeac16882fcbc2aee37f893 Mon Sep 17 00:00:00 2001 From: matst80 Date: Tue, 14 Oct 2025 13:33:08 +0200 Subject: [PATCH] fix ownership --- pkg/actor/grain_pool.go | 2 +- pkg/actor/simple_grain_pool.go | 2 +- pkg/proxy/remotehost.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/actor/grain_pool.go b/pkg/actor/grain_pool.go index 654731b..d81e2f3 100644 --- a/pkg/actor/grain_pool.go +++ b/pkg/actor/grain_pool.go @@ -37,5 +37,5 @@ type Host interface { Close() error Ping() bool IsHealthy() bool - AnnounceOwnership(ids []uint64) + AnnounceOwnership(ownerHost string, ids []uint64) } diff --git a/pkg/actor/simple_grain_pool.go b/pkg/actor/simple_grain_pool.go index 0b2ac73..a53fa02 100644 --- a/pkg/actor/simple_grain_pool.go +++ b/pkg/actor/simple_grain_pool.go @@ -342,7 +342,7 @@ func (p *SimpleGrainPool[V]) broadcastOwnership(ids []uint64) { } p.forAllHosts(func(rh Host) { - rh.AnnounceOwnership(ids) + rh.AnnounceOwnership(p.hostname, ids) }) log.Printf("taking ownership of %d ids", len(ids)) // go p.statsUpdate() diff --git a/pkg/proxy/remotehost.go b/pkg/proxy/remotehost.go index 84cc095..a931dd5 100644 --- a/pkg/proxy/remotehost.go +++ b/pkg/proxy/remotehost.go @@ -117,9 +117,9 @@ func (h *RemoteHost) GetActorIds() []uint64 { 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{ - Host: h.host, + Host: ownerHost, Ids: uids, }) if err != nil {