Skip to content

Commit

Permalink
[DO NOT MERGE] [BUGFIX] v1.7.12 Last Agent's index correction process…
Browse files Browse the repository at this point in the history
… not enought

Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango committed Aug 7, 2024
1 parent c391300 commit 3e25f58
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/index/job/correction/service/corrector.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,12 @@ type vectorReplica struct {
func (c *correct) checkConsistency(ctx context.Context, targetReplica *vectorReplica, targetAgentIdx int) error {
// leftAgentAddrs is the agents' addr that hasn't been corrected yet.
leftAgentAddrs := c.sortedByIndexCntAddrs[targetAgentIdx+1:]

if len(leftAgentAddrs) == 0 {
if err := c.correctReplica(ctx, targetReplica, nil); err != nil {
return fmt.Errorf("failed to fix final agent's index replica: %w", err)
}
return nil
}
// Vector with time after this should not be processed
correctionStartTime, err := correctionStartTime(ctx)
if err != nil {
Expand Down Expand Up @@ -441,7 +446,7 @@ func (c *correct) correctReplica(
if addr == targetReplica.addr {
continue
}
if slices.ContainsFunc(foundReplicas, func(replica *vectorReplica) bool {
if foundReplicas != nil && slices.ContainsFunc(foundReplicas, func(replica *vectorReplica) bool {
return replica.addr == addr
}) {
continue
Expand Down

0 comments on commit 3e25f58

Please sign in to comment.