You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/06/04 16:03:03 UTC

[GitHub] [incubator-kvrocks] git-hulk commented on a diff in pull request #620: Fix don't swallow the error when creating column families failed

git-hulk commented on code in PR #620:
URL: https://github.com/apache/incubator-kvrocks/pull/620#discussion_r889581045


##########
src/storage.cc:
##########
@@ -209,9 +210,16 @@ Status Storage::CreateColumnFamilies(const rocksdb::Options &options) {
     tmp_db->Close();
     delete tmp_db;
   }
-  // Open db would be failed if the column families have already exists,

Review Comment:
   > Is it possible we check exact that it failed because of "already exists" instead of "NOT column families not opened"? I'm afraid there is still some edge case we miss.
   
   Yes, it's a bit tricky and confuse, but we can't change the status message AFAIK since it returned by the RocksDB.
   
   For the second suggestion, We do prefer C++ idiom. my initial intention was to ignore the case when comparing the prefix. But seems this's unnecessary since it can't protect anything if the status message is modified, I will change to `rfind` to simplify the expression. 



-- 
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: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org