Documents deleted from Couchbase bucket getting added again in couchbase bucket

I am deleting documents from Couchbase server bucket using ‘delete’ query.
I found that the some of the deleted documents are getting added in the bucket after some time (in a day or so).

I am using Couchbase along with Sync_gateway, and populating records in Couchbase bucket through Sync_gateway.

Is it the case that the documents from Sync_gateway cache are getting populated in couchbase bucket after some time interval.
If that is the case how to stop these records from getting populated again from SG to CB bucket ?


What is the source of the documents you are deleting from?
Is CBL creating or modifying documents and the re-pushing them?

The documents are created by mobile devices and pushed in Couchbase bucket through Sync_gateway.
Once the documents are created in bucket, I am just querying them (using 'Select ’ query of N1QL) and after some days I am deleting the documents using ‘Delete’ query of N1QL.

But it is observed that few of the deleted documents are reappearing in couchbase bucket after one or two days after deletion.

How to troubleshoot this ?

Hi househippo,

Thanks for your replay.
The CBL is used to create the documents in couchbase only once, after that CBL is not modifying or re-pushing the documents.

The source of documents is mobile devices.

Which version of server/ SGW are you on ?

One of Two things is happening.

  1. CBL is updating the document after the last time it synced and you have deleted(purged) it in SG/CB.

  2. CBL creates a NEW push replication object ,maybe based on new rules on filter, and pushes data to SG/CB.
    Since its a brand new push object different it starts from zero and pushes all the documents based on the rules of the new push.

Hi househippo,

I am creating document in CB Bucket using CBL.
While creating document, we create a channel like this - channel_user_<user_id>_<todays_datetime>
e.g, channel_user_4120_23Jan18
This channel is attached to every document created and is pushed to SG/CB.
So when the document created by CBL has different channel for same user since date parameter is changing.

That’s all we are doing on push replication.
And this is the only operation we are doing. So what is the reason of this problem.