diff --git a/HISTORY.md b/HISTORY.md index 5de41a20b64917f2ed7170d088247aeac5067b01..cb22836641614049baa3ffc2210ce77c8cbd7a16 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -15,6 +15,7 @@ ### Bug Fixes * Fix a bug in which backup/checkpoint can include a WAL deleted by RocksDB. * Fix a bug where concurrent compactions might cause unnecessary further write stalling. In some cases, this might cause write rate to drop to minimum. +* Fix a bug in Logger where if dbname and db_log_dir are on different filesystems, dbname creation would fail wrt to db_log_dir path returning an error and fails to open the DB. ## Behavior Change * In leveled compaction with dynamic levelling, level multiplier is not anymore adjusted due to oversized L0. Instead, compaction score is adjusted by increasing size level target by adding incoming bytes from upper levels. This would deprioritize compactions from upper levels if more data from L0 is coming. This is to fix some unnecessary full stalling due to drastic change of level targets, while not wasting write bandwidth for compaction while writes are overloaded. diff --git a/logging/auto_roll_logger.cc b/logging/auto_roll_logger.cc index cfc8d43713d1c552d3a2552934c07af882788665..a362b6f238b9fc2ecac024925a4b974763ae7041 100644 --- a/logging/auto_roll_logger.cc +++ b/logging/auto_roll_logger.cc @@ -278,11 +278,21 @@ Status CreateLoggerFromOptions(const std::string& dbname, InfoLogFileName(dbname, db_absolute_path, options.db_log_dir); const auto& clock = env->GetSystemClock(); - // In case it does not exist + // In case it does not exist. s = env->CreateDirIfMissing(dbname); if (!s.ok()) { - return s; + if (options.db_log_dir.empty()) { + return s; + } else { + // Ignore the error returned during creation of dbname because dbname and + // db_log_dir can be on different filesystems in which case dbname will + // not exist and error should be ignored. db_log_dir creation will handle + // the error in case there is any error in the creation of dbname on same + // filesystem. + s = Status::OK(); + } } + assert(s.ok()); if (!options.db_log_dir.empty()) { s = env->CreateDirIfMissing(options.db_log_dir);