Skip to content

Commit

Permalink
[raft] add replica description when we failed to remove data and rang…
Browse files Browse the repository at this point in the history
…e_id to driver action (#7903)
  • Loading branch information
luluz66 authored Nov 15, 2024
1 parent 9603763 commit 9c09a9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions enterprise/server/raft/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,33 +907,33 @@ func (rq *Queue) processReplica(ctx context.Context, repl IReplica) (bool, error
switch action {
case DriverNoop:
case DriverSplitRange:
rq.log.Debugf("split range: %d", repl.RangeID())
rq.log.Debugf("split range (range_id: %d)", repl.RangeID())
change = rq.splitRange(rd)
case DriverAddReplica:
rq.log.Debugf("add replica: %d", repl.RangeID())
rq.log.Debugf("add replica (range_id: %d)", repl.RangeID())
change = rq.addReplica(rd)
case DriverReplaceDeadReplica:
rq.log.Debugf("replace dead replica: %d", repl.RangeID())
rq.log.Debugf("replace dead replica (range_id: %d)", repl.RangeID())
change = rq.replaceDeadReplica(rd)
case DriverRemoveReplica:
rq.log.Debugf("remove replica: %d", repl.RangeID())
rq.log.Debugf("remove replica (range_id: %d)", repl.RangeID())
change = rq.removeReplica(ctx, rd, repl)
case DriverRemoveDeadReplica:
rq.log.Debugf("remove dead replica: %d", repl.RangeID())
rq.log.Debugf("remove dead replica (range_id: %d)", repl.RangeID())
change = rq.removeDeadReplica(rd)
case DriverConsiderRebalance:
rq.log.Debugf("consider rebalance: %d", repl.RangeID())
rq.log.Debugf("consider rebalance: (range_id: %d)", repl.RangeID())
change = rq.rebalance(rd, repl)
}

if change == nil {
rq.log.Debugf("nothing to do for replica: %d", repl.RangeID())
rq.log.Debugf("nothing to do for replica: (range_id: %d)", repl.RangeID())
return false, nil
}

err = rq.applyChange(ctx, change)
if err != nil {
rq.log.Warningf("Error apply change: %s", err)
rq.log.Warningf("Error apply change to range_id: %d: %s", repl.RangeID(), err)
}

if action == DriverNoop || action == DriverConsiderRebalance {
Expand Down
2 changes: 1 addition & 1 deletion enterprise/server/raft/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -2260,7 +2260,7 @@ func (s *Store) RemoveReplica(ctx context.Context, req *rfpb.RemoveReplicaReques
// we won't be able to connect to the node.
c, err := s.apiClient.GetForReplica(ctx, replicaDesc)
if err != nil {
s.log.Warningf("RemoveReplica unable to remove data, err getting api client: %s", err)
s.log.Warningf("RemoveReplica unable to remove data on c%dn%d, err getting api client: %s", replicaDesc.GetRangeId(), replicaDesc.GetReplicaId(), err)
return rsp, nil
}
_, err = c.RemoveData(ctx, &rfpb.RemoveDataRequest{
Expand Down

0 comments on commit 9c09a9e

Please sign in to comment.