[BP 7.1.4] - XDCR panic when filtering

Description

This happen when

  1. Filter uses document key such as META().id = "docName"

  2. The document being filtered has uncommitted transaction XATTRs

In line https://github.com/couchbase/goxdcr/blob/9c6fce2e565f87fdb7abd6503c32f2a40593d928/base/filter/filterUtils.go#L90

Filter overwrites the previous body with a smaller one, the endBodyPos was kept at the old value, causing panic at https://github.com/couchbase/goxdcr/blob/9c6fce2e565f87fdb7abd6503c32f2a40593d928/base/filter/filterUtils.go#L117 

Components

Fix versions

Labels

Environment

None

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

None

Release Notes Description

None

is a backport of

Activity

Show:

Ayush Nayyar February 22, 2023 at 7:19 AM

Reproduced on 2 clusters of 7.1.2-3460, with 3 nodes in each cluster, bucket replicas set to 2 and minimum durability level set to majority. The replication with filter like META().id != “KU” works fine without any uncommitted transactions. As soon as uncommitted transactions are introduced, I see a panic: “goxdcr.log:panic: runtime error: slice bounds out of range [:70] with capacity 50”.

Validated the fix in 7.1.4-3553 clusters, replication carries out normally without any panic, even when uncommitted transactions are done.

Ritam Sharma February 13, 2023 at 3:13 PM

Ashok - Can you please help with validation.

CB robot January 11, 2023 at 4:59 AM

Build couchbase-server-7.2.0-5073 contains goxdcr commit 0ab326c with commit message:
: Fix panic in filter

CB robot January 11, 2023 at 4:40 AM

Build couchbase-server-7.1.4-3553 contains goxdcr commit 0ab326c with commit message:
: Fix panic in filter

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

Details

Assignee

Reporter

Is this a Regression?

Unknown

Triage

Untriaged

Story Points

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created January 7, 2023 at 7:15 PM
Updated February 22, 2023 at 7:19 AM
Resolved January 11, 2023 at 1:22 AM
Instabug