Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2018
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. From dc6caad406034ae3e86b4e50b32520e6cff51e3f Mon Sep 17 00:00:00 2001
  2. From: Boris Ranto <branto@redhat.com>
  3. Date: Wed, 21 Nov 2018 22:58:46 +0100
  4. Subject: [PATCH 1/2] mon/PGMap: Send list of PGs in health checks
  5.  
  6. This patch sends the list of the PGs hitting an UNAVAILABLE, DEGRADED,
  7. DEGRADED_FULL or DAMAGED state as a first detail message.
  8.  
  9. Signed-off-by: Boris Ranto <branto@redhat.com>
  10. ---
  11. src/mon/PGMap.cc | 19 ++++++++++++++++++-
  12. 1 file changed, 18 insertions(+), 1 deletion(-)
  13.  
  14. diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc
  15. index 99551a2b40..c104044c8e 100644
  16. --- a/src/mon/PGMap.cc
  17. +++ b/src/mon/PGMap.cc
  18. @@ -2362,7 +2362,8 @@ void PGMap::get_health_checks(
  19.  
  20. // Don't bother composing detail string if we have already recorded
  21. // too many
  22. - if (causes.pg_messages.size() > max) {
  23. + // Reserve one message for list of PGs causing the state
  24. + if (causes.pg_messages.size() > max - 1) {
  25. continue;
  26. }
  27.  
  28. @@ -2468,6 +2469,22 @@ void PGMap::get_health_checks(
  29. sev,
  30. summary);
  31.  
  32. + if (max < 1)
  33. + continue;
  34. +
  35. + // Push the string of all IDs
  36. + std::ostringstream id_msg;
  37. + auto j = i.second.pgs.begin();
  38. + if(j != i.second.pgs.end()){
  39. + id_msg << *j;
  40. + j++;
  41. + }
  42. + while(j != i.second.pgs.end()){
  43. + id_msg << ',' << *j;
  44. + j++;
  45. + }
  46. + check->detail.push_back(id_msg.str());
  47. +
  48. // Compose list of PGs contributing to this health check failing
  49. for (const auto &j : i.second.pg_messages) {
  50. check->detail.push_back(j.second);
  51. --
  52. 2.19.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement