Skip to content

Commit

Permalink
update rocksdb to 8.1.fb
Browse files Browse the repository at this point in the history
Upstream commit ID: facebook/mysql-5.6@2ece56e
PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951)

Summary:
update rocksdb to 8.1.fb

rocksdb api change causing `io_stalls` properties no long exist. see rocksdb release note
> Add new db properties `rocksdb.cf-write-stall-stats`, `rocksdb.db-write-stall-stats`and APIs to examine them in a structured way. In particular, users of `GetMapProperty()` with property `kCFWriteStallStats`/`kDBWriteStallStats` can now use the functions in `WriteStallStatsMapKeys` to find stats in the map.

see also facebook/rocksdb#11300.

update-submodule: rocksdb

Reviewed By: hermanlee

Differential Revision: D44687471

fbshipit-source-id: 9b62ed10a5e76e68d3197b56c6b2a3ae878807d0
  • Loading branch information
bladepan authored and inikep committed Nov 14, 2024
1 parent 091a250 commit 2996187
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 24 deletions.
4 changes: 0 additions & 4 deletions mysql-test/suite/rocksdb/r/show_engine.result
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ __system__ TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
__system__ TABLE_FACTORY::MEMORY_ALLOCATOR #
__system__ TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
__system__ TABLE_FACTORY::LOW_PRI_POOL_RATIO #
__system__ TABLE_FACTORY::BLOCK_CACHE_COMPRESSED #
__system__ TABLE_FACTORY::PERSISTENT_CACHE #
__system__ TABLE_FACTORY::BLOCK_SIZE #
__system__ TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
Expand Down Expand Up @@ -255,7 +254,6 @@ cf_t1 TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
cf_t1 TABLE_FACTORY::MEMORY_ALLOCATOR #
cf_t1 TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
cf_t1 TABLE_FACTORY::LOW_PRI_POOL_RATIO #
cf_t1 TABLE_FACTORY::BLOCK_CACHE_COMPRESSED #
cf_t1 TABLE_FACTORY::PERSISTENT_CACHE #
cf_t1 TABLE_FACTORY::BLOCK_SIZE #
cf_t1 TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
Expand Down Expand Up @@ -331,7 +329,6 @@ default TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
default TABLE_FACTORY::MEMORY_ALLOCATOR #
default TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
default TABLE_FACTORY::LOW_PRI_POOL_RATIO #
default TABLE_FACTORY::BLOCK_CACHE_COMPRESSED #
default TABLE_FACTORY::PERSISTENT_CACHE #
default TABLE_FACTORY::BLOCK_SIZE #
default TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
Expand Down Expand Up @@ -407,7 +404,6 @@ rev:cf_t2 TABLE_FACTORY::STRICT_CAPACITY_LIMIT #
rev:cf_t2 TABLE_FACTORY::MEMORY_ALLOCATOR #
rev:cf_t2 TABLE_FACTORY::HIGH_PRI_POOL_RATIO #
rev:cf_t2 TABLE_FACTORY::LOW_PRI_POOL_RATIO #
rev:cf_t2 TABLE_FACTORY::BLOCK_CACHE_COMPRESSED #
rev:cf_t2 TABLE_FACTORY::PERSISTENT_CACHE #
rev:cf_t2 TABLE_FACTORY::BLOCK_SIZE #
rev:cf_t2 TABLE_FACTORY::BLOCK_SIZE_DEVIATION #
Expand Down
60 changes: 41 additions & 19 deletions storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14793,10 +14793,9 @@ static void show_myrocks_vars(THD *thd, SHOW_VAR *var, char *buff) {
var->value = reinterpret_cast<char *>(&myrocks_status_variables);
}

static ulonglong io_stall_prop_value(
static ulonglong get_prop_value_as_ulong(
const std::map<std::string, std::string> &props, const std::string &key) {
std::map<std::string, std::string>::const_iterator iter =
props.find("io_stalls." + key);
std::map<std::string, std::string>::const_iterator iter = props.find(key);
if (iter != props.end()) {
return std::stoull(iter->second);
} else {
Expand All @@ -14819,29 +14818,52 @@ static void update_rocksdb_stall_status() {
// Retrieve information from valid CF handle object. It is safe
// even if the CF is removed from cf_manager at this point.
std::map<std::string, std::string> props;
if (!rdb->GetMapProperty(cfh.get(), "rocksdb.cfstats", &props)) {
if (!rdb->GetMapProperty(
cfh.get(), rocksdb::DB::Properties::kCFWriteStallStats, &props)) {
continue;
}

local_io_stall_stats.level0_slowdown +=
io_stall_prop_value(props, "level0_slowdown");
using rocksdb::WriteStallCause;
using rocksdb::WriteStallCondition;
using rocksdb::WriteStallStatsMapKeys;
local_io_stall_stats.level0_slowdown += get_prop_value_as_ulong(
props,
WriteStallStatsMapKeys::CauseConditionCount(
WriteStallCause::kL0FileCountLimit, WriteStallCondition::kDelayed));
local_io_stall_stats.level0_slowdown_with_compaction +=
io_stall_prop_value(props, "level0_slowdown_with_compaction");
local_io_stall_stats.level0_numfiles +=
io_stall_prop_value(props, "level0_numfiles");
local_io_stall_stats.level0_numfiles_with_compaction +=
io_stall_prop_value(props, "level0_numfiles_with_compaction");
get_prop_value_as_ulong(
props, WriteStallStatsMapKeys::
CFL0FileCountLimitDelaysWithOngoingCompaction());
local_io_stall_stats.level0_numfiles += get_prop_value_as_ulong(
props,
WriteStallStatsMapKeys::CauseConditionCount(
WriteStallCause::kL0FileCountLimit, WriteStallCondition::kStopped));
local_io_stall_stats
.level0_numfiles_with_compaction += get_prop_value_as_ulong(
props,
WriteStallStatsMapKeys::CFL0FileCountLimitStopsWithOngoingCompaction());
local_io_stall_stats.stop_for_pending_compaction_bytes +=
io_stall_prop_value(props, "stop_for_pending_compaction_bytes");
get_prop_value_as_ulong(props,
WriteStallStatsMapKeys::CauseConditionCount(
WriteStallCause::kPendingCompactionBytes,
WriteStallCondition::kStopped));
local_io_stall_stats.slowdown_for_pending_compaction_bytes +=
io_stall_prop_value(props, "slowdown_for_pending_compaction_bytes");
local_io_stall_stats.memtable_compaction +=
io_stall_prop_value(props, "memtable_compaction");
local_io_stall_stats.memtable_slowdown +=
io_stall_prop_value(props, "memtable_slowdown");
local_io_stall_stats.total_stop += io_stall_prop_value(props, "total_stop");
get_prop_value_as_ulong(props,
WriteStallStatsMapKeys::CauseConditionCount(
WriteStallCause::kPendingCompactionBytes,
WriteStallCondition::kDelayed));
local_io_stall_stats.memtable_compaction += get_prop_value_as_ulong(
props,
WriteStallStatsMapKeys::CauseConditionCount(
WriteStallCause::kMemtableLimit, WriteStallCondition::kStopped));
local_io_stall_stats.memtable_slowdown += get_prop_value_as_ulong(
props,
WriteStallStatsMapKeys::CauseConditionCount(
WriteStallCause::kMemtableLimit, WriteStallCondition::kDelayed));
local_io_stall_stats.total_stop +=
get_prop_value_as_ulong(props, WriteStallStatsMapKeys::TotalStops());
local_io_stall_stats.total_slowdown +=
io_stall_prop_value(props, "total_slowdown");
get_prop_value_as_ulong(props, WriteStallStatsMapKeys::TotalDelays());
}
io_stall_stats = local_io_stall_stats;
}
Expand Down
2 changes: 1 addition & 1 deletion storage/rocksdb/rocksdb
Submodule rocksdb updated 624 files

0 comments on commit 2996187

Please sign in to comment.