mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 18:02:31 +08:00
Clean up RocksDB error logging
This commit is contained in:
parent
80d6debe14
commit
9dccb0131e
@ -206,7 +206,8 @@ ACTOR Future<Void> rocksDBMetricLogger(std::shared_ptr<rocksdb::Statistics> stat
|
||||
}
|
||||
|
||||
void logRocksDBError(const rocksdb::Status& status, const std::string& method) {
|
||||
TraceEvent e(SevError, "RocksDBError");
|
||||
auto level = status.IsTimedOut() ? SevWarn : SevError;
|
||||
TraceEvent e(level, "RocksDBError");
|
||||
e.detail("Error", status.ToString()).detail("Method", method).detail("RocksDBSeverity", status.severity());
|
||||
if (status.IsIOError()) {
|
||||
e.detail("SubCode", status.subcode());
|
||||
@ -414,7 +415,7 @@ struct RocksDBKeyValueStore : IKeyValueStore {
|
||||
} else if (s.IsNotFound()) {
|
||||
a.result.send(Optional<Value>());
|
||||
} else {
|
||||
TraceEvent(SevError, "RocksDBError").detail("Error", s.ToString()).detail("Method", "ReadValue");
|
||||
logRocksDBError(s, "ReadValue");
|
||||
a.result.sendError(statusToError(s));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user