diff --git a/go/vt/topo/consultopo/lock.go b/go/vt/topo/consultopo/lock.go index 6afa9571c95..c104c507c4d 100644 --- a/go/vt/topo/consultopo/lock.go +++ b/go/vt/topo/consultopo/lock.go @@ -51,6 +51,8 @@ func (s *Server) Lock(ctx context.Context, dirPath, contents string) (topo.LockD lockPath := path.Join(s.root, dirPath, locksFilename) + log.Infof("slack: trying to lock consul topo: dirPath: %s, lockPath: %s", dirPath, lockPath) + lockOpts := &api.LockOptions{ Key: lockPath, Value: []byte(contents), @@ -72,6 +74,7 @@ func (s *Server) Lock(ctx context.Context, dirPath, contents string) (topo.LockD return nil, err } + log.Infof("slack: trying to wait here until we are the only one or timeout(%vs) or ttl(%vs)", lockOpts.SessionOpts.LockDelay, lockOpts.SessionOpts.TTL) // Wait until we are the only ones in this client trying to // lock that path. s.mu.Lock() @@ -108,6 +111,7 @@ func (s *Server) Lock(ctx context.Context, dirPath, contents string) (topo.LockD // Consul will return empty leaderCh with nil error if we cannot get lock before the timeout // therefore we return a timeout error here if lost == nil { + log.Info("slack: sorry, tried to lock but it timed out..") return nil, topo.NewError(topo.Timeout, lockPath) } return nil, err diff --git a/go/vt/vttablet/tabletmanager/rpc_replication.go b/go/vt/vttablet/tabletmanager/rpc_replication.go index 8191e6db365..b7ab859f5d8 100644 --- a/go/vt/vttablet/tabletmanager/rpc_replication.go +++ b/go/vt/vttablet/tabletmanager/rpc_replication.go @@ -705,6 +705,7 @@ func (tm *TabletManager) setReplicationSourceRepairReplication(ctx context.Conte } if err = topo.CheckShardLocked(ctx, parent.Tablet.GetKeyspace(), parent.Tablet.GetShard()); err != nil { + log.Errorf("slack: CheckShardLocked failed with err: %v", err) var unlock func(*error) ctx, unlock, err = tm.TopoServer.LockShard(ctx, parent.Tablet.GetKeyspace(), parent.Tablet.GetShard(), fmt.Sprintf("repairReplication to %v as parent)", topoproto.TabletAliasString(parentAlias)))