Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-1376

Some Delta Sync errors logged at WARN level should be DEBUG

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0
    • 2.8.0
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 71
    • 2

    Description

      The change in PR #4457 was intended to log warnings returned to us from go-fleecedelta, and everything else at debug level - but this isn't working as intended due to a quirk in the way error type alises are handled in Go.

      Probably need to switch to use an errors.Is/errors.As approach anyway here, so might as well do that as part of the fix.

      2021-03-23T18:33:54.522+01:00 [WRN] c:[6c35922d] Falling back to full body replication. Error generating delta from 1-2099d14c041c7d59ce8f8614efd1638e to 2-3bf4a1932c64ca4202e66d7b7e064628 for key Art::LV0000023031 - err: 404 missing -- db.(*BlipSyncContext).sendRevAsDelta() at blip_handler.go:556
      2021-03-23T18:33:54.523+01:00 [WRN] c:[6c35922d] Falling back to full body replication. Error generating delta from 1-4862b323aa1ac8247a72ab2f75fe565f to 2-08e119b583d1e032f225946a03fbf139 for key Art::LV0000037529 - err: 404 missing -- db.(*BlipSyncContext).sendRevAsDelta() at blip_handler.go:556
      

      This can be seen this Go playground example:
      https://play.golang.org/p/NRul8FTrQsP

      Where err1 is untyped, err2 is trying to be typed with an error type alias but failing, and err3 is a correct implementation of a typed error.

      Attachments

        Activity

          People

            ben.brooks Ben Brooks
            ben.brooks Ben Brooks
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty