From 63165768230d90a9c7ef2d582050db9af009e094 Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Fri, 14 Mar 2025 10:01:00 -0400 Subject: [PATCH] check predecessor before stabilizing --- chord/httpnode/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chord/httpnode/server.go b/chord/httpnode/server.go index 64f7731..dd2767a 100644 --- a/chord/httpnode/server.go +++ b/chord/httpnode/server.go @@ -55,6 +55,7 @@ func (n *Node) Router() http.Handler { // Check performs checks that implement the Chord protocol. // It must be called periodically while the node is alive. func (n *Node) Check(ctx context.Context) error { + chord.CheckPredecessor(ctx, n.client, n.self) if err := chord.Stabilize(ctx, n.client, n.self); err != nil { return fmt.Errorf("failed to stabilize: %w", err) } @@ -62,7 +63,6 @@ func (n *Node) Check(ctx context.Context) error { // if err := chord.FixFingers(ctx, n.client, n.self); err != nil { // return fmt.Errorf("failed to fix fingers: %w", err) // } - chord.CheckPredecessor(ctx, n.client, n.self) return nil }