[ https://issues.apache.org/jira/browse/COUCHDB-640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834444#action_12834444 ]
Paul Joseph Davis commented on COUCHDB-640: ------------------------------------------- @Filipe, Looks good overall. The only change I'd make is to switch the old_db_file atom response to {error, invalid_view_sequence} too make that more specific. The {error, Reason} helps debugging if that ever gets sent to the wrong place. I would like to see an etap test for this. Its a slight behavior change so it'd be good to keep that in our list of checks. > Detect when a view is not valid for a database > ---------------------------------------------- > > Key: COUCHDB-640 > URL: https://issues.apache.org/jira/browse/COUCHDB-640 > Project: CouchDB > Issue Type: Bug > Components: JavaScript View Server > Affects Versions: 0.11 > Reporter: Paul Joseph Davis > Attachments: couchdb-640-trunk.patch > > > It was mentioned on IRC that if someone restores a database without restoring > a view then there's nothing that detects if the view is still valid. Ie, it > may reflect an update_seq that the restoration lost. > In the check for kicking off a view update we should check if there is an > incompatibility between what's been calculated in the view vs what the db > update sequence is at. The current logic will just ignore and return the > invalid view data (because of how stale=ok works which is good). > Should be an easy bug to fix if anyone's interested. The code should be > pretty contained to couch_view.erl and couch_view_group.erl -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.