nickva opened a new pull request, #5918:
URL: https://github.com/apache/couchdb/pull/5918

   The main if to no not reset dreyfus purge_seq back to 0:
   
   Issue: https://github.com/apache/couchdb/issues/5916
   
   Previously, `dreyfus_index_updater:purge_index/3`, updated the final 
purge_seq from the last value seen in the accumulator. When there is nothing to 
purge that will be the initial accumulator purge_seq value = 0, which is wrong.
   
   For example, if the minimum purge sequence is 12 and current purge sequence 
is 42, resetting the value back to 0 would mean the users would get an 
exception like `{invalid_start_purge_seq, 0, 12}` every time they update the 
index. To the purge system this looks like the "client" (the search index) has 
missed processing some purges and is now out of sync with the main database.
   
   To fix the issue we do what nouveau does, and set the index purge sequence 
based on the current database purge sequence, instead of getting it from the 
accumulator. As a side-effect, we simplify the fold function a bit, since we 
don't have to track the purge sequence inside.
   
   As a separate commit, a minor correctness fix to make sure we don't operate 
on a closed database. Previously we we closed the db then then tried to use to 
open/write the checkpoint file.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to