Discrepancies between shadow bucket and gateway bucket

76 views
Skip to first unread message

Sandra Bazan

unread,
May 7, 2015, 2:11:46 PM5/7/15
to mobile-c...@googlegroups.com
Hello,
   We are developing an application that has two parts: a Web Side and a mobile side. Operative part is done in the mobile side and Web side is used mainly for configuration and reporting.
   We are noticing discrepancies between the data that is shown in mobile side (which is connected to couches server via sync gateway) vs web reports which read the info via N1QL from shadow bucket.
    We have some questions:
1) How can we ensure consistency between the original bucket and the shadow bucket?
2) How close is the time when N1QL will be able to read only current versions instead of retrieving all document revisions?The only reason why we are using shadow bucket is because we've been not able to make N1QL retrieve document current version only, it retrieves all document versions.

We appreciate your help,
Best regards,
Sandra

Adam Fraser

unread,
May 7, 2015, 4:26:36 PM5/7/15
to mobile-c...@googlegroups.com
Hi Sandra,

There should be consistency between the original bucket and the sync gateway bucket shadowing it - if you can share additional details about the discrepancies you're seeing, I might be able to provide more details.

For the second question - it probably depends on the specifics of your reporting requirements, but have you considered using the Sync Gateway REST API to drive your web side, as a way to more easily limit the revisions retrieved?

Thanks,
Adam

Victor Fernandez

unread,
May 12, 2015, 1:07:40 PM5/12/15
to mobile-c...@googlegroups.com
Hi Adam
We have a document that represents a restaurant table so his status field are continuosly changing between the status "locked" and "idle".
After do several test we notice that in the shadow bucket this document have a diferent status than in the sync bucket, the curious thing is that the sync bucket have always the correct status and the shadow have the wrong status.
As a result of this, the iPad devices which are doing sync replication have a correct version of the document and the web panel side which is using N1QL have a wrong version.

Adam Fraser

unread,
May 12, 2015, 1:37:12 PM5/12/15
to mobile-c...@googlegroups.com
Victor - how is the change originally being made - via Sync Gateway, or to the shadowed bucket?  (it sounds like Sync Gateway, but just confirming)

Does the status change eventually get to the shadowed bucket (i.e. it's an issue of latency in pushing the change from SG to the shadowed bucket), or are they staying permanently out of sync?


Sandra Bazan

unread,
May 12, 2015, 7:29:55 PM5/12/15
to mobile-c...@googlegroups.com
Hello Adam, yes, all status updates are done via sync gateway.
And no, they don't eventually sync, they stay permanently out of sync. This doesn't happen on all tables, nor all the times. It's an spontaneus issue.
Let's say, from 20 tables, we see one or two out of sync. 
BR
Sandra

Sandra

unread,
Jun 30, 2015, 12:18:57 PM6/30/15
to mobile-c...@googlegroups.com
Hello, we are still facing this issue and we haven´t found any way to fix it.
The documents where we see the discrepancies between bucket and it´s shadow are being updated (from the mobile app via sync gateway), frequently during the day. These documents represent tables in a restaurant and we constantly update their status (free, occupied, checking out,  etc).
At the end of the restaurant operation, all the tables are free, and this status is correctly stored in the original bucket but not being replicated to the shadow bucket, there still appear some tables in another status rather than free.
Seems like it is a issue in couchbase not being able to synchronize correctly the original bucket and its shadow bucket when a document changes frequently. 
I know that this issue seems weird, but we do see it very commonly and we would really appreciate any clue to help us fix it.
Thank you, Sandra

Jeremy Kelley

unread,
Jun 30, 2015, 12:26:04 PM6/30/15
to mobile-c...@googlegroups.com
We were having similar issues with a similar architecture.  I cron'd sync gateway to do a rolling restart throughout the day and it seems to have "fixed" the issue.  -j

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/781b663d-f22e-4bd3-99c8-91181fc698ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sandra

unread,
Jun 30, 2015, 12:43:15 PM6/30/15
to mobile-c...@googlegroups.com, jer...@33ad.org
Thank you Jeremy, Would you please share some link where we can find a procedure to do a rolling restart?
BR,
Sandra

Jeremy Kelley

unread,
Jun 30, 2015, 2:28:21 PM6/30/15
to Sandra, mobile-c...@googlegroups.com
I just mean that I have multiple syncgw's running and I restart each one on a different schedule so that when I proxy back to them via nginx, my clients always see a live gateway.

Sebastian BO

unread,
Jul 1, 2015, 12:43:29 PM7/1/15
to mobile-c...@googlegroups.com, txm...@gmail.com, jer...@33ad.org
Did the restart fix it for you Sandra?
Reply all
Reply to author
Forward
0 new messages