[3.1.6 Backport] Tweak logging around import of JSON but not JSON object docs

Description

CB Server document data types are determined based on whether the body is valid JSON. This includes non-object JSON types, like arrays, strings, numbers.

Documents that CB Server determined was not a binary data type, but are also not a JSON object (e.g. arrays, numbers, strings) are handled differently by SG import than just binary documents.

 

https://couchbasecloud.atlassian.net/browse/CBG-3332#icft=CBG-3332 made SG warn when encountering a JSON data type document that is not a JSON object appear over DCP, even if there is no pre-existing _sync metadata present with a misleading log message.

  • For true binary (non-JSON) docs (MemcachedDataTypeRaw):

    • Nothing required. Existing info loging covers.

  • For JSON but not JSON object docs:

    • If no existing _sync data present:

  •  

    •  

      • Similar info log to describe why we're not importing this document.

      • It's valid that customers have counter documents, etc. that they don't ever want importing by SG.

    • If there is _sync data present:

  •  

    •  

      • Detect this case and continue to warn.

      • Implies the document should be mobile-aware but can no longer be (because of the body being changed to something other than a JSON object)

      • Sync metadata should be removed from the document if it is no longer needed for CB Mobile.

Activity

Show:

CB robot May 2, 2024 at 10:01 AM

Build sync_gateway-3.1.6-5 contains sync_gateway commit 301297c with commit message:
[3.1.6 backport] https://couchbasecloud.atlassian.net/browse/CBG-3876#icft=CBG-3876 suppress warning for non json objects (#6795)

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Components

Sprint

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created April 3, 2024 at 2:58 PM
Updated February 25, 2025 at 7:02 PM
Resolved May 2, 2024 at 9:37 AM
Instabug