Inconsistent revision ID leading to cbbackup fail?

31 views
Skip to first unread message

Chris Fuentes

unread,
Feb 24, 2015, 4:04:05 AM2/24/15
to mobile-c...@googlegroups.com
So our staging cluster started going a bit nuts today - began constantly reindexing (blocking other operations. cbcollect_info revealed some map errors but no reduce errors), then when that was resolved (by deleting the views being indexed), it refused to complete a cbbackup.

I was able to determine that the cbbackup tool seemed to be getting stuck consistently after one particular document which, upon closer examination, had an inconsistent revision id. The rev in the doc was at 7 but the rev in the CouchbaseConsole's View editor  meta data panel (right hand side) was higher than 500. I found several more docs with such inconsistencies, ranging from a single digit differences to inconsistencies of several thousand.

I tried deleting the offending documents (first via sync gateway delete request followed by python couchbase client for permanent deletion) but upon re-adding the docs I discovered that the meta data panel still somehow saved the old (inconsistent) values for rev_id, despite the docs all being on rev 1 now. 

After flushing the bucket and restoring to an older copy of the db, we were able to perform cbbackup again but the inconsistent revs remained. Not sure if related. 

Two questions:

1. Why are the revs inconsistent/is this a problem?
2. If it is a problem, is there a way to force consistency?

Jens Alfke

unread,
Feb 24, 2015, 11:57:01 AM2/24/15
to mobile-c...@googlegroups.com

On Feb 24, 2015, at 1:04 AM, Chris Fuentes <ch...@crowdcomfort.com> wrote:

I was able to determine that the cbbackup tool seemed to be getting stuck consistently after one particular document which, upon closer examination, had an inconsistent revision id.

Are you talking about the Sync Gateway revision ID, i.e. one stored in the doc’s _sync property?
If so, this shouldn’t have anything to do with the behavior of the Couchbase cluster itself or the cbbackup tool. As far as Couchbase Server is concerned, the contents of documents are just application data that it doesn’t interpret. Sync Gateway just happens to be a specific application.

It sounds like something’s wrong with the server itself, so your best bet is to ask on the Couchbase Server forums.

—Jens

Chris Fuentes

unread,
Feb 24, 2015, 11:59:04 AM2/24/15
to mobile-c...@googlegroups.com
If that's the case, then what is the 'rev' field in the Couchbase Console's view editor meta data panel? Is that something CBServer internal and not related to the _sync.rev field?

Jens Alfke

unread,
Feb 24, 2015, 12:08:35 PM2/24/15
to mobile-c...@googlegroups.com

On Feb 24, 2015, at 8:59 AM, Chris Fuentes <ch...@crowdcomfort.com> wrote:

If that's the case, then what is the 'rev' field in the Couchbase Console's view editor meta data panel? Is that something CBServer internal and not related to the _sync.rev field?

I’m not certain, but I think that’s the internal counter used for CAS (compare-and-set) updates in the Couchbase Server API. It’s completely unrelated to the Sync Gateway / Couchbase Lite document revision ID (which is anyway a string, not an integer.)

—Jens
Reply all
Reply to author
Forward
0 new messages