Couchbase Sync Gateway Reset

68 views
Skip to first unread message

Jean Regisser

unread,
Apr 1, 2015, 1:22:31 PM4/1/15
to mobile-c...@googlegroups.com
Hi,

I'm trying to see if there's a way to detect that the Sync Gateway shadow bucket was reinitialized and hence delete the local DB to get rid of the documents that were replicated before the reset.
I was looking at the source code of the CBL_Replicator and saw the "lastSequence mismatch:" log statement, but didn't really find a public way to get to that information (would prefer avoiding swizzling ^^).
I know it might not be a "standard" use case, but still, if something goes horribly wrong and we have to that on the Sync Gateway, I would like our clients to recover from it.

So is what I'm asking possible?
How else would you handle this situation?

Note that we're only doing pull replication and never pushing any data from the clients.

Thanks for your help!

Jens Alfke

unread,
Apr 1, 2015, 1:39:29 PM4/1/15
to mobile-c...@googlegroups.com

On Apr 1, 2015, at 10:22 AM, Jean Regisser <jean.r...@gmail.com> wrote:

I'm trying to see if there's a way to detect that the Sync Gateway shadow bucket was reinitialized and hence delete the local DB to get rid of the documents that were replicated before the reset.

By ‘shadow bucket’ do you mean the application bucket, the one that’s directly accessible to your app server using Couchbase Server SDKs? And how are you erasing it?

I don’t believe SG detects that the app bucket has been erased, so it has no effect on the database SG manages, and you wouldn’t be able to tell from your client.

—Jens
Reply all
Reply to author
Forward
0 new messages