Skip to content

Commit

Permalink
MB-47300: Log open() errors at caller
Browse files Browse the repository at this point in the history
Some error conditions at open() are expected and benign in some cases,
eg vbucket file-not-found at the very first start-up.

To avoid irrelevant, misleading and excessive logging in such cases,
here we remove error logging from the inner openSpecificDBFile() and
let the caller decide when it's the case to log an error.

Change-Id: I3f9d676a02172480cace860cbea6b905dbc3a39e
Reviewed-on: https://review.couchbase.org/c/kv_engine/+/166478
Reviewed-by: Trond Norbye <trond.norbye@couchbase.com>
Tested-by: Paolo Cocchi <paolo.cocchi@couchbase.com>
  • Loading branch information
paolococchi committed Dec 2, 2021
1 parent bf66aad commit 7e709d9
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 101 deletions.
Expand Up @@ -64,6 +64,14 @@ class DbHolder {
return fileRev;
}

void setFilename(std::string name) {
filename = std::move(name);
}

const std::string& getFilename() const {
return filename;
}

// Allow a non-RAII close, needed for some use-cases.
// Note non-const; when this method returns it no longer owns the
// Db.
Expand All @@ -77,4 +85,5 @@ class DbHolder {
std::reference_wrapper<const CouchKVStore> kvstore;
Db* db;
uint64_t fileRev;
std::string filename;
};

0 comments on commit 7e709d9

Please sign in to comment.