From d09c87bf84233656c1d3c4e0e7f4566de780c326 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Mon, 10 Aug 2020 19:51:12 -0700 Subject: [PATCH 1/7] osd: Move scrubber info out of recovery_state and add fields to scrubber::dump() Add scrubber::dump() function which is a more obvious place when adding fields Indicate that the scrubber info in recovery_state is deprecated Signed-off-by: David Zafman --- src/osd/PG.cc | 43 +++++++++++++++++++++++++++++++++++++++++ src/osd/PG.h | 1 + src/osd/PrimaryLogPG.cc | 4 ++++ 3 files changed, 48 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 8e48546ac98a5..3d220732ccc79 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3773,12 +3773,54 @@ void PG::handle_initialize(PeeringCtx &rctx) recovery_state.handle_event(evt, &rctx); } +void PG::Scrubber::dump(Formatter *f) +{ + f->open_object_section("scrubber"); + f->dump_stream("epoch_start") << epoch_start; + f->dump_bool("active", active); + if (active) { + f->dump_string("state", state_string(state)); + f->dump_stream("start") << start; + f->dump_stream("end") << end; + f->dump_stream("max_end") << max_end; + f->dump_stream("subset_last_update") << subset_last_update; + f->dump_bool("deep", deep); + f->dump_bool("must_scrub", must_scrub); + f->dump_bool("must_deep_scrub", must_deep_scrub); + f->dump_bool("must_repair", must_repair); + f->dump_bool("need_auto", need_auto); + f->dump_bool("req_scrub", req_scrub); + f->dump_bool("time_for_deep", time_for_deep); + f->dump_bool("auto_repair", auto_repair); + f->dump_bool("check_repair", check_repair); + f->dump_bool("deep_scrub_on_error", deep_scrub_on_error); + f->dump_stream("scrub_reg_stamp") << scrub_reg_stamp; //utime_t + f->dump_stream("waiting_on_whom") << waiting_on_whom; //set + f->dump_unsigned("priority", priority); + f->dump_int("shallow_errors", shallow_errors); + f->dump_int("deep_errors", deep_errors); + f->dump_int("fixed", fixed); + { + f->open_array_section("waiting_on_whom"); + for (set::iterator p = waiting_on_whom.begin(); + p != waiting_on_whom.end(); + ++p) { + f->dump_stream("shard") << *p; + } + f->close_section(); + } + } + f->close_section(); +} + void PG::handle_query_state(Formatter *f) { dout(10) << "handle_query_state" << dendl; PeeringState::QueryState q(f); recovery_state.handle_event(q, 0); + // This code has moved to after the close of recovery_state array. + // I don't think that scrub is a recovery state if (is_primary() && is_active()) { f->open_object_section("scrub"); f->dump_stream("scrubber.epoch_start") << scrubber.epoch_start; @@ -3798,6 +3840,7 @@ void PG::handle_query_state(Formatter *f) } f->close_section(); } + f->dump_string("comment", "DEPRECATED - may be removed in the next release"); f->close_section(); } } diff --git a/src/osd/PG.h b/src/osd/PG.h index 53eb3cb6820be..2b17ba52c537d 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1191,6 +1191,7 @@ class PG : public DoutPrefixProvider, public PeeringState::PeeringListener { void create_results(const hobject_t& obj); void cleanup_store(ObjectStore::Transaction *t); + void dump(ceph::Formatter *f); } scrubber; protected: diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 3bba568ce4c39..fbcb64c72e84f 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -1006,6 +1006,10 @@ void PrimaryLogPG::do_command( handle_query_state(f.get()); f->close_section(); + if (is_primary() && is_active()) { + scrubber.dump(f.get()); + } + f->open_object_section("agent_state"); if (agent_state) agent_state->dump(f.get()); From 3f4e9a4526b8f174888828078e610769b80e48ec Mon Sep 17 00:00:00 2001 From: David Zafman Date: Thu, 30 Jul 2020 15:38:19 -0700 Subject: [PATCH 2/7] Fix to raise BOOST_MPL_LIMIT_LIST_SIZE from 20 to 30 Signed-off-by: David Zafman --- src/crimson/admin/osd_admin.cc | 5 +++++ src/crimson/admin/pg_commands.cc | 5 +++++ src/crimson/osd/backfill_state.cc | 5 +++++ src/crimson/osd/ec_backend.cc | 5 +++++ src/crimson/osd/heartbeat.cc | 5 +++++ src/crimson/osd/main.cc | 5 +++++ src/crimson/osd/objclass.cc | 5 +++++ src/crimson/osd/ops_executer.cc | 5 +++++ src/crimson/osd/osd.cc | 5 +++++ src/crimson/osd/osd_operations/background_recovery.cc | 5 +++++ src/crimson/osd/osd_operations/client_request.cc | 5 +++++ src/crimson/osd/osd_operations/compound_peering_request.cc | 5 +++++ src/crimson/osd/osd_operations/peering_event.cc | 5 +++++ src/crimson/osd/osd_operations/pg_advance_map.cc | 5 +++++ src/crimson/osd/osd_operations/replicated_request.cc | 5 +++++ src/crimson/osd/osdmap_gate.cc | 5 +++++ src/crimson/osd/pg.cc | 5 +++++ src/crimson/osd/pg_map.cc | 5 +++++ src/crimson/osd/pg_recovery.cc | 5 +++++ src/crimson/osd/recovery_backend.cc | 5 +++++ src/crimson/osd/replicated_backend.cc | 5 +++++ src/crimson/osd/replicated_recovery_backend.cc | 5 +++++ src/crimson/osd/shard_services.cc | 5 +++++ src/osd/OSD.h | 5 +++++ src/osd/PG.h | 5 +++++ src/osd/PGBackend.cc | 4 ++++ src/osd/PGPeeringEvent.h | 5 +++++ src/osd/PeeringState.cc | 5 +++++ src/osd/PeeringState.h | 5 +++++ src/osd/PrimaryLogPG.h | 5 +++++ src/osd/ReplicatedBackend.cc | 6 ++++++ src/osd/Session.h | 5 +++++ src/osd/objclass.cc | 5 +++++ src/osd/osd_types.h | 5 +++++ src/osd/scheduler/OpScheduler.cc | 5 +++++ src/osd/scheduler/mClockScheduler.cc | 5 +++++ src/test/osd/TestMClockScheduler.cc | 5 +++++ src/test/osd/test_ec_transaction.cc | 5 +++++ src/tools/ceph_objectstore_tool.cc | 5 +++++ src/tools/rebuild_mondb.cc | 6 ++++++ 40 files changed, 201 insertions(+) diff --git a/src/crimson/admin/osd_admin.cc b/src/crimson/admin/osd_admin.cc index ce6b6695d2892..31c9556ff489a 100644 --- a/src/crimson/admin/osd_admin.cc +++ b/src/crimson/admin/osd_admin.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "crimson/admin/osd_admin.h" #include #include diff --git a/src/crimson/admin/pg_commands.cc b/src/crimson/admin/pg_commands.cc index dacfd515db481..98b5b1c55b2d0 100644 --- a/src/crimson/admin/pg_commands.cc +++ b/src/crimson/admin/pg_commands.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "crimson/admin/pg_commands.h" #include diff --git a/src/crimson/osd/backfill_state.cc b/src/crimson/osd/backfill_state.cc index 1ffadd4e8483c..7336c50299a9c 100644 --- a/src/crimson/osd/backfill_state.cc +++ b/src/crimson/osd/backfill_state.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include diff --git a/src/crimson/osd/ec_backend.cc b/src/crimson/osd/ec_backend.cc index c6516d50a8e8f..44496e82bd9ac 100644 --- a/src/crimson/osd/ec_backend.cc +++ b/src/crimson/osd/ec_backend.cc @@ -1,3 +1,8 @@ +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "ec_backend.h" #include "crimson/osd/shard_services.h" diff --git a/src/crimson/osd/heartbeat.cc b/src/crimson/osd/heartbeat.cc index d8dc1e550e168..3d2eacd07e3c5 100644 --- a/src/crimson/osd/heartbeat.cc +++ b/src/crimson/osd/heartbeat.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "heartbeat.h" #include diff --git a/src/crimson/osd/main.cc b/src/crimson/osd/main.cc index a90903e72271e..9f082352d5d4b 100644 --- a/src/crimson/osd/main.cc +++ b/src/crimson/osd/main.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include diff --git a/src/crimson/osd/objclass.cc b/src/crimson/osd/objclass.cc index 0017a21b02aa7..516eaf677247c 100644 --- a/src/crimson/osd/objclass.cc +++ b/src/crimson/osd/objclass.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include #include "common/ceph_context.h" diff --git a/src/crimson/osd/ops_executer.cc b/src/crimson/osd/ops_executer.cc index 027fac9a7039e..decbdf8332a83 100644 --- a/src/crimson/osd/ops_executer.cc +++ b/src/crimson/osd/ops_executer.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "ops_executer.h" #include diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index a170d7ccf7799..6e9651b0db13c 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "osd.h" #include diff --git a/src/crimson/osd/osd_operations/background_recovery.cc b/src/crimson/osd/osd_operations/background_recovery.cc index 40407e708d7de..2e52aa2b68aa1 100644 --- a/src/crimson/osd/osd_operations/background_recovery.cc +++ b/src/crimson/osd/osd_operations/background_recovery.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include "messages/MOSDOp.h" diff --git a/src/crimson/osd/osd_operations/client_request.cc b/src/crimson/osd/osd_operations/client_request.cc index a51cc7256d640..8602c242b9bb0 100644 --- a/src/crimson/osd/osd_operations/client_request.cc +++ b/src/crimson/osd/osd_operations/client_request.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include "messages/MOSDOp.h" diff --git a/src/crimson/osd/osd_operations/compound_peering_request.cc b/src/crimson/osd/osd_operations/compound_peering_request.cc index e55760096e4e8..909df8080f93f 100644 --- a/src/crimson/osd/osd_operations/compound_peering_request.cc +++ b/src/crimson/osd/osd_operations/compound_peering_request.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include "osd/PeeringState.h" diff --git a/src/crimson/osd/osd_operations/peering_event.cc b/src/crimson/osd/osd_operations/peering_event.cc index d3c6ccf817f82..50c6bca6df5f2 100644 --- a/src/crimson/osd/osd_operations/peering_event.cc +++ b/src/crimson/osd/osd_operations/peering_event.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include "messages/MOSDPGLog.h" diff --git a/src/crimson/osd/osd_operations/pg_advance_map.cc b/src/crimson/osd/osd_operations/pg_advance_map.cc index a96479d4076e7..d38c3e2858abf 100644 --- a/src/crimson/osd/osd_operations/pg_advance_map.cc +++ b/src/crimson/osd/osd_operations/pg_advance_map.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "crimson/osd/osd_operations/pg_advance_map.h" #include diff --git a/src/crimson/osd/osd_operations/replicated_request.cc b/src/crimson/osd/osd_operations/replicated_request.cc index 34487f9e458ed..5139dfc92a2bb 100644 --- a/src/crimson/osd/osd_operations/replicated_request.cc +++ b/src/crimson/osd/osd_operations/replicated_request.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "replicated_request.h" #include "common/Formatter.h" diff --git a/src/crimson/osd/osdmap_gate.cc b/src/crimson/osd/osdmap_gate.cc index 90afc32b4e404..abcb530e89667 100644 --- a/src/crimson/osd/osdmap_gate.cc +++ b/src/crimson/osd/osdmap_gate.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "crimson/common/exception.h" #include "crimson/osd/osdmap_gate.h" #include "crimson/osd/shard_services.h" diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 3abe129c2fe41..974bcbf184b98 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "pg.h" #include diff --git a/src/crimson/osd/pg_map.cc b/src/crimson/osd/pg_map.cc index 08071f2604fec..2532e31d65756 100644 --- a/src/crimson/osd/pg_map.cc +++ b/src/crimson/osd/pg_map.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "crimson/osd/pg_map.h" #include "crimson/osd/pg.h" diff --git a/src/crimson/osd/pg_recovery.cc b/src/crimson/osd/pg_recovery.cc index 473be5f974760..68d37e7d386ca 100644 --- a/src/crimson/osd/pg_recovery.cc +++ b/src/crimson/osd/pg_recovery.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include diff --git a/src/crimson/osd/recovery_backend.cc b/src/crimson/osd/recovery_backend.cc index 77a5480a97509..5bae2c9396e02 100644 --- a/src/crimson/osd/recovery_backend.cc +++ b/src/crimson/osd/recovery_backend.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include "crimson/common/exception.h" diff --git a/src/crimson/osd/replicated_backend.cc b/src/crimson/osd/replicated_backend.cc index 51fe69394fa65..ce2bd8764e822 100644 --- a/src/crimson/osd/replicated_backend.cc +++ b/src/crimson/osd/replicated_backend.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "replicated_backend.h" #include "messages/MOSDRepOpReply.h" diff --git a/src/crimson/osd/replicated_recovery_backend.cc b/src/crimson/osd/replicated_recovery_backend.cc index e888d4e9142b6..d534b7af8a51d 100644 --- a/src/crimson/osd/replicated_recovery_backend.cc +++ b/src/crimson/osd/replicated_recovery_backend.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include #include diff --git a/src/crimson/osd/shard_services.cc b/src/crimson/osd/shard_services.cc index 46c6d710df6e6..8d04c6c04a9b8 100644 --- a/src/crimson/osd/shard_services.cc +++ b/src/crimson/osd/shard_services.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "crimson/osd/shard_services.h" #include "messages/MOSDAlive.h" diff --git a/src/osd/OSD.h b/src/osd/OSD.h index dc25f604c35aa..627df53fea6b4 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -15,6 +15,11 @@ #ifndef CEPH_OSD_H #define CEPH_OSD_H +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "PG.h" #include "msg/Dispatcher.h" diff --git a/src/osd/PG.h b/src/osd/PG.h index 2b17ba52c537d..28651a6955ed2 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -15,6 +15,11 @@ #ifndef CEPH_PG_H #define CEPH_PG_H +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include #include "include/mempool.h" diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 4025afc8b8d63..ba219024259b5 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -15,6 +15,10 @@ * */ +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif #include "common/errno.h" #include "common/scrub_types.h" diff --git a/src/osd/PGPeeringEvent.h b/src/osd/PGPeeringEvent.h index 2828880f6565a..1cc25fea817e3 100644 --- a/src/osd/PGPeeringEvent.h +++ b/src/osd/PGPeeringEvent.h @@ -3,6 +3,11 @@ #pragma once +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include "osd/osd_types.h" diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index c600431600c49..891405e1c63f9 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "PGPeeringEvent.h" #include "common/ceph_releases.h" #include "common/dout.h" diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index 56f76081bf861..7583a583b5fe1 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -3,6 +3,11 @@ #pragma once +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include #include diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index b34b62ca5d964..469af37a60e7f 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -17,6 +17,11 @@ #ifndef CEPH_REPLICATEDPG_H #define CEPH_REPLICATEDPG_H +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include "include/ceph_assert.h" #include "DynamicPerfStats.h" diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 7c71aa26fe7a2..b8b88685290fa 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -11,6 +11,12 @@ * Foundation. See file COPYING. * */ + +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "common/errno.h" #include "ReplicatedBackend.h" #include "messages/MOSDOp.h" diff --git a/src/osd/Session.h b/src/osd/Session.h index a42d37bfecc09..450cc5204815c 100644 --- a/src/osd/Session.h +++ b/src/osd/Session.h @@ -15,6 +15,11 @@ #ifndef CEPH_OSD_SESSION_H #define CEPH_OSD_SESSION_H +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "common/RefCountedObj.h" #include "common/ceph_mutex.h" #include "global/global_context.h" diff --git a/src/osd/objclass.cc b/src/osd/objclass.cc index 73c5406856a56..f823b0e5115b7 100644 --- a/src/osd/objclass.cc +++ b/src/osd/objclass.cc @@ -1,6 +1,11 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include "common/ceph_context.h" #include "common/ceph_releases.h" diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index f1bf86e445c2d..8cb92c6424260 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -18,6 +18,11 @@ #ifndef CEPH_OSD_TYPES_H #define CEPH_OSD_TYPES_H +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include #include diff --git a/src/osd/scheduler/OpScheduler.cc b/src/osd/scheduler/OpScheduler.cc index 2f656966bb4d1..8bb85bdb89c05 100644 --- a/src/osd/scheduler/OpScheduler.cc +++ b/src/osd/scheduler/OpScheduler.cc @@ -12,6 +12,11 @@ * */ +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include "osd/scheduler/OpScheduler.h" diff --git a/src/osd/scheduler/mClockScheduler.cc b/src/osd/scheduler/mClockScheduler.cc index 0e96fbfae0d7f..1b39dbdf49232 100644 --- a/src/osd/scheduler/mClockScheduler.cc +++ b/src/osd/scheduler/mClockScheduler.cc @@ -16,6 +16,11 @@ #include #include +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "osd/scheduler/mClockScheduler.h" #include "common/dout.h" diff --git a/src/test/osd/TestMClockScheduler.cc b/src/test/osd/TestMClockScheduler.cc index 65e2a1ae91fc9..e73f634170a89 100644 --- a/src/test/osd/TestMClockScheduler.cc +++ b/src/test/osd/TestMClockScheduler.cc @@ -2,6 +2,11 @@ #include "gtest/gtest.h" +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "global/global_context.h" #include "global/global_init.h" #include "common/common_init.h" diff --git a/src/test/osd/test_ec_transaction.cc b/src/test/osd/test_ec_transaction.cc index 98669667a7772..2a22ddc865324 100644 --- a/src/test/osd/test_ec_transaction.cc +++ b/src/test/osd/test_ec_transaction.cc @@ -12,6 +12,11 @@ * */ +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include "osd/PGTransaction.h" #include "osd/ECTransaction.h" diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index d9abe03af6edf..b8d3c5f51d3cf 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -12,6 +12,11 @@ * */ +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include #include #include diff --git a/src/tools/rebuild_mondb.cc b/src/tools/rebuild_mondb.cc index 8e3d5b4588802..22015eae8052c 100644 --- a/src/tools/rebuild_mondb.cc +++ b/src/tools/rebuild_mondb.cc @@ -1,3 +1,9 @@ + +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 30 +#endif + #include "auth/cephx/CephxKeyServer.h" #include "common/errno.h" #include "mon/AuthMonitor.h" From a787148ed20273b396f4a0e47bf64bd8ebf01765 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Wed, 12 Aug 2020 14:32:32 -0700 Subject: [PATCH 3/7] osd: Feature to add might_have_unfound info to list_unfound requests fixes: https://tracker.ceph.com/issues/39012 Signed-off-by: David Zafman --- src/osd/PeeringState.cc | 131 ++++++++++++++++++++++++++++++++++++++++ src/osd/PeeringState.h | 37 ++++++++++++ src/osd/PrimaryLogPG.cc | 3 + 3 files changed, 171 insertions(+) diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 891405e1c63f9..af51893e41614 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -318,6 +318,36 @@ void PeeringState::purge_strays() peer_missing_requested.clear(); } +void PeeringState::query_unfound(Formatter *f, string state) +{ + psdout(20) << "Enter PeeringState common QueryUnfound" << dendl; + { + f->dump_string("state", state); + f->dump_bool("available_might_have_unfound", true); + f->open_array_section("might_have_unfound"); + for (auto p = might_have_unfound.begin(); + p != might_have_unfound.end(); + ++p) { + if (peer_missing.count(*p)) { + ; // Ignore already probed OSDs + } else { + f->open_object_section("osd"); + f->dump_stream("osd") << *p; + if (peer_missing_requested.count(*p)) { + f->dump_string("status", "querying"); + } else if (!get_osdmap()->is_up(p->osd)) { + f->dump_string("status", "osd is down"); + } else { + f->dump_string("status", "not queried"); + } + f->close_section(); + } + } + f->close_section(); + } + psdout(20) << "Exit PeeringState common QueryUnfound" << dendl; + return; +} bool PeeringState::proc_replica_info( pg_shard_t from, const pg_info_t &oinfo, epoch_t send_epoch) @@ -4324,6 +4354,13 @@ boost::statechart::result PeeringState::Started::react(const QueryState& q) return discard_event(); } +boost::statechart::result PeeringState::Started::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "Started"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + void PeeringState::Started::exit() { context< PeeringMachine >().log_exit(state_name, enter_time); @@ -4412,6 +4449,13 @@ boost::statechart::result PeeringState::Reset::react(const QueryState& q) return discard_event(); } +boost::statechart::result PeeringState::Reset::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "Reset"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + void PeeringState::Reset::exit() { context< PeeringMachine >().log_exit(state_name, enter_time); @@ -4625,6 +4669,13 @@ boost::statechart::result PeeringState::Peering::react(const QueryState& q) return forward_event(); } +boost::statechart::result PeeringState::Peering::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "Peering"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + void PeeringState::Peering::exit() { @@ -4905,6 +4956,14 @@ PeeringState::NotBackfilling::NotBackfilling(my_context ctx) pl->publish_stats_to_osd(); } +boost::statechart::result PeeringState::NotBackfilling::react(const QueryUnfound& q) +{ + DECLARE_LOCALS; + + ps->query_unfound(q.f, "NotBackfilling"); + return discard_event(); +} + boost::statechart::result PeeringState::NotBackfilling::react(const RemoteBackfillReserved &evt) { @@ -4938,6 +4997,14 @@ PeeringState::NotRecovering::NotRecovering(my_context ctx) pl->publish_stats_to_osd(); } +boost::statechart::result PeeringState::NotRecovering::react(const QueryUnfound& q) +{ + DECLARE_LOCALS; + + ps->query_unfound(q.f, "NotRecovering"); + return discard_event(); +} + void PeeringState::NotRecovering::exit() { context< PeeringMachine >().log_exit(state_name, enter_time); @@ -5802,6 +5869,14 @@ boost::statechart::result PeeringState::Active::react(const QueryState& q) return forward_event(); } +boost::statechart::result PeeringState::Active::react(const QueryUnfound& q) +{ + DECLARE_LOCALS; + + ps->query_unfound(q.f, "Active"); + return discard_event(); +} + boost::statechart::result PeeringState::Active::react( const ActivateCommitted &evt) { @@ -6101,6 +6176,13 @@ boost::statechart::result PeeringState::ReplicaActive::react(const QueryState& q return forward_event(); } +boost::statechart::result PeeringState::ReplicaActive::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "ReplicaActive"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + void PeeringState::ReplicaActive::exit() { context< PeeringMachine >().log_exit(state_name, enter_time); @@ -6469,6 +6551,13 @@ boost::statechart::result PeeringState::GetInfo::react(const QueryState& q) return forward_event(); } +boost::statechart::result PeeringState::GetInfo::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "GetInfo"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + void PeeringState::GetInfo::exit() { context< PeeringMachine >().log_exit(state_name, enter_time); @@ -6603,6 +6692,13 @@ boost::statechart::result PeeringState::GetLog::react(const QueryState& q) return forward_event(); } +boost::statechart::result PeeringState::GetLog::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "GetLog"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + void PeeringState::GetLog::exit() { context< PeeringMachine >().log_exit(state_name, enter_time); @@ -6665,6 +6761,13 @@ boost::statechart::result PeeringState::WaitActingChange::react(const QueryState return forward_event(); } +boost::statechart::result PeeringState::WaitActingChange::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "WaitActingChange"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + void PeeringState::WaitActingChange::exit() { context< PeeringMachine >().log_exit(state_name, enter_time); @@ -6714,6 +6817,13 @@ boost::statechart::result PeeringState::Down::react(const QueryState& q) return forward_event(); } +boost::statechart::result PeeringState::Down::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "Down"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + boost::statechart::result PeeringState::Down::react(const MNotifyRec& infoevt) { DECLARE_LOCALS; @@ -6791,6 +6901,13 @@ boost::statechart::result PeeringState::Incomplete::react( return forward_event(); } +boost::statechart::result PeeringState::Incomplete::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "Incomplete"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + void PeeringState::Incomplete::exit() { context< PeeringMachine >().log_exit(state_name, enter_time); @@ -6943,6 +7060,13 @@ boost::statechart::result PeeringState::GetMissing::react(const QueryState& q) return forward_event(); } +boost::statechart::result PeeringState::GetMissing::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "GetMising"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + void PeeringState::GetMissing::exit() { context< PeeringMachine >().log_exit(state_name, enter_time); @@ -6989,6 +7113,13 @@ boost::statechart::result PeeringState::WaitUpThru::react(const QueryState& q) return forward_event(); } +boost::statechart::result PeeringState::WaitUpThru::react(const QueryUnfound& q) +{ + q.f->dump_string("state", "WaitUpThru"); + q.f->dump_bool("available_might_have_unfound", false); + return discard_event(); +} + void PeeringState::WaitUpThru::exit() { context< PeeringMachine >().log_exit(state_name, enter_time); diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index 7583a583b5fe1..e0fe398833660 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -438,6 +438,14 @@ class PeeringState : public MissingLoc::MappingInfo { } }; + struct QueryUnfound : boost::statechart::event< QueryUnfound > { + ceph::Formatter *f; + explicit QueryUnfound(ceph::Formatter *f) : f(f) {} + void print(std::ostream *out) const { + *out << "QueryUnfound"; + } + }; + struct AdvMap : boost::statechart::event< AdvMap > { OSDMapRef osdmap; OSDMapRef lastmap; @@ -680,6 +688,7 @@ class PeeringState : public MissingLoc::MappingInfo { typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::custom_reaction< AdvMap >, boost::statechart::custom_reaction< ActMap >, boost::statechart::custom_reaction< NullEvt >, @@ -687,6 +696,7 @@ class PeeringState : public MissingLoc::MappingInfo { boost::statechart::transition< boost::statechart::event_base, Crashed > > reactions; boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const AdvMap&); boost::statechart::result react(const ActMap&); boost::statechart::result react(const IntervalFlush&); @@ -703,6 +713,7 @@ class PeeringState : public MissingLoc::MappingInfo { typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::custom_reaction< AdvMap >, boost::statechart::custom_reaction< IntervalFlush >, // ignored @@ -717,6 +728,7 @@ class PeeringState : public MissingLoc::MappingInfo { boost::statechart::transition< boost::statechart::event_base, Crashed > > reactions; boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const AdvMap&); boost::statechart::result react(const IntervalFlush&); boost::statechart::result react(const boost::statechart::event_base&) { @@ -768,6 +780,7 @@ class PeeringState : public MissingLoc::MappingInfo { NamedState { typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::custom_reaction< AdvMap >, boost::statechart::custom_reaction< MLogRec >, boost::statechart::custom_reaction< MInfoRec >, @@ -775,6 +788,7 @@ class PeeringState : public MissingLoc::MappingInfo { > reactions; explicit WaitActingChange(my_context ctx); boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const AdvMap&); boost::statechart::result react(const MLogRec&); boost::statechart::result react(const MInfoRec&); @@ -794,10 +808,12 @@ class PeeringState : public MissingLoc::MappingInfo { typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::transition< Activate, Active >, boost::statechart::custom_reaction< AdvMap > > reactions; boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const AdvMap &advmap); }; @@ -813,6 +829,7 @@ class PeeringState : public MissingLoc::MappingInfo { typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::custom_reaction< ActMap >, boost::statechart::custom_reaction< AdvMap >, boost::statechart::custom_reaction< MInfoRec >, @@ -834,6 +851,7 @@ class PeeringState : public MissingLoc::MappingInfo { boost::statechart::custom_reaction< CheckReadable> > reactions; boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const ActMap&); boost::statechart::result react(const AdvMap&); boost::statechart::result react(const MInfoRec& infoevt); @@ -955,23 +973,27 @@ class PeeringState : public MissingLoc::MappingInfo { struct NotBackfilling : boost::statechart::state< NotBackfilling, Active>, NamedState { typedef boost::mpl::list< + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::transition< RequestBackfill, WaitLocalBackfillReserved>, boost::statechart::custom_reaction< RemoteBackfillReserved >, boost::statechart::custom_reaction< RemoteReservationRejectedTooFull > > reactions; explicit NotBackfilling(my_context ctx); void exit(); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const RemoteBackfillReserved& evt); boost::statechart::result react(const RemoteReservationRejectedTooFull& evt); }; struct NotRecovering : boost::statechart::state< NotRecovering, Active>, NamedState { typedef boost::mpl::list< + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::transition< DoRecovery, WaitLocalRecoveryReserved >, boost::statechart::custom_reaction< DeferRecovery >, boost::statechart::custom_reaction< UnfoundRecovery > > reactions; explicit NotRecovering(my_context ctx); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const DeferRecovery& evt) { /* no-op */ return discard_event(); @@ -991,6 +1013,7 @@ class PeeringState : public MissingLoc::MappingInfo { typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::custom_reaction< ActMap >, boost::statechart::custom_reaction< MQuery >, boost::statechart::custom_reaction< MInfoRec >, @@ -1009,6 +1032,7 @@ class PeeringState : public MissingLoc::MappingInfo { boost::statechart::custom_reaction< MLease > > reactions; boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const MInfoRec& infoevt); boost::statechart::result react(const MLogRec& logevt); boost::statechart::result react(const MTrim& trimevt); @@ -1239,11 +1263,13 @@ class PeeringState : public MissingLoc::MappingInfo { typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::transition< GotInfo, GetLog >, boost::statechart::custom_reaction< MNotifyRec >, boost::statechart::transition< IsDown, Down > > reactions; boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const MNotifyRec& infoevt); }; @@ -1260,6 +1286,7 @@ class PeeringState : public MissingLoc::MappingInfo { typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::custom_reaction< MLogRec >, boost::statechart::custom_reaction< GotLog >, boost::statechart::custom_reaction< AdvMap >, @@ -1268,6 +1295,7 @@ class PeeringState : public MissingLoc::MappingInfo { > reactions; boost::statechart::result react(const AdvMap&); boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const MLogRec& logevt); boost::statechart::result react(const GotLog&); }; @@ -1282,10 +1310,12 @@ class PeeringState : public MissingLoc::MappingInfo { typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::custom_reaction< MLogRec >, boost::statechart::transition< NeedUpThru, WaitUpThru > > reactions; boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const MLogRec& logevt); }; @@ -1295,10 +1325,12 @@ class PeeringState : public MissingLoc::MappingInfo { typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::custom_reaction< ActMap >, boost::statechart::custom_reaction< MLogRec > > reactions; boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const ActMap& am); boost::statechart::result react(const MLogRec& logrec); }; @@ -1307,9 +1339,11 @@ class PeeringState : public MissingLoc::MappingInfo { explicit Down(my_context ctx); typedef boost::mpl::list < boost::statechart::custom_reaction< QueryState >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::custom_reaction< MNotifyRec > > reactions; boost::statechart::result react(const QueryState& q); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const MNotifyRec& infoevt); void exit(); }; @@ -1318,11 +1352,13 @@ class PeeringState : public MissingLoc::MappingInfo { typedef boost::mpl::list < boost::statechart::custom_reaction< AdvMap >, boost::statechart::custom_reaction< MNotifyRec >, + boost::statechart::custom_reaction< QueryUnfound >, boost::statechart::custom_reaction< QueryState > > reactions; explicit Incomplete(my_context ctx); boost::statechart::result react(const AdvMap &advmap); boost::statechart::result react(const MNotifyRec& infoevt); + boost::statechart::result react(const QueryUnfound& q); boost::statechart::result react(const QueryState& q); void exit(); }; @@ -1478,6 +1514,7 @@ class PeeringState : public MissingLoc::MappingInfo { } void update_heartbeat_peers(); + void query_unfound(Formatter *f, string state); bool proc_replica_info( pg_shard_t from, const pg_info_t &oinfo, epoch_t send_epoch); void remove_down_peer_info(const OSDMapRef &osdmap); diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index fbcb64c72e84f..3b7f6338e2edb 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -1119,6 +1119,9 @@ void PrimaryLogPG::do_command( } f->close_section(); } + // Get possible locations of missing objects from pg information + PeeringState::QueryUnfound q(f.get()); + recovery_state.handle_event(q, 0); f->dump_bool("more", p != needs_recovery_map.end()); f->close_section(); } From 4a655868a2c025906c2fe01a5ac156a070421e15 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Sun, 13 Sep 2020 10:09:53 -0700 Subject: [PATCH 4/7] test: Fix typos in descriptions Signed-off-by: David Zafman --- qa/tasks/ec_lost_unfound.py | 2 +- qa/tasks/lost_unfound.py | 2 +- qa/tasks/rep_lost_unfound_delete.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qa/tasks/ec_lost_unfound.py b/qa/tasks/ec_lost_unfound.py index e12b6901cc470..71068692d0a47 100644 --- a/qa/tasks/ec_lost_unfound.py +++ b/qa/tasks/ec_lost_unfound.py @@ -14,7 +14,7 @@ def task(ctx, config): """ Test handling of lost objects on an ec pool. - A pretty rigid cluster is brought up andtested by this task + A pretty rigid cluster is brought up and tested by this task """ if config is None: config = {} diff --git a/qa/tasks/lost_unfound.py b/qa/tasks/lost_unfound.py index ab17a95dc30d0..213e3e68c349f 100644 --- a/qa/tasks/lost_unfound.py +++ b/qa/tasks/lost_unfound.py @@ -14,7 +14,7 @@ def task(ctx, config): """ Test handling of lost objects. - A pretty rigid cluseter is brought up andtested by this task + A pretty rigid cluster is brought up and tested by this task """ POOL = 'unfound_pool' if config is None: diff --git a/qa/tasks/rep_lost_unfound_delete.py b/qa/tasks/rep_lost_unfound_delete.py index d422a33bb46cd..893f76ea195a3 100644 --- a/qa/tasks/rep_lost_unfound_delete.py +++ b/qa/tasks/rep_lost_unfound_delete.py @@ -15,7 +15,7 @@ def task(ctx, config): """ Test handling of lost objects. - A pretty rigid cluseter is brought up andtested by this task + A pretty rigid cluster is brought up and tested by this task """ POOL = 'unfounddel_pool' if config is None: From 12b495b370f88b89a9e1be5b581e30f1bb56994c Mon Sep 17 00:00:00 2001 From: David Zafman Date: Tue, 28 Jul 2020 17:38:44 -0700 Subject: [PATCH 5/7] test: Test list_unfound with asserts to check for new fields Signed-off-by: David Zafman --- qa/tasks/lost_unfound.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qa/tasks/lost_unfound.py b/qa/tasks/lost_unfound.py index 213e3e68c349f..ec101b2041c33 100644 --- a/qa/tasks/lost_unfound.py +++ b/qa/tasks/lost_unfound.py @@ -142,6 +142,9 @@ def task(ctx, config): m = manager.list_pg_unfound(pg['pgid']) #log.info('%s' % m) assert m['num_unfound'] == pg['stat_sum']['num_objects_unfound'] + assert m['available_might_have_unfound'] == True + assert m['might_have_unfound'][0]['osd'] == "1" + assert m['might_have_unfound'][0]['status'] == "osd is down" num_unfound=0 for o in m['objects']: if len(o['locations']) == 0: From 5b0ba0e5a8eee4aa7e5d80c5e6f4d5dd97170012 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Tue, 4 Aug 2020 14:03:16 -0700 Subject: [PATCH 6/7] test: Modify test to check new feature might_have_unfound added to list_unfound Signed-off-by: David Zafman --- .../erasure-code/test-erasure-eio.sh | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/qa/standalone/erasure-code/test-erasure-eio.sh b/qa/standalone/erasure-code/test-erasure-eio.sh index d46be6e6254d8..5ee7e3a9f6c9a 100755 --- a/qa/standalone/erasure-code/test-erasure-eio.sh +++ b/qa/standalone/erasure-code/test-erasure-eio.sh @@ -524,6 +524,7 @@ function TEST_ec_backfill_unfound() { ceph pg dump pgs rados_put $dir $poolname $objname || return 1 + local primary=$(get_primary $poolname $objname) local -a initial_osds=($(get_osds $poolname $objname)) local last_osd=${initial_osds[-1]} @@ -558,8 +559,26 @@ function TEST_ec_backfill_unfound() { done ceph pg dump pgs + kill_daemons $dir TERM osd.${last_osd} 2>&2 < /dev/null || return 1 + sleep 5 + + ceph pg dump pgs + ceph pg 2.0 list_unfound + ceph pg 2.0 query + ceph pg 2.0 list_unfound | grep -q $testobj || return 1 + check=$(ceph pg 2.0 list_unfound | jq ".available_might_have_unfound") + test "$check" == "true" || return 1 + + eval check=$(ceph pg 2.0 list_unfound | jq .might_have_unfound[0].status) + test "$check" == "osd is down" || return 1 + + eval check=$(ceph pg 2.0 list_unfound | jq .might_have_unfound[0].osd) + test "$check" == "2(4)" || return 1 + + activate_osd $dir ${last_osd} || return 1 + # Command should hang because object is unfound timeout 5 rados -p $poolname get $testobj $dir/CHECK test $? = "124" || return 1 @@ -638,8 +657,17 @@ function TEST_ec_recovery_unfound() { done ceph pg dump pgs + ceph pg 2.0 list_unfound + ceph pg 2.0 query + ceph pg 2.0 list_unfound | grep -q $testobj || return 1 + check=$(ceph pg 2.0 list_unfound | jq ".available_might_have_unfound") + test "$check" == "true" || return 1 + + check=$(ceph pg 2.0 list_unfound | jq ".might_have_unfound | length") + test $check == 0 || return 1 + # Command should hang because object is unfound timeout 5 rados -p $poolname get $testobj $dir/CHECK test $? = "124" || return 1 From bb5058074d346941cc72000a9d1f65f29d940f86 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Mon, 14 Sep 2020 17:11:07 -0700 Subject: [PATCH 7/7] doc: Add doc and PendingRealeaseNotes Add help about new list_unfound fields in troubleshooting-pg.rst Add info in PendingReleaseNotes Signed-off-by: David Zafman --- PendingReleaseNotes | 4 ++ .../troubleshooting/troubleshooting-pg.rst | 59 ++++++++++++++----- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index a2d176c331972..9f12dbdf9f68c 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -160,3 +160,7 @@ * fs: "fs authorize" now sets MON cap to "allow fsname=" instead of setting it to "allow r" all the time. + +* ``ceph pg #.# list_unfound`` output has been enhanced to provide + might_have_unfound information which indicates which OSDs may + contain the unfound objects. diff --git a/doc/rados/troubleshooting/troubleshooting-pg.rst b/doc/rados/troubleshooting/troubleshooting-pg.rst index 42ff0b335b954..6b4bb0efe541c 100644 --- a/doc/rados/troubleshooting/troubleshooting-pg.rst +++ b/doc/rados/troubleshooting/troubleshooting-pg.rst @@ -215,28 +215,55 @@ First, you can identify which objects are unfound with:: .. code-block:: javascript - { "offset": { "oid": "", - "key": "", - "snapid": 0, - "hash": 0, - "max": 0}, - "num_missing": 0, - "num_unfound": 0, - "objects": [ - { "oid": "object 1", - "key": "", - "hash": 0, - "max": 0 }, - ... - ], - "more": 0} + { + "num_missing": 1, + "num_unfound": 1, + "objects": [ + { + "oid": { + "oid": "object", + "key": "", + "snapid": -2, + "hash": 2249616407, + "max": 0, + "pool": 2, + "namespace": "" + }, + "need": "43'251", + "have": "0'0", + "flags": "none", + "clean_regions": "clean_offsets: [], clean_omap: 0, new_object: 1", + "locations": [ + "0(3)", + "4(2)" + ] + } + ], + "state": "NotRecovering", + "available_might_have_unfound": true, + "might_have_unfound": [ + { + "osd": "2(4)", + "status": "osd is down" + } + ], + "more": false + } If there are too many objects to list in a single result, the ``more`` field will be true and you can query for more. (Eventually the command line tool will hide this from you, but not yet.) Second, you can identify which OSDs have been probed or might contain -data:: +data. + +At the end of the listing (before ``more`` is false), ``might_have_unfound`` is provided +when ``available_might_have_unfound`` is true. This is equivalent to the output +of ``ceph pg #.# query``. This eliminates the need to use ``query`` directly. +The ``might_have_unfound`` information given behaves the same way as described below for ``query``. +The only difference is that OSDs that have ``already probed`` status are ignored. + +Use of ``query``:: ceph pg 2.4 query