From 33436c1b8a2450dfa2304df0f1f49e6f6a642f9b Mon Sep 17 00:00:00 2001 From: Yilun Date: Fri, 14 Sep 2018 13:41:41 -0700 Subject: [PATCH] Add more logs for debugging Signed-off-by: Yilun --- net/chord/vnode.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/chord/vnode.go b/net/chord/vnode.go index 45948c129..b7a882df7 100644 --- a/net/chord/vnode.go +++ b/net/chord/vnode.go @@ -170,6 +170,7 @@ func (vn *localVnode) checkNewSuccessor() error { if err == nil { break } + nlog.Warn("Get predecessor error:", err) // alive, err := trans.Ping(succ) // if err == nil && alive { // return errors.New("Successor alive but cannot return its predecessor") @@ -232,9 +233,7 @@ func (vn *localVnode) notifySuccessor() error { if s == nil || s.String() == vn.String() { break } - if vn.successors[idx+1] == nil || vn.successors[idx+1].String() != s.String() { - vn.successors[idx+1] = s - } + vn.successors[idx+1] = s } return nil }