Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bitofsky committed Jul 3, 2021
1 parent 9a4e474 commit c10de69
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions redis/redis-checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ func (checkpointer *RedisCheckpoint) CheckpointSequence(shard *par.ShardStatus)
claimRequest := ""

if checkpointer.kclConfig.EnableLeaseStealing {
if checkpoint, err := checkpointer.getItem(shard.ID); err != nil && checkpoint.Checkpoint != "" {
claimRequest = checkpoint.Checkpoint
if checkpoint, err := checkpointer.getItem(shard.ID); err != nil && checkpoint.ClaimRequest != "" && checkpoint.ClaimRequest != shard.ID {
claimRequest = checkpoint.ClaimRequest
checkpointer.kclConfig.Logger.Warnf("CheckpointSequence new claimRequest for %s", claimRequest)
}
}

Expand Down Expand Up @@ -274,7 +275,8 @@ func (checkpointer *RedisCheckpoint) RemoveLeaseOwner(shardID string) error {
} else if cp.AssignedTo != checkpointer.kclConfig.WorkerID {
return fmt.Errorf("RemoveLeaseOwner invalid AssignedTo")
} else {
return checkpointer.removeItem(shardID)
cp.AssignedTo = ""
return checkpointer.putItem(cp)
}
}

Expand Down

0 comments on commit c10de69

Please sign in to comment.