Are views in BigCouch part of the shards?

97 views
Skip to first unread message

Matthew Woodward

unread,
Nov 2, 2012, 9:12:58 PM11/2/12
to bigcou...@googlegroups.com
The reason I ask is because after seeing some document count discrepancies that I've mentioned before I wound up copying shards from one server to the others who had the incorrect shards. I now see consistent doc counts and update sequences across all the servers and have for a week now, but I can pull up specific views in Futon side-by-side between two servers and see differences between them.

Is it easier to maybe replicate the database to a single instance of CouchDB, delete the database from BigCouch, and then replicate back? I just feel like I'm chasing my tail here so if starting over would help get me out of any lingering issues I don't mind doing that so long as I can do it safely. (And of course I'll back up all the shards before I do anything.)

Thanks.

--
Matthew Woodward
ma...@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

Matthew Woodward

unread,
Nov 2, 2012, 9:22:15 PM11/2/12
to bigcou...@googlegroups.com
On Fri, Nov 2, 2012 at 6:12 PM, Matthew Woodward <ma...@mattwoodward.com> wrote:
I now see consistent doc counts and update sequences across all the servers and have for a week now, but I can pull up specific views in Futon side-by-side between two servers and see differences between them.

The really odd thing is in the test case I'm looking into right now, if I call the view with ?include_docs=true the missing document shows up, but if I remove include_docs it doesn't appear.

Is there some way to just force a regeneration of the views?

Thanks.

Matthew Woodward

unread,
Nov 2, 2012, 9:24:06 PM11/2/12
to bigcou...@googlegroups.com
On Fri, Nov 2, 2012 at 6:22 PM, Matthew Woodward <ma...@mattwoodward.com> wrote:
The really odd thing is in the test case I'm looking into right now, if I call the view with ?include_docs=true the missing document shows up, but if I remove include_docs it doesn't appear.

Sorry for the barrage of emails -- I take that back. That was apparently an anomaly. It's simply showing different data on each call to the view so sometimes I see the missing document included in the view and sometimes I don't regardless of whether or not I have include_docs=true in the URL.

Paul Davis

unread,
Nov 5, 2012, 9:19:05 AM11/5/12
to bigcou...@googlegroups.com
Generally speaking if you copy db files around you'll want to either regenerate views from scratch or copy the corresponding view files before copying the .couch files. IOW, to answer your question, yes, if you copy one .couch file to another machine that had built views already you are most likely going to have a view built in a bad state that it won't recover from on its own.

The easiest way to fix this is to just re-save the design doc with a whitespace change to trigger a view rebuild.

Matthew Woodward

unread,
Nov 5, 2012, 10:48:34 AM11/5/12
to bigcou...@googlegroups.com
On Mon, Nov 5, 2012 at 6:19 AM, Paul Davis <paul.jos...@gmail.com> wrote:
Generally speaking if you copy db files around you'll want to either regenerate views from scratch or copy the corresponding view files before copying the .couch files. IOW, to answer your question, yes, if you copy one .couch file to another machine that had built views already you are most likely going to have a view built in a bad state that it won't recover from on its own.

The easiest way to fix this is to just re-save the design doc with a whitespace change to trigger a view rebuild.

Excellent -- I'll try that. Thanks so much again for all the tips.

Reply all
Reply to author
Forward
0 new messages