Skip to content

Commit

Permalink
fix(server): allow higher term shard deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattisonchao committed Nov 4, 2024
1 parent 9a1b781 commit 7f284bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/follower_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ func (fc *followerController) DeleteShard(request *proto.DeleteShardRequest) (*p
fc.Lock()
defer fc.Unlock()

if request.Term != fc.term {
if request.Term < fc.term {
fc.log.Warn("Invalid term when deleting shard",
slog.Int64("follower-term", fc.term),
slog.Int64("new-term", request.Term))
Expand Down
2 changes: 1 addition & 1 deletion server/leader_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ func (lc *leaderController) DeleteShard(request *proto.DeleteShardRequest) (*pro
lc.Lock()
defer lc.Unlock()

if request.Term != lc.term {
if request.Term < lc.term {
lc.log.Warn("Invalid term when deleting shard",
slog.Int64("follower-term", lc.term),
slog.Int64("new-term", request.Term))
Expand Down

0 comments on commit 7f284bc

Please sign in to comment.