[BP 7.1.5] - XDCR is unable to check for transactional xattr when doc itself is JSON array

Description

XDCR added internal transactional filter in , and it cannot be turned off.

It is possible that a customer has a document with Xattribute, which will trigger XDCR to check for transaction xattr.
However, it is also possible that the customer's documents are pure arrays. This will cause an error like to happen.

This is reproducible via unit test:

$ go test -run=TestTransactionFilterWithPureArray
============== Test case start: TestTransactionFilterWithPureArray =================
NEIL DEBUG err Invalid input given errDesc XDCR for key <ud>TestDocArrayKey</ud> after decompression seems to be an invalid JSON
============== Test case end: TestTransactionFilterWithPureArray =================
PASS

The right fix is to be able to check just purely for the xattr section for transaction xattribute, but not stop the user document from being parsed.

 

Issue

Resolution

XDCR did not process documents with a JSON array and Extended Attributes (XATTRs). When a document contained XATTRs, XDCR checked for XATTRs in transactions, transaction filters were enabled, and XATTRs were not checked.

When documents contain arrays, XATTRs are now checked in the transaction XATTRs, and the document is not prevented from being parsed in an array.

Components

Fix versions

Labels

Environment

None

Link to Log File, atop/blg, CBCollectInfo, Core dump

None

Release Notes Description

None

Activity

Show:

Ayush Nayyar June 26, 2023 at 6:02 PM
Edited

Reproduced on 7.1.3, documents with xattribute which are pure arrays are not replicated: 

Verified on 7.1.5-3848. Documents with xattribute, which are pure arrays are being replicated.

CB robot June 5, 2023 at 1:18 AM

Build couchbase-server-7.1.5-3830 contains goxdcr commit 2c8ac41 with commit message:
: invalid JSON check for filter should include array

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

Details

Assignee

Reporter

Is this a Regression?

No

Triage

Untriaged

Issue Impact

external

Story Points

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created May 2, 2023 at 6:31 PM
Updated March 21, 2025 at 2:51 AM
Resolved June 6, 2023 at 5:40 PM
Instabug