You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Robert Newson (JIRA)" <ji...@apache.org> on 2009/01/21 16:43:59 UTC

[jira] Created: (COUCHDB-218) View file is deleted at start of view rebuild

View file is deleted at start of view rebuild
---------------------------------------------

                 Key: COUCHDB-218
                 URL: https://issues.apache.org/jira/browse/COUCHDB-218
             Project: CouchDB
          Issue Type: Bug
          Components: JavaScript View Server
            Reporter: Robert Newson



When a view is altered the .view file is deleted and then recreated. Any query (with update=false) in the interim gets no results even though the results from the old view would have been adequate.

Consider switching the replacement view file in after it's been rebuilt like db compaction does.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-218) Name view files by function signature for no-downtime deployments

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Anderson updated COUCHDB-218:
-----------------------------------

    Fix Version/s: 0.10
      Description: 



When a view is altered the .view file is deleted and then recreated. Any query (with update=false) in the interim gets no results even though the results from the old view would have been adequate.

Consider switching the replacement view file in after it's been rebuilt like db compaction does.



  was:

When a view is altered the .view file is deleted and then recreated. Any query (with update=false) in the interim gets no results even though the results from the old view would have been adequate.

Consider switching the replacement view file in after it's been rebuilt like db compaction does.



       Issue Type: Improvement  (was: Bug)
          Summary: Name view files by function signature for no-downtime deployments  (was: View file is deleted at start of view rebuild)

> Name view files by function signature for no-downtime deployments
> -----------------------------------------------------------------
>
>                 Key: COUCHDB-218
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-218
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>            Reporter: Robert Newson
>             Fix For: 0.10
>
>
> When a view is altered the .view file is deleted and then recreated. Any query (with update=false) in the interim gets no results even though the results from the old view would have been adequate.
> Consider switching the replacement view file in after it's been rebuilt like db compaction does.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (COUCHDB-218) Name view files by function signature for no-downtime deployments

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Anderson reassigned COUCHDB-218:
--------------------------------------

    Assignee: Chris Anderson

> Name view files by function signature for no-downtime deployments
> -----------------------------------------------------------------
>
>                 Key: COUCHDB-218
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-218
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>            Reporter: Robert Newson
>            Assignee: Chris Anderson
>             Fix For: 0.10
>
>
> When a view is altered the .view file is deleted and then recreated. Any query (with update=false) in the interim gets no results even though the results from the old view would have been adequate.
> Consider switching the replacement view file in after it's been rebuilt like db compaction does.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-218) Name view files by function signature for no-downtime deployments

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721882#action_12721882 ] 

Chris Anderson commented on COUCHDB-218:
----------------------------------------

as long as we're in there optimizing this stuff, we should make sure that the ddoc signature is generated the same regardless of the order of the views in the JSON document. this should be just a matter of sorting before taking the signature. it will prevent us from invalidating indexes that are actually valid.

> Name view files by function signature for no-downtime deployments
> -----------------------------------------------------------------
>
>                 Key: COUCHDB-218
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-218
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>            Reporter: Robert Newson
>            Assignee: Chris Anderson
>             Fix For: 0.10
>
>
> When a view is altered the .view file is deleted and then recreated. Any query (with update=false) in the interim gets no results even though the results from the old view would have been adequate.
> Consider switching the replacement view file in after it's been rebuilt like db compaction does.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-218) Name view files by function signature for no-downtime deployments

Posted by "Freddy Bowen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721939#action_12721939 ] 

Freddy Bowen commented on COUCHDB-218:
--------------------------------------

Maybe canonical ordering of views consistent with http://github.com/jchris/canonical-json


> Name view files by function signature for no-downtime deployments
> -----------------------------------------------------------------
>
>                 Key: COUCHDB-218
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-218
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>            Reporter: Robert Newson
>            Assignee: Chris Anderson
>             Fix For: 0.10
>
>
> When a view is altered the .view file is deleted and then recreated. Any query (with update=false) in the interim gets no results even though the results from the old view would have been adequate.
> Consider switching the replacement view file in after it's been rebuilt like db compaction does.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-218) Name view files by function signature for no-downtime deployments

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719331#action_12719331 ] 

Chris Anderson commented on COUCHDB-218:
----------------------------------------

thinking about this patch, I realize the hard part will be deleting un-needed indexes. basically we'll need to periodically calculate the hashes of all ddocs in a database, and delete any index files who's names don't match any of the hashes. this could be triggered on ddoc update asynchronously.

ahh, cache invalidation...

> Name view files by function signature for no-downtime deployments
> -----------------------------------------------------------------
>
>                 Key: COUCHDB-218
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-218
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>            Reporter: Robert Newson
>            Assignee: Chris Anderson
>             Fix For: 0.10
>
>
> When a view is altered the .view file is deleted and then recreated. Any query (with update=false) in the interim gets no results even though the results from the old view would have been adequate.
> Consider switching the replacement view file in after it's been rebuilt like db compaction does.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (COUCHDB-218) Name view files by function signature for no-downtime deployments

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Anderson closed COUCHDB-218.
----------------------------------

    Resolution: Fixed

Closed in r791140

> Name view files by function signature for no-downtime deployments
> -----------------------------------------------------------------
>
>                 Key: COUCHDB-218
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-218
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>            Reporter: Robert Newson
>            Assignee: Chris Anderson
>             Fix For: 0.10
>
>
> When a view is altered the .view file is deleted and then recreated. Any query (with update=false) in the interim gets no results even though the results from the old view would have been adequate.
> Consider switching the replacement view file in after it's been rebuilt like db compaction does.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-218) View file is deleted at start of view rebuild

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679751#action_12679751 ] 

Chris Anderson commented on COUCHDB-218:
----------------------------------------

Just had an IRC conversation about this today. Putting it here (mostly for my reference).

The fix will be slightly less automatic than you mention (so we can stay transactional) but I think it will answer the use case. See transcript for details.

basically, if we name view indexes after the view signature, then you can generate them on a non-queried ddoc, and then push those same new views to the active ddoc when the index is built, and it would just start using it. should be not hard to implement.

the pattern (not implemented, requires a couch patch, is to deploy to a "staging" ddoc
[2:38pm] <jchris>
basically a ddoc that isn't used by client queries
[2:38pm] <jchris>
build the index
[2:39pm] <jchris>
and then push the new code to the production ddoc
[2:39pm] <jchris>
(with a small couch change I think we can make it flip to the new index transactionally)
[2:39pm] <jchris>
no downtime
[2:39pm] <jchris>
I'll write a jira ticket
[2:40pm] <mattetti>
that would be great, rebuilding views can be pretty slow when you have a big db
[2:40pm] <jchris>
targetting 0.10.0
[2:40pm] <mattetti>
let's get 0.9.0 out first :p
[2:40pm] <jchris>
in the mean time, version your ddoc names or something
[2:40pm] <jchris>
if you can't have downtime
[2:41pm] <mattetti>
I can have downtime right now, but I will really need conditional replication soon tho :( is that for 0.9 or 1.0? (or 0.10)
[2:41pm] <jchris>
won't make 0.9.0
[2:41pm] <jchris>
should be an easy change

> View file is deleted at start of view rebuild
> ---------------------------------------------
>
>                 Key: COUCHDB-218
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-218
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>            Reporter: Robert Newson
>
> When a view is altered the .view file is deleted and then recreated. Any query (with update=false) in the interim gets no results even though the results from the old view would have been adequate.
> Consider switching the replacement view file in after it's been rebuilt like db compaction does.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.