Details
-
Bug
-
Resolution: Fixed
-
Major
-
6.0.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.5.1, 6.6.0, 6.5.0
-
None
-
Untriaged
-
1
-
Yes
-
KV Sprint 2020-Oct
Description
As part of "stats reset" we call HdrHistogram::reset() which will call
void HdrHistogram::reset() {
|
hdr_reset(histogram.get());
|
}
|
but if someone is currently using the histogram in add_casted_histo_stat they'll end up with an "infinite loop" adding more and more stats:
template <typename T>
|
inline void add_casted_histo_stat(const char* k,
|
const T& v,
|
const AddStatFn& add_stat,
|
const void* cookie) {
|
if (v.getValueCount() > 0) {
|
std::string meanKey(k);
|
meanKey += "_mean";
|
add_casted_stat(
|
meanKey.c_str(), std::round(v.getMean()), add_stat, cookie);
|
|
HdrHistogram::Iterator iter{v.getHistogramsIterator()};
|
while (auto result = v.getNextBucketLowHighAndCount(iter)) {
|
if (std::get<2>(*result) > 0) {
|
std::string newKey(k);
|
newKey += "_" + std::to_string(std::get<0>(*result)) + "," +
|
std::to_string(std::get<1>(*result));
|
add_casted_stat(
|
newKey.c_str(), std::get<2>(*result), add_stat, cookie);
|
}
|
}
|
}
|
}
|
Attachments
Issue Links
For Gerrit Dashboard: MB-41510 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
136400,6 | MB-41510: Refactor Timings class to better handle its Histograms | mad-hatter | kv_engine | Status: ABANDONED | 0 | +1 |
136490,12 | MB-41510: Fix infinite loop due to HdrHistogram being reset | mad-hatter | kv_engine | Status: ABANDONED | 0 | +1 |
136612,6 | MB-41510: Tidy HdrHistogram class | master | kv_engine | Status: MERGED | +2 | +1 |
136691,5 | MB-41510: Refactor Timings class to better handle its Histograms | master | kv_engine | Status: ABANDONED | -2 | +1 |
136692,7 | MB-41510: Fix infinite loop due to HdrHistogram being reset | master | kv_engine | Status: ABANDONED | 0 | +1 |
136913,2 | MB-41510: Test RAW std::shared_ptr<> | master | kv_engine | Status: ABANDONED | 0 | -1 |
137228,18 | MB-41510: Fix infinite loop due to HdrHistogram being reset | master | kv_engine | Status: MERGED | +2 | +1 |
137548,11 | MB-41510: Fix TSAN failure due to lock order inversion | master | kv_engine | Status: MERGED | +2 | +1 |
137625,12 | Adding test case for MB-41510 | mad-hatter | TAF | Status: MERGED | +2 | +1 |
137634,4 | Adding test case for MB-41510 | master | TAF | Status: MERGED | +2 | +1 |
137745,5 | MB-41510: Fix TSAN failure due to lock order inversion | master | kv_engine | Status: MERGED | +2 | +1 |
138048,2 | Adding ephemeral bucket test for MB-41510 | master | TAF | Status: MERGED | +2 | +1 |