Skip to content

Commit

Permalink
feat: change cas mismatch log level
Browse files Browse the repository at this point in the history
  • Loading branch information
erayarslan committed Apr 4, 2024
1 parent 62515ff commit 56a58d7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions couchbase/membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,13 @@ func (h *cbMembership) monitor() {
err = h.updateIndex(ctx, filteredInstances, data.Cas)
if err == nil {
h.rebalance(filteredInstances)
} else if errors.Is(err, gocbcore.ErrCasMismatch) {
h.monitor()
} else {
if errors.Is(err, gocbcore.ErrCasMismatch) {
logger.Log.Warn("error while update instances: cas mismatch")
h.monitor()
} else {
logger.Log.Error("error while update instances: %v", err)
}
}
}
}
Expand All @@ -241,7 +246,6 @@ func (h *cbMembership) updateIndex(ctx context.Context, instances []Instance, ca

err := UpdateDocument(ctx, h.client.GetMetaAgent(), h.scopeName, h.collectionName, h.instanceAll, payload, 0, &cas)
if err != nil {
logger.Log.Error("error while update instances: %v", err)
return err
}
return nil
Expand Down

0 comments on commit 56a58d7

Please sign in to comment.