Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From dc6caad406034ae3e86b4e50b32520e6cff51e3f Mon Sep 17 00:00:00 2001
- From: Boris Ranto <branto@redhat.com>
- Date: Wed, 21 Nov 2018 22:58:46 +0100
- Subject: [PATCH 1/2] mon/PGMap: Send list of PGs in health checks
- This patch sends the list of the PGs hitting an UNAVAILABLE, DEGRADED,
- DEGRADED_FULL or DAMAGED state as a first detail message.
- Signed-off-by: Boris Ranto <branto@redhat.com>
- ---
- src/mon/PGMap.cc | 19 ++++++++++++++++++-
- 1 file changed, 18 insertions(+), 1 deletion(-)
- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc
- index 99551a2b40..c104044c8e 100644
- --- a/src/mon/PGMap.cc
- +++ b/src/mon/PGMap.cc
- @@ -2362,7 +2362,8 @@ void PGMap::get_health_checks(
- // Don't bother composing detail string if we have already recorded
- // too many
- - if (causes.pg_messages.size() > max) {
- + // Reserve one message for list of PGs causing the state
- + if (causes.pg_messages.size() > max - 1) {
- continue;
- }
- @@ -2468,6 +2469,22 @@ void PGMap::get_health_checks(
- sev,
- summary);
- + if (max < 1)
- + continue;
- +
- + // Push the string of all IDs
- + std::ostringstream id_msg;
- + auto j = i.second.pgs.begin();
- + if(j != i.second.pgs.end()){
- + id_msg << *j;
- + j++;
- + }
- + while(j != i.second.pgs.end()){
- + id_msg << ',' << *j;
- + j++;
- + }
- + check->detail.push_back(id_msg.str());
- +
- // Compose list of PGs contributing to this health check failing
- for (const auto &j : i.second.pg_messages) {
- check->detail.push_back(j.second);
- --
- 2.19.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement