statistics.cc: fix mistype (#11509)

Summary:
Add new tickers: `rocksdb.error.handler.bg.error.count`, `rocksdb.error.handler.bg.io.error.count`, `rocksdb.error.handler.bg.retryable.io.error.count` to replace the misspelled ones: `rocksdb.error.handler.bg.errro.count`, `rocksdb.error.handler.bg.io.errro.count`, `rocksdb.error.handler.bg.retryable.io.errro.count` ('error' instead of 'errro'). Users should switch to use the new tickers before 9.0 release as the misspelled old tickers will be completely removed then.

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

Reviewed By: ltamasi

Differential Revision: D46542809

Pulled By: jowlyzhang

fbshipit-source-id: a2a6d8354af46a060de81d40ef6f5336a80bd32e
oxigraph-main
Ignat Loskutov 2 years ago committed by Facebook GitHub Bot
parent 05fcacdb42
commit 7c67aee4a0
  1. 13
      db/error_handler.cc
  2. 7
      include/rocksdb/statistics.h
  3. 8
      monitoring/statistics.cc
  4. 1
      unreleased_history/public_api_changes/fix_tickers_typo.md

@ -279,6 +279,7 @@ const Status& ErrorHandler::HandleKnownErrors(const Status& bg_err,
if (bg_error_stats_ != nullptr) { if (bg_error_stats_ != nullptr) {
RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_ERROR_COUNT); RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_ERROR_COUNT);
RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_ERROR_COUNT_MISSPELLED);
} }
ROCKS_LOG_INFO(db_options_.info_log, ROCKS_LOG_INFO(db_options_.info_log,
"ErrorHandler: Set regular background error\n"); "ErrorHandler: Set regular background error\n");
@ -416,7 +417,11 @@ const Status& ErrorHandler::SetBGError(const Status& bg_status,
CheckAndSetRecoveryAndBGError(bg_err); CheckAndSetRecoveryAndBGError(bg_err);
if (bg_error_stats_ != nullptr) { if (bg_error_stats_ != nullptr) {
RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_ERROR_COUNT); RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_ERROR_COUNT);
RecordTick(bg_error_stats_.get(),
ERROR_HANDLER_BG_ERROR_COUNT_MISSPELLED);
RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_IO_ERROR_COUNT); RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_IO_ERROR_COUNT);
RecordTick(bg_error_stats_.get(),
ERROR_HANDLER_BG_IO_ERROR_COUNT_MISSPELLED);
} }
ROCKS_LOG_INFO( ROCKS_LOG_INFO(
db_options_.info_log, db_options_.info_log,
@ -443,9 +448,15 @@ const Status& ErrorHandler::SetBGError(const Status& bg_status,
&auto_recovery); &auto_recovery);
if (bg_error_stats_ != nullptr) { if (bg_error_stats_ != nullptr) {
RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_ERROR_COUNT); RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_ERROR_COUNT);
RecordTick(bg_error_stats_.get(),
ERROR_HANDLER_BG_ERROR_COUNT_MISSPELLED);
RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_IO_ERROR_COUNT); RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_IO_ERROR_COUNT);
RecordTick(bg_error_stats_.get(),
ERROR_HANDLER_BG_IO_ERROR_COUNT_MISSPELLED);
RecordTick(bg_error_stats_.get(), RecordTick(bg_error_stats_.get(),
ERROR_HANDLER_BG_RETRYABLE_IO_ERROR_COUNT); ERROR_HANDLER_BG_RETRYABLE_IO_ERROR_COUNT);
RecordTick(bg_error_stats_.get(),
ERROR_HANDLER_BG_RETRYABLE_IO_ERROR_COUNT_MISSPELLED);
} }
ROCKS_LOG_INFO(db_options_.info_log, ROCKS_LOG_INFO(db_options_.info_log,
"ErrorHandler: Set background retryable IO error\n"); "ErrorHandler: Set background retryable IO error\n");
@ -486,6 +497,8 @@ const Status& ErrorHandler::SetBGError(const Status& bg_status,
} else { } else {
if (bg_error_stats_ != nullptr) { if (bg_error_stats_ != nullptr) {
RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_IO_ERROR_COUNT); RecordTick(bg_error_stats_.get(), ERROR_HANDLER_BG_IO_ERROR_COUNT);
RecordTick(bg_error_stats_.get(),
ERROR_HANDLER_BG_IO_ERROR_COUNT_MISSPELLED);
} }
// HandleKnownErrors() will use recovery_error_, so ignore // HandleKnownErrors() will use recovery_error_, so ignore
// recovery_io_error_. // recovery_io_error_.

@ -357,10 +357,15 @@ enum Tickers : uint32_t {
FILES_DELETED_IMMEDIATELY, FILES_DELETED_IMMEDIATELY,
// The counters for error handler, not that, bg_io_error is the subset of // The counters for error handler, not that, bg_io_error is the subset of
// bg_error and bg_retryable_io_error is the subset of bg_io_error // bg_error and bg_retryable_io_error is the subset of bg_io_error.
// The misspelled versions are deprecated and only kept for compatibility.
// TODO: remove the misspelled tickers in the next major release.
ERROR_HANDLER_BG_ERROR_COUNT, ERROR_HANDLER_BG_ERROR_COUNT,
ERROR_HANDLER_BG_ERROR_COUNT_MISSPELLED,
ERROR_HANDLER_BG_IO_ERROR_COUNT, ERROR_HANDLER_BG_IO_ERROR_COUNT,
ERROR_HANDLER_BG_IO_ERROR_COUNT_MISSPELLED,
ERROR_HANDLER_BG_RETRYABLE_IO_ERROR_COUNT, ERROR_HANDLER_BG_RETRYABLE_IO_ERROR_COUNT,
ERROR_HANDLER_BG_RETRYABLE_IO_ERROR_COUNT_MISSPELLED,
ERROR_HANDLER_AUTORESUME_COUNT, ERROR_HANDLER_AUTORESUME_COUNT,
ERROR_HANDLER_AUTORESUME_RETRY_TOTAL_COUNT, ERROR_HANDLER_AUTORESUME_RETRY_TOTAL_COUNT,
ERROR_HANDLER_AUTORESUME_SUCCESS_COUNT, ERROR_HANDLER_AUTORESUME_SUCCESS_COUNT,

@ -176,10 +176,16 @@ const std::vector<std::pair<Tickers, std::string>> TickersNameMap = {
"rocksdb.block.cache.compression.dict.add.redundant"}, "rocksdb.block.cache.compression.dict.add.redundant"},
{FILES_MARKED_TRASH, "rocksdb.files.marked.trash"}, {FILES_MARKED_TRASH, "rocksdb.files.marked.trash"},
{FILES_DELETED_IMMEDIATELY, "rocksdb.files.deleted.immediately"}, {FILES_DELETED_IMMEDIATELY, "rocksdb.files.deleted.immediately"},
{ERROR_HANDLER_BG_ERROR_COUNT, "rocksdb.error.handler.bg.errro.count"}, {ERROR_HANDLER_BG_ERROR_COUNT, "rocksdb.error.handler.bg.error.count"},
{ERROR_HANDLER_BG_ERROR_COUNT_MISSPELLED,
"rocksdb.error.handler.bg.errro.count"},
{ERROR_HANDLER_BG_IO_ERROR_COUNT, {ERROR_HANDLER_BG_IO_ERROR_COUNT,
"rocksdb.error.handler.bg.io.error.count"},
{ERROR_HANDLER_BG_IO_ERROR_COUNT_MISSPELLED,
"rocksdb.error.handler.bg.io.errro.count"}, "rocksdb.error.handler.bg.io.errro.count"},
{ERROR_HANDLER_BG_RETRYABLE_IO_ERROR_COUNT, {ERROR_HANDLER_BG_RETRYABLE_IO_ERROR_COUNT,
"rocksdb.error.handler.bg.retryable.io.error.count"},
{ERROR_HANDLER_BG_RETRYABLE_IO_ERROR_COUNT_MISSPELLED,
"rocksdb.error.handler.bg.retryable.io.errro.count"}, "rocksdb.error.handler.bg.retryable.io.errro.count"},
{ERROR_HANDLER_AUTORESUME_COUNT, "rocksdb.error.handler.autoresume.count"}, {ERROR_HANDLER_AUTORESUME_COUNT, "rocksdb.error.handler.autoresume.count"},
{ERROR_HANDLER_AUTORESUME_RETRY_TOTAL_COUNT, {ERROR_HANDLER_AUTORESUME_RETRY_TOTAL_COUNT,

@ -0,0 +1 @@
Add new tickers: `rocksdb.error.handler.bg.error.count`, `rocksdb.error.handler.bg.io.error.count`, `rocksdb.error.handler.bg.retryable.io.error.count` to replace the misspelled ones: `rocksdb.error.handler.bg.errro.count`, `rocksdb.error.handler.bg.io.errro.count`, `rocksdb.error.handler.bg.retryable.io.errro.count` ('error' instead of 'errro'). Users should switch to use the new tickers before 9.0 release as the misspelled old tickers will be completely removed then.
Loading…
Cancel
Save