Skip to content

Commit

Permalink
fix: update couchbase membership index from last active instances
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmtszr committed Feb 22, 2024
1 parent 1d5989c commit 3a50b53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions couchbase/membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (h *cbMembership) monitor() {
}

if h.isClusterChanged(filteredInstances) {
err = h.updateIndex(ctx, data.Cas)
err = h.updateIndex(ctx, filteredInstances, data.Cas)
if err == nil {
h.rebalance(filteredInstances)
} else if errors.Is(err, gocbcore.ErrCasMismatch) {
Expand All @@ -231,10 +231,10 @@ func (h *cbMembership) monitor() {
}
}

func (h *cbMembership) updateIndex(ctx context.Context, cas gocbcore.Cas) error {
func (h *cbMembership) updateIndex(ctx context.Context, instances []Instance, cas gocbcore.Cas) error {
all := map[string]int64{}

for _, instance := range h.lastActiveInstances {
for _, instance := range instances {
all[*instance.ID] = instance.ClusterJoinTime
}

Expand Down

0 comments on commit 3a50b53

Please sign in to comment.