You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[3.1.6 backport] CBG-3876 suppress warning for non json objects (#6795)
* [CBG-3876] suppress warning for non json objects
backport of CBG-3835 catch error in case there is a valid json but not a JSON object (#6756)
* Remove logging for invalid JSON in sync attribute
log in the case where there is _sync xattr but the body has become non
json
* Update log messages
* Update db/import_listener.go
Co-authored-by: Adam Fraser <adam.fraser@couchbase.com>
---------
Co-authored-by: Adam Fraser <adam.fraser@couchbase.com>
* Change test to work without multi-xattr write APIs
---------
Co-authored-by: Adam Fraser <adam.fraser@couchbase.com>
// docs named so they will both be on vBucket 1 in both 64 and 1024 vbuckets
568
+
const (
569
+
doc1="bookstand"
570
+
doc2="chipchop"
571
+
)
572
+
// write a document with inline sync metadata that not unmarshalable into SyncData. This document will be ignored and logged at debug level.
573
+
// [DBG] .. col:sg_test_0 <ud>bookstand</ud> not able to be imported. Error: Could not unmarshal _sync out of document body: json: cannot unmarshal number into Go struct field documentRoot._sync of type db.SyncData
// docs named so they will both be on vBucket 1 in both 64 and 1024 vbuckets
598
+
const (
599
+
doc1="bookstand"
600
+
doc2="chipchop"
601
+
602
+
exp=0
603
+
)
604
+
605
+
// perform doc writes in two parts (Add + WriteUserXattr) since WriteWithXattr does cas expansion on _sync, to write the document and the unexpanded xattr
606
+
607
+
// this document will be ignored for input with debug logging as follows:
608
+
// [DBG] .. col:sg_test_0 <ud>bookstand</ud> not able to be imported. Error: Found _sync xattr ("1"), but could not unmarshal: json: cannot unmarshal number into Go value of type db.SyncData
// docs named so they will both be on vBucket 1 in both 64 and 1024 vbuckets
643
+
const (
644
+
doc1="bookstand"
645
+
doc2="chipchop"
646
+
)
647
+
648
+
// logs because a JSON number is not a JSON object
649
+
// [DBG] .. col:sg_test_0 <ud>bookstand</ud> not able to be imported. Error: Could not unmarshal _sync out of document body: json: cannot unmarshal number into Go value of type db.documentRoot
0 commit comments