using std::dec;
using std::hex;
+using std::less;
using std::list;
using std::make_pair;
using std::map;
#include "os/ObjectStore.h"
#include "common/inline_variant.h"
+using std::less;
using std::make_pair;
using std::map;
using std::pair;
friend class OSDSocketHook;
class OSDSocketHook *asok_hook;
using PGRefOrError = std::tuple<std::optional<PGRef>, int>;
- PGRefOrError locate_asok_target(const cmdmap_t& cmdmap, stringstream& ss, bool only_primary);
+ PGRefOrError locate_asok_target(const cmdmap_t& cmdmap,
+ std::stringstream& ss, bool only_primary);
int asok_route_to_pg(bool only_primary,
std::string_view prefix,
cmdmap_t cmdmap,
Formatter *f,
- stringstream& ss,
+ std::stringstream& ss,
const bufferlist& inbl,
bufferlist& outbl,
std::function<void(int, const std::string&, bufferlist&)> on_finish);
dout(10) << __func__ << " queued at: " << epoch_queued
<< (is_primary() ? " (primary)" : " (replica)") << dendl;
scrub_queued = false;
- forward_scrub_event(&ScrubPgIF::send_start_replica, epoch_queued, "StartReplica/nw"sv);
+ forward_scrub_event(&ScrubPgIF::send_start_replica, epoch_queued, "StartReplica/nw");
}
bool PG::ops_blocked_by_scrub() const
{
// a new scrub
scrub_queued = false;
- forward_scrub_event(&ScrubPgIF::initiate_regular_scrub, queued, "StartScrub"sv);
+ forward_scrub_event(&ScrubPgIF::initiate_regular_scrub, queued, "StartScrub");
}
/**
// a new scrub
scrub_queued = false;
forward_scrub_event(&ScrubPgIF::initiate_scrub_after_repair, queued,
- "AfterRepairScrub"sv);
+ "AfterRepairScrub");
}
void replica_scrub(epoch_t queued, ThreadPool::TPHandle &handle);
void replica_scrub_resched(epoch_t queued, ThreadPool::TPHandle& handle)
{
scrub_queued = false;
- forward_scrub_event(&ScrubPgIF::send_sched_replica, queued, "SchedReplica"sv);
+ forward_scrub_event(&ScrubPgIF::send_sched_replica, queued, "SchedReplica");
}
void scrub_send_resources_granted(epoch_t queued, ThreadPool::TPHandle& handle)
{
- forward_scrub_event(&ScrubPgIF::send_remotes_reserved, queued, "RemotesReserved"sv);
+ forward_scrub_event(&ScrubPgIF::send_remotes_reserved, queued, "RemotesReserved");
}
void scrub_send_resources_denied(epoch_t queued, ThreadPool::TPHandle& handle)
{
forward_scrub_event(&ScrubPgIF::send_reservation_failure, queued,
- "ReservationFailure"sv);
+ "ReservationFailure");
}
void scrub_send_scrub_resched(epoch_t queued, ThreadPool::TPHandle& handle)
{
scrub_queued = false;
- forward_scrub_event(&ScrubPgIF::send_scrub_resched, queued, "InternalSchedScrub"sv);
+ forward_scrub_event(&ScrubPgIF::send_scrub_resched, queued, "InternalSchedScrub");
}
void scrub_send_pushes_update(epoch_t queued, ThreadPool::TPHandle& handle)
{
forward_scrub_event(&ScrubPgIF::active_pushes_notification, queued,
- "ActivePushesUpd"sv);
+ "ActivePushesUpd");
}
void scrub_send_applied_update(epoch_t queued, ThreadPool::TPHandle& handle)
{
forward_scrub_event(&ScrubPgIF::update_applied_notification, queued,
- "UpdatesApplied"sv);
+ "UpdatesApplied");
}
void scrub_send_unblocking(epoch_t queued, ThreadPool::TPHandle& handle)
{
- forward_scrub_event(&ScrubPgIF::send_scrub_unblock, queued, "Unblocked"sv);
+ forward_scrub_event(&ScrubPgIF::send_scrub_unblock, queued, "Unblocked");
}
void scrub_send_digest_update(epoch_t queued, ThreadPool::TPHandle& handle)
{
- forward_scrub_event(&ScrubPgIF::digest_update_notification, queued, "DigestUpdate"sv);
+ forward_scrub_event(&ScrubPgIF::digest_update_notification, queued, "DigestUpdate");
}
void scrub_send_local_map_ready(epoch_t queued, ThreadPool::TPHandle& handle)
{
- forward_scrub_event(&ScrubPgIF::send_local_map_done, queued, "IntLocalMapDone"sv);
+ forward_scrub_event(&ScrubPgIF::send_local_map_done, queued, "IntLocalMapDone");
}
void scrub_send_replmaps_ready(epoch_t queued, ThreadPool::TPHandle& handle)
{
- forward_scrub_event(&ScrubPgIF::send_replica_maps_ready, queued, "GotReplicas"sv);
+ forward_scrub_event(&ScrubPgIF::send_replica_maps_ready, queued, "GotReplicas");
}
void scrub_send_replica_pushes(epoch_t queued, ThreadPool::TPHandle& handle)
{
forward_scrub_event(&ScrubPgIF::send_replica_pushes_upd, queued,
- "ReplicaPushesUpd"sv);
+ "ReplicaPushesUpd");
}
void scrub_send_maps_compared(epoch_t queued, ThreadPool::TPHandle& handle)
{
- forward_scrub_event(&ScrubPgIF::send_maps_compared, queued, "MapsCompared"sv);
+ forward_scrub_event(&ScrubPgIF::send_maps_compared, queued, "MapsCompared");
}
void scrub_send_get_next_chunk(epoch_t queued, ThreadPool::TPHandle& handle)
{
- forward_scrub_event(&ScrubPgIF::send_get_next_chunk, queued, "NextChunk"sv);
+ forward_scrub_event(&ScrubPgIF::send_get_next_chunk, queued, "NextChunk");
}
void scrub_send_scrub_is_finished(epoch_t queued, ThreadPool::TPHandle& handle)
{
- forward_scrub_event(&ScrubPgIF::send_scrub_is_finished, queued, "ScrubFinished"sv);
+ forward_scrub_event(&ScrubPgIF::send_scrub_is_finished, queued, "ScrubFinished");
}
void scrub_send_chunk_free(epoch_t queued, ThreadPool::TPHandle& handle)
{
- forward_scrub_event(&ScrubPgIF::send_chunk_free, queued, "SelectedChunkFree"sv);
+ forward_scrub_event(&ScrubPgIF::send_chunk_free, queued, "SelectedChunkFree");
}
void scrub_send_chunk_busy(epoch_t queued, ThreadPool::TPHandle& handle)
{
- forward_scrub_event(&ScrubPgIF::send_chunk_busy, queued, "ChunkIsBusy"sv);
+ forward_scrub_event(&ScrubPgIF::send_chunk_busy, queued, "ChunkIsBusy");
}
void reg_next_scrub();
#include "messages/MOSDPGRecoveryDelete.h"
#include "messages/MOSDPGRecoveryDeleteReply.h"
+using std::less;
using std::list;
using std::make_pair;
using std::map;
using std::ostream;
using std::pair;
using std::set;
+using std::string;
using std::stringstream;
using std::vector;
}
void update_heartbeat_peers();
- void query_unfound(Formatter *f, string state);
+ void query_unfound(Formatter *f, std::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);
std::set<pg_shard_t> *acting_backfill,
std::ostream &ss);
- static std::pair<map<pg_shard_t, pg_info_t>::const_iterator, eversion_t>
+ static std::pair<std::map<pg_shard_t, pg_info_t>::const_iterator, eversion_t>
select_replicated_primary(
- map<pg_shard_t, pg_info_t>::const_iterator auth_log_shard,
+ std::map<pg_shard_t, pg_info_t>::const_iterator auth_log_shard,
uint64_t force_auth_primary_missing_objects,
const std::vector<int> &up,
pg_shard_t up_primary,
- const map<pg_shard_t, pg_info_t> &all_info,
+ const std::map<pg_shard_t, pg_info_t> &all_info,
const OSDMapRef osdmap,
- ostream &ss);
+ std::ostream &ss);
static void calc_replicated_acting(
- map<pg_shard_t, pg_info_t>::const_iterator primary_shard,
+ std::map<pg_shard_t, pg_info_t>::const_iterator primary_shard,
eversion_t oldest_auth_log_entry,
unsigned size,
const std::vector<int> &acting,
const PGPool& pool,
std::ostream &ss);
static void calc_replicated_acting_stretch(
- map<pg_shard_t, pg_info_t>::const_iterator primary_shard,
+ std::map<pg_shard_t, pg_info_t>::const_iterator primary_shard,
eversion_t oldest_auth_log_entry,
unsigned size,
const std::vector<int> &acting,
MEMPOOL_DEFINE_OBJECT_FACTORY(PrimaryLogPG, replicatedpg, osd);
+using std::less;
using std::list;
using std::ostream;
using std::pair;
using std::make_pair;
+using std::make_unique;
using std::map;
using std::ostringstream;
using std::set;
cls_cas_chunk_create_or_get_ref_op get_call;
get_call.source = src_soid.get_head();
ceph_assert(chunk);
- get_call.data = move(*chunk);
+ get_call.data = std::move(*chunk);
::encode(get_call, in);
obj_op.call("cas", "chunk_create_or_get_ref", in);
} else {
}
C_SetDedupChunks *fin = new C_SetDedupChunks(this, soid, get_last_peering_reset(), p.first);
ceph_tid_t tid = refcount_manifest(soid, target, refcount_t::CREATE_OR_GET_REF,
- fin, move(chunks[p.first]));
+ fin, std::move(chunks[p.first]));
mop->chunks[target] = make_pair(p.first, p.second.length());
mop->num_chunks++;
mop->tids[p.first] = tid;
bufferlist chunk;
chunk.substr_of(bl, p.first, p.second);
hobject_t target = get_fpoid_from_chunk(oi.soid, chunk);
- chunks[p.first] = move(chunk);
+ chunks[p.first] = std::move(chunk);
chunk_map[p.first] = chunk_info_t(0, p.second, target);
total_length += p.second;
}
OpRequestRef op;
std::map<uint64_t, int> results;
std::map<uint64_t, ceph_tid_t> tids;
- std::map<hobject_t, pair<uint64_t, uint64_t>> chunks;
+ std::map<hobject_t, std::pair<uint64_t, uint64_t>> chunks;
uint64_t num_chunks = 0;
object_manifest_t new_manifest;
// -- cls_gather --
std::map<hobject_t, CLSGatherOp> cls_gather_ops;
- void cancel_cls_gather(map<hobject_t,CLSGatherOp>::iterator iter, bool requeue, std::vector<ceph_tid_t> *tids);
+ void cancel_cls_gather(std::map<hobject_t,CLSGatherOp>::iterator iter, bool requeue, std::vector<ceph_tid_t> *tids);
void cancel_cls_gather_ops(bool requeue, std::vector<ceph_tid_t> *tids);
// -- scrub --
void process_copy_chunk_manifest(hobject_t oid, ceph_tid_t tid, int r, uint64_t offset);
void finish_promote_manifest(int r, CopyResults *results, ObjectContextRef obc);
void cancel_and_requeue_proxy_ops(hobject_t oid);
- void cancel_manifest_ops(bool requeue, vector<ceph_tid_t> *tids);
+ void cancel_manifest_ops(bool requeue, std::vector<ceph_tid_t> *tids);
ceph_tid_t refcount_manifest(hobject_t src_soid, hobject_t tgt_soid, refcount_t type,
Context *cb, std::optional<bufferlist> chunk);
void dec_all_refcount_manifest(const object_info_t& oi, OpContext* ctx);
#undef dout_prefix
#define dout_prefix _prefix(_dout, this->m_pg)
+using std::vector;
+
template <class T> static ostream& _prefix(std::ostream* _dout, T* t)
{
return t->gen_prefix(*_dout) << " PrimaryLog scrubber pg(" << t->pg_id << ") ";
return pgb->get_parent()->gen_dbg_prefix(*_dout);
}
+using std::less;
using std::list;
using std::make_pair;
using std::map;
using std::pair;
using std::ostream;
using std::set;
+using std::vector;
using ceph::bufferlist;
using ceph::decode;
using std::ostream;
using std::pair;
using std::set;
+using std::shared_ptr;
using std::string;
using std::unique_ptr;
using std::vector;
return peering_crush_bucket_count != 0;
}
- bool stretch_set_can_peer(const set<int>& want, const OSDMap& osdmap,
+ bool stretch_set_can_peer(const std::set<int>& want, const OSDMap& osdmap,
std::ostream *out) const;
- bool stretch_set_can_peer(const vector<int>& want, const OSDMap& osdmap,
+ bool stretch_set_can_peer(const std::vector<int>& want, const OSDMap& osdmap,
std::ostream *out) const {
if (!is_stretch_pool()) return true;
- set<int> swant;
+ std::set<int> swant;
for (auto i : want) swant.insert(i);
return stretch_set_can_peer(swant, osdmap, out);
}
#include "ScrubStore.h"
#include "scrub_machine.h"
+using std::list;
+using std::map;
+using std::pair;
+using std::set;
+using std::stringstream;
+using std::vector;
using namespace Scrub;
using namespace std::chrono;
using namespace std::chrono_literals;
-
+using namespace std::literals;
#define dout_context (m_pg->cct)
#define dout_subsys ceph_subsys_osd
void PgScrubber::update_op_mode_text()
{
auto visible_repair = state_test(PG_STATE_REPAIR);
- m_mode_desc = (visible_repair ? "repair"sv : (m_is_deep ? "deep-scrub"sv : "scrub"sv));
+ m_mode_desc = (visible_repair ? "repair" : (m_is_deep ? "deep-scrub" : "scrub"));
dout(10) << __func__ << ": repair: visible: " << (visible_repair ? "true" : "false")
<< ", internal: " << (m_is_repair ? "true" : "false")
int asok_debug(std::string_view cmd,
std::string param,
Formatter* f,
- stringstream& ss) override;
+ std::stringstream& ss) override;
int m_debug_blockrange{0};
// -------------------------------------------------------------------------------------------
#include "recovery_types.h"
-ostream& operator<<(ostream& out, const BackfillInterval& bi)
+std::ostream& operator<<(std::ostream& out, const BackfillInterval& bi)
{
out << "BackfillInfo(" << bi.begin << "-" << bi.end
<< " " << bi.objects.size() << " objects";
bool check_repair{false};
};
-ostream& operator<<(ostream& out, const requested_scrub_t& sf);
+std::ostream& operator<<(std::ostream& out, const requested_scrub_t& sf);
/**
* The interface used by the PG when requesting scrub-related info or services
virtual ~ScrubPgIF() = default;
- friend ostream& operator<<(ostream& out, const ScrubPgIF& s) { return s.show(out); }
+ friend std::ostream& operator<<(std::ostream& out, const ScrubPgIF& s) { return s.show(out); }
- virtual ostream& show(ostream& out) const = 0;
+ virtual std::ostream& show(std::ostream& out) const = 0;
// --------------- triggering state-machine events:
virtual int asok_debug(std::string_view cmd,
std::string param,
Formatter* f,
- stringstream& ss) = 0;
+ std::stringstream& ss) = 0;
};