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 2020/03/21 03:26:40 UTC

[GitHub] [couchdb] nickva opened a new pull request #2691: Fix database re-creation

nickva opened a new pull request #2691: Fix database re-creation
URL: https://github.com/apache/couchdb/pull/2691
 
 
   Previously it was possible for a database to be re-created while a `Db` handle was open and the `Db` handle would continue operating on the new db without any error.
   
   To avoid that situation ensure instance UUID is explicitly checked during open and reopen calls. This includes checking it after the metadata is loaded in `fabric2_fdb:open/2` and when fetching the handle from the cache.
   
   Also, create a `{uuid, UUID}` option to allow specifying a particular instance UUID when opening a database. If that instance doesn't exist raise a `database_does_not_exist` error.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] davisp commented on issue #2691: Fix database re-creation

Posted by GitBox <gi...@apache.org>.
davisp commented on issue #2691: Fix database re-creation
URL: https://github.com/apache/couchdb/pull/2691#issuecomment-602117388
 
 
   Cool. The tests here were good and it just occurred to me to ask about the other place.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] nickva commented on issue #2691: Fix database re-creation

Posted by GitBox <gi...@apache.org>.
nickva commented on issue #2691: Fix database re-creation
URL: https://github.com/apache/couchdb/pull/2691#issuecomment-602109855
 
 
   We have something similar in https://github.com/apache/couchdb/blob/prototype/fdb-layer/src/fabric/src/fabric2_fdb.erl#L1674 but it does an extra metadata check and if it is stale, reads the UUID from config section. Here we already have the UUID cached in the handle after reopen happens. I did think about reusing it but it was different enough that it didn't seem worth it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] nickva commented on issue #2691: Fix database re-creation

Posted by GitBox <gi...@apache.org>.
nickva commented on issue #2691: Fix database re-creation
URL: https://github.com/apache/couchdb/pull/2691#issuecomment-602121128
 
 
   Yap, definitely good idea. Made a PR for the test https://github.com/apache/couchdb/pull/2696
   
   As a bonus I had noticed two more issues:
   
    - I had forgotten to unload the mocked erlfdb module and since it was in the same test file I added that in there as well
   
    - This PR also had broken couch_jobs. Since there is some re-use of fabric2_db function with couch_jobs "jtx" contexts, I had switching a head matching function to accept jtx objects now but they don't have a name so was seeing test failures. https://github.com/apache/couchdb/blob/prototype/fdb-layer/src/fabric/src/fabric2_fdb.erl#L293. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] nickva merged pull request #2691: Fix database re-creation

Posted by GitBox <gi...@apache.org>.
nickva merged pull request #2691: Fix database re-creation
URL: https://github.com/apache/couchdb/pull/2691
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] nickva commented on issue #2691: Fix database re-creation

Posted by GitBox <gi...@apache.org>.
nickva commented on issue #2691: Fix database re-creation
URL: https://github.com/apache/couchdb/pull/2691#issuecomment-602125374
 
 
   Made a PR to fix dumb mistake and breaking couch_jobs https://github.com/apache/couchdb/pull/2697

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] davisp commented on issue #2691: Fix database re-creation

Posted by GitBox <gi...@apache.org>.
davisp commented on issue #2691: Fix database re-creation
URL: https://github.com/apache/couchdb/pull/2691#issuecomment-602110084
 
 
   I just meant to make sure we test it. Wasn't sure if it was already tested and/or belonged in those tests.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] nickva commented on issue #2691: Fix database re-creation

Posted by GitBox <gi...@apache.org>.
nickva commented on issue #2691: Fix database re-creation
URL: https://github.com/apache/couchdb/pull/2691#issuecomment-602112987
 
 
   Oh good point. I don't think we test that. I will write a few tests for it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services