Skip to content

Commit 00a0fa0

Browse files
yoshinorimGunnar Kudrjavets
authored andcommitted
Better error logging on RocksDB write error
Summary: On I/O error, error strings can be fetched by rocksdb::String.ToString().c_str(), though errno is lost. This diff adds messages on I/O error. This diff also updates RocksDB revision to the latest, and fixed a compiler error. @update-submodule: rocksdb Test Plan: Simulated disk error then got below message and crashed. 2015-09-10 11:49:33 3218281 [ERROR] RocksDB: Failed to write to WAL - status 5, IO error: ./.rocksdb/000038.log: No space left on device 2015-09-10 11:49:33 3218281 [ERROR] RocksDB: Aborting on WAL write error. Reviewers: spetrunia, hermanlee4, maykov Reviewed By: maykov Differential Revision: https://reviews.facebook.net/D46599
1 parent 2b132d3 commit 00a0fa0

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

storage/rocksdb/ha_rocksdb.cc

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6259,16 +6259,17 @@ void rocksdb_handle_io_error(rocksdb::Status status, enum io_error_type type)
62596259
case ROCKSDB_IO_ERROR_TRX_COMMIT:
62606260
case ROCKSDB_IO_ERROR_DICT_COMMIT:
62616261
{
6262-
sql_print_error("RocksDB: Failed to write to WAL - status %d",
6263-
status.code());
6262+
sql_print_error("RocksDB: Failed to write to WAL - status %d, %s",
6263+
status.code(), status.ToString().c_str());
62646264
sql_print_error("RocksDB: Aborting on WAL write error.");
62656265
abort_with_stack_traces();
62666266
break;
62676267
}
62686268
case ROCKSDB_IO_ERROR_BG_THREAD:
62696269
{
62706270
sql_print_warning("RocksDB: BG Thread failed to write to RocksDB "
6271-
"- status %d", status.code());
6271+
"- status %d, %s", status.code(),
6272+
status.ToString().c_str());
62726273
break;
62736274
}
62746275
default:
@@ -6278,8 +6279,8 @@ void rocksdb_handle_io_error(rocksdb::Status status, enum io_error_type type)
62786279
}
62796280
else if (status.IsCorruption())
62806281
{
6281-
sql_print_error("RocksDB: Data Corruption detected! %d",
6282-
status.code());
6282+
sql_print_error("RocksDB: Data Corruption detected! %d, %s",
6283+
status.code(), status.ToString().c_str());
62836284
sql_print_error("RocksDB: Aborting because of data corruption.");
62846285
abort_with_stack_traces();
62856286
}
@@ -6288,15 +6289,17 @@ void rocksdb_handle_io_error(rocksdb::Status status, enum io_error_type type)
62886289
switch (type) {
62896290
case ROCKSDB_IO_ERROR_DICT_COMMIT:
62906291
{
6291-
sql_print_error("RocksDB: Failed to write to WAL (dictionary) - status %d",
6292-
status.code());
6292+
sql_print_error("RocksDB: Failed to write to WAL (dictionary) - "
6293+
"status %d, %s",
6294+
status.code(), status.ToString().c_str());
62936295
sql_print_error("RocksDB: Aborting on WAL write error.");
62946296
abort_with_stack_traces();
62956297
break;
62966298
}
62976299
default:
62986300
sql_print_warning("RocksDB: Failed to write to RocksDB "
6299-
"- status %d", status.code());
6301+
"- status %d, %s", status.code(),
6302+
status.ToString().c_str());
63006303
break;
63016304
}
63026305
}

storage/rocksdb/rdb_i_s.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ static int i_s_rocksdb_cfoptions_fill_table(THD *thd,
454454
case rocksdb::kBZip2Compression: val.append("kBZip2Compression:"); break;
455455
case rocksdb::kLZ4Compression: val.append("kLZ4Compression:"); break;
456456
case rocksdb::kLZ4HCCompression: val.append("kLZ4HCCompression:"); break;
457+
case rocksdb::kZSTDNotFinalCompression: val.append("kZSTDNotFinalCompression"); break;
457458
}
458459
}
459460
val.pop_back();

0 commit comments

Comments
 (0)