mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
feat(blobnode): request new leader to update source unit
with #22812331 Signed-off-by: JasonHu520 <huzongchao@oppo.com>
This commit is contained in:
parent
c20c28b17f
commit
aef6b4efc7
@ -143,7 +143,7 @@ func (s *ShardWorker) UpdateShardMember(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *ShardWorker) LeaderTransfer(ctx context.Context) error {
|
||||
func (s *ShardWorker) LeaderTransfer(ctx context.Context) (err error) {
|
||||
span := trace.SpanFromContextSafe(ctx)
|
||||
destination := s.task.Destination
|
||||
newLeader, err := s.shardNodeCli.GetShardLeader(ctx, s.task.Leader)
|
||||
@ -160,7 +160,7 @@ func (s *ShardWorker) LeaderTransfer(ctx context.Context) error {
|
||||
err = s.shardNodeCli.UpdateShard(ctx, &client.UpdateShardArgs{
|
||||
Unit: s.task.Source,
|
||||
Type: proto.ShardUpdateTypeUpdateMember,
|
||||
Leader: s.task.Leader,
|
||||
Leader: *newLeader,
|
||||
Learner: true,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user