update
This commit is contained in:
+16
-6
@@ -263,10 +263,16 @@ func (h *RemoteHost[V]) GetActorIds() []uint64 {
|
||||
return reply.GetIds()
|
||||
}
|
||||
|
||||
func (h *RemoteHost[V]) AnnounceOwnership(ownerHost string, uids []uint64) {
|
||||
func (h *RemoteHost[V]) AnnounceOwnership(ownerHost string, uids []uint64, lastChanges []int64) {
|
||||
// lastChanges is parallel to uids and carries each grain's
|
||||
// UnixNano lastChange stamp at the moment of broadcast. Receivers
|
||||
// use it for first-spawn-wins arbitration on concurrent cold
|
||||
// cache first touch; -1 entries signal "no local grain to back
|
||||
// this id" and trigger the legacy "always accept remote" fallback.
|
||||
_, err := h.controlClient.AnnounceOwnership(context.Background(), &messages.OwnershipAnnounce{
|
||||
Host: ownerHost,
|
||||
Ids: uids,
|
||||
Host: ownerHost,
|
||||
Ids: uids,
|
||||
LastChanges: lastChanges,
|
||||
})
|
||||
if err != nil {
|
||||
log.Printf("ownership announce to %s failed: %v", h.host, err)
|
||||
@@ -276,10 +282,14 @@ func (h *RemoteHost[V]) AnnounceOwnership(ownerHost string, uids []uint64) {
|
||||
h.missedPings = 0
|
||||
}
|
||||
|
||||
func (h *RemoteHost[V]) AnnounceExpiry(uids []uint64) {
|
||||
func (h *RemoteHost[V]) AnnounceExpiry(uids []uint64, lastChanges []int64) {
|
||||
// lastChanges is a parallel UnixNano stamp slice; informational on
|
||||
// this path (expiry is unilateral from the broadcaster), kept on
|
||||
// the wire for symmetry with AnnounceOwnership.
|
||||
_, err := h.controlClient.AnnounceExpiry(context.Background(), &messages.ExpiryAnnounce{
|
||||
Host: h.host,
|
||||
Ids: uids,
|
||||
Host: h.host,
|
||||
Ids: uids,
|
||||
LastChanges: lastChanges,
|
||||
})
|
||||
if err != nil {
|
||||
log.Printf("expiry announce to %s failed: %v", h.host, err)
|
||||
|
||||
Reference in New Issue
Block a user