You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/09/27 19:37:46 UTC

[GitHub] iilyak opened a new pull request #1629: 84736 handle db deletion in load validation funs

iilyak opened a new pull request #1629: 84736 handle db deletion in load validation funs
URL: https://github.com/apache/couchdb/pull/1629
 
 
   ## Overview
   
   Handle db deletion in couch_db:load_validation_funs
   
   Previously there were few problems with load_validation_funs
   in the case when clustered database is deleted.
   
   - the calls to load_validation_funs were failing with `internal_server` error [1]
   - the deleted database stayed opened because:
     - the caller of the load_validation_funs (update_doc) stayed alive
     - the main_pid of the deleted database wasn't killed either
   - there was an infinite loop in ddoc_cache_entry trying to recover ddoc from deleted database
   
   The solution is:
   - do not call `recover` for deleted database
   - close `main_pid`
   - use `erlang:error` to crash the caller
   
   [1] - The stack trace was:
   ```
   {database_does_not_exist,[
       {mem3_shards,load_shards_from_db,"bailey/meta",[
           {file,"src/mem3_shards.erl"},{line,394}]},
       {mem3_shards,load_shards_from_disk,1,[
           {file,"src/mem3_shards.erl"},{line,369}]},
       {mem3_shards,for_db,2,[
           {file,"src/mem3_shards.erl"},{line,54}]},
       {fabric_view_all_docs,go,5,[
           {file,"src/fabric_view_all_docs.erl"},{line,24}]},
       {ddoc_cache_entry_validation_funs,recover,1,[
           {file,"src/ddoc_cache_entry_validation_funs.erl"},{line,33}]},
       {ddoc_cache_entry,do_open,1,[
           {file,"src/ddoc_cache_entry.erl"},{line,294}]}]}
   ```
   
   ## Testing recommendations
   
   ```
   make eunit apps=couch tests=clustered_db_test
   make eunit apps=ddoc_cache
   ```
   
   ## Related Issues or Pull Requests
   
   N/A
   
   ## Checklist
   
   - [x] Code is written and works correctly;
   - [x] Changes are covered by tests;
   - [ ] Documentation reflects the changes;
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services