couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Kocoloski <kocol...@apache.org>
Subject Re: Updating views in a production system
Date Fri, 10 Jul 2009 20:29:01 GMT
On Jul 10, 2009, at 4:19 PM, Chris Anderson wrote:

> On Fri, Jul 10, 2009 at 11:47 AM, Zachary
> Zolton<zachary.zolton@gmail.com> wrote:
>> Argh... accidentally hit "send" too soon~!!
>>
>> Awesome, but since I'm still using 0.9 in production, I'll need to do
>> something else in the meantime.
>>
>> Will stale=ok queries remain performant during the re-indexing  
>> imposed
>> by pushing an updated design document?
>>
>> If that's gonna work for me, I'll probably change my deployment
>> strategy to the following:
>>  1) flip the "latency" switch on, in a admin page
>>  2) now all queries use stale=ok
>>  3) push our new design documents
>>  4) "prime" a view for each design document
>>  5) somehow know when the indexing has finished
>>  6) flip the "latency" switch off
>>  7) now queries should go to the freshly-built indexes!
>>
>> Does anyone see glaring problems with this approach?
>>
>
> You can simplify:
>
> users hitting _design/foo/_view/bar
>
> upload new ddoc to _design/fooX
>
> query view at _design/fooX/_view/bar once to trigger generation
>
> when it's done, http COPY _design/fooX to _design/foo
>
> users querying _design/foo/_view/bar should never see downtime
>
> (let me know if this works it's based on a new feature I just added)

But Zach's looking for something that works in 0.9.  And Zach, I'm  
afraid your plan won't work there.  In my experience your stale=ok  
queries will return 0 rows after you upload the new design doc.  Best,

Adam


Mime
View raw message