Fix initialization order of DBOptions and kHostnameForDbHostId (#7702)

Summary:
Fix initialization order of DBOptions and kHostnameForDbHostId by making the initialization of the latter static rather than dynamic.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7702

Reviewed By: ajkr

Differential Revision: D25111633

Pulled By: anand1976

fbshipit-source-id: 7afad834a66e40bcd8694a43b40d378695212224
This commit is contained in:
anand76 2020-11-19 22:37:55 -08:00 committed by Facebook GitHub Bot
parent 5c585e1908
commit 7c19d43883
2 changed files with 2 additions and 1 deletions

View File

@ -349,7 +349,7 @@ struct DbPath {
DbPath(const std::string& p, uint64_t t) : path(p), target_size(t) {}
};
static const std::string kHostnameForDbHostId = "__hostname__";
extern const char* kHostnameForDbHostId;
struct DBOptions {
// The function recovers options to the option as in version 4.6.

View File

@ -41,6 +41,7 @@ extern const uint64_t kPlainTableMagicNumber;
const uint64_t kLegacyPlainTableMagicNumber = 0;
const uint64_t kPlainTableMagicNumber = 0;
#endif
const char* kHostnameForDbHostId = "__hostname__";
bool ShouldReportDetailedTime(Env* env, Statistics* stats) {
return env != nullptr && stats != nullptr &&