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
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 3.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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          ben.brooks Ben Brooks created issue -
          ben.brooks Ben Brooks made changes -
          Field Original Value New Value
          Description The change in [PR #4457|https://github.com/couchbase/sync_gateway/pull/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.

          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.
          The change in [PR #4457|https://github.com/couchbase/sync_gateway/pull/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.

          {code}
          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
          {code}

          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.
          ben.brooks Ben Brooks made changes -
          Fix Version/s Lithium [ 16180 ]
          adamf Adam Fraser made changes -
          Assignee The One [ the one ] Ben Brooks [ ben.brooks ]
          adamf Adam Fraser made changes -
          Sprint CBG Sprint 71 [ 1545 ]
          adamf Adam Fraser made changes -
          Rank Ranked higher
          ben.brooks Ben Brooks made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          ben.brooks Ben Brooks made changes -
          Status In Progress [ 3 ] In Review [ 10107 ]
          Automated transition triggered when Adam Fraser merged pull request #4980 in GitHub -
          Resolution Fixed [ 1 ]
          Status In Review [ 10107 ] Resolved [ 5 ]
          ben.brooks Ben Brooks made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

          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:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty