Skip to content

Commit

Permalink
Bugfix Command INFO invoke RWLockReader() multiple times (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
whoiami authored Nov 8, 2019
1 parent 0a25a64 commit 5dfb534
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/pika_admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -870,11 +870,10 @@ void InfoCmd::InfoData(std::string &info) {
uint64_t total_background_errors = 0;
std::map<std::string, uint64_t> type_result;
uint64_t memtable_usage = 0, table_reader_usage = 0;
g_pika_server->RWLockReader();
// Do NOT invoke RWLockReader here DoCmd process lock INFO command already
g_pika_server->db()->GetUsage(blackwidow::PROPERTY_TYPE_ROCKSDB_MEMTABLE, &memtable_usage);
g_pika_server->db()->GetUsage(blackwidow::PROPERTY_TYPE_ROCKSDB_TABLE_READER, &table_reader_usage);
g_pika_server->db()->GetUsage(blackwidow::PROPERTY_TYPE_ROCKSDB_BACKGROUND_ERRORS, &type_result);
g_pika_server->RWUnlock();

for (const auto& item : type_result) {
if (item.second != 0) {
Expand Down

0 comments on commit 5dfb534

Please sign in to comment.