New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resync with xattrs causes warnings for every no-op #3724

Closed
bbrks opened this Issue Sep 3, 2018 · 0 comments

Comments

Projects
None yet
4 participants
@bbrks
Copy link
Member

bbrks commented Sep 3, 2018

When using xattrs and running _resync, if a doc does not need to be updated, the "Cancel update" error is logged as a warning instead of just being silently swallowed. We already have handling to ignore couchbase.UpdateCancel, so maybe we should be using that instead of errors.New("Cancel update").

return nil, nil, deleteDoc, nil, errors.New("Cancel update")

sync_gateway/db/database.go

Lines 970 to 972 in 56639af

} else if err != couchbase.UpdateCancel {
base.Warnf(base.KeyAll, "Error updating doc %q: %v", base.UD(docid), err)
}

Additionally, I think the Re-syncing document "doc1" log at info level may be a bit too verbose? I think this should be debug instead. Anything that goes wrong will give warnings anyway, and you still get a final stat out at info level: Finished re-running sync function; 0/3 docs changed.

2018-09-03T14:59:44.407+01:00 [INF] HTTP:  #005: POST /db/_resync (as ADMIN)
2018-09-03T14:59:44.407+01:00 [INF] Recomputing document channels...
2018-09-03T14:59:44.439+01:00 [INF] Re-running sync function on all documents...
2018-09-03T14:59:44.439+01:00 [INF] CRUD: 	Re-syncing document "doc1"
2018-09-03T14:59:44.439+01:00 [WRN] Error updating doc "doc1": Cancel update -- db.(*Database).UpdateAllDocChannels() at database.go:971
2018-09-03T14:59:44.439+01:00 [INF] CRUD: 	Re-syncing document "doc2"
2018-09-03T14:59:44.439+01:00 [WRN] Error updating doc "doc2": Cancel update -- db.(*Database).UpdateAllDocChannels() at database.go:971
2018-09-03T14:59:44.440+01:00 [INF] CRUD: 	Re-syncing document "doc3"
2018-09-03T14:59:44.440+01:00 [WRN] Error updating doc "doc3": Cancel update -- db.(*Database).UpdateAllDocChannels() at database.go:971
2018-09-03T14:59:44.440+01:00 [INF] Finished re-running sync function; 0/3 docs changed
2018-09-03T14:59:44.440+01:00 [INF] HTTP+: #005:     --> 200   (33.0 ms)

@bbrks bbrks added this to the Iridium milestone Sep 3, 2018

@bbrks bbrks added the ffc label Sep 3, 2018

@bbrks bbrks self-assigned this Sep 3, 2018

@pasin pasin added in progress and removed ready labels Sep 6, 2018

@bbrks bbrks added the review label Sep 6, 2018

adamcfraser added a commit that referenced this issue Sep 10, 2018

#3724 Fix resync with xattrs warnings (#3730)
* Drop verbose 'Re-syncing document' log level from Info to Debug

* Return couchbase.UpdateCancel when there's nothing to do in resync w/ xattrs

* Remove couchbase.UpdateCancel and use new base.ErrUpdateCancel instead

* Make SGError simpler by removing sgErrorCodes

bbrks added a commit that referenced this issue Sep 19, 2018

2.1.1 Backport #3724 Fix resync with xattrs warnings (#3730)
* Drop verbose 'Re-syncing document' log level from Info to Debug

* Return couchbase.UpdateCancel when there's nothing to do in resync w/ xattrs

* Remove couchbase.UpdateCancel and use new base.ErrUpdateCancel instead

* Make SGError simpler by removing sgErrorCodes

bbrks added a commit that referenced this issue Sep 20, 2018

2.1.1 Backport #3724 Fix resync with xattrs warnings (#3730)
* Drop verbose 'Re-syncing document' log level from Info to Debug

* Return couchbase.UpdateCancel when there's nothing to do in resync w/ xattrs

* Remove couchbase.UpdateCancel and use new base.ErrUpdateCancel instead

* Make SGError simpler by removing sgErrorCodes

bbrks added a commit that referenced this issue Sep 25, 2018

2.1.1 Backport #3724 Fix resync with xattrs warnings (#3730)
* Drop verbose 'Re-syncing document' log level from Info to Debug

* Return couchbase.UpdateCancel when there's nothing to do in resync w/ xattrs

* Remove couchbase.UpdateCancel and use new base.ErrUpdateCancel instead

* Make SGError simpler by removing sgErrorCodes

adamcfraser added a commit that referenced this issue Sep 28, 2018

2.1.1 Backport #3724 Fix resync with xattrs warnings (#3730) (#3753)
* Drop verbose 'Re-syncing document' log level from Info to Debug

* Return couchbase.UpdateCancel when there's nothing to do in resync w/ xattrs

* Remove couchbase.UpdateCancel and use new base.ErrUpdateCancel instead

* Make SGError simpler by removing sgErrorCodes

@djpongh djpongh modified the milestones: Iridium, 2.1.1 Oct 2, 2018

@djpongh djpongh added the bug label Oct 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment