Merge pull request #6867 from neethuhaneesha/rocksdb-aggrProperty

RocksDb using aggr property metrics for pendingCompactionBytes.
This commit is contained in:
neethuhaneesha 2022-04-15 11:02:29 -07:00 committed by GitHub
commit 5ffd9e0172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1847,11 +1847,13 @@ struct RocksDBKeyValueStore : IKeyValueStore {
ACTOR Future<Void> checkRocksdbState(RocksDBKeyValueStore* self) {
state uint64_t estPendCompactBytes;
state int count = SERVER_KNOBS->ROCKSDB_CAN_COMMIT_DELAY_TIMES_ON_OVERLOAD;
self->db->GetIntProperty(rocksdb::DB::Properties::kEstimatePendingCompactionBytes, &estPendCompactBytes);
self->db->GetAggregatedIntProperty(rocksdb::DB::Properties::kEstimatePendingCompactionBytes,
&estPendCompactBytes);
while (count && estPendCompactBytes > SERVER_KNOBS->ROCKSDB_CAN_COMMIT_COMPACT_BYTES_LIMIT) {
wait(delay(SERVER_KNOBS->ROCKSDB_CAN_COMMIT_DELAY_ON_OVERLOAD));
count--;
self->db->GetIntProperty(rocksdb::DB::Properties::kEstimatePendingCompactionBytes, &estPendCompactBytes);
self->db->GetAggregatedIntProperty(rocksdb::DB::Properties::kEstimatePendingCompactionBytes,
&estPendCompactBytes);
}
return Void();