Skip to content

Commit

Permalink
Review change from jam - log if there was a retry
Browse files Browse the repository at this point in the history
  • Loading branch information
babbageclunk committed Jul 14, 2016
1 parent 28af4c4 commit 947661c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2493,6 +2493,9 @@ func (c *Collection) Upsert(selector interface{}, update interface{}) (info *Cha
// Retry duplicate key errors on upserts.
// https://docs.mongodb.com/v3.2/reference/method/db.collection.update/#use-unique-indexes
if !IsDup(err) {
if i > 0 {
debugf("upsert retry succeeded after %d failure(s)", i)
}
break
}
}
Expand Down Expand Up @@ -4255,6 +4258,9 @@ func (q *Query) Apply(change Change, result interface{}) (info *ChangeInfo, err
err = session.DB(dbname).Run(&cmd, &doc)

if err == nil {
if i > 0 {
debugf("upsert retry succeeded after %d failure(s)", i)
}
break
}
if change.Upsert && IsDup(err) {
Expand Down

0 comments on commit 947661c

Please sign in to comment.