Skip to content

Commit 82ae96f

Browse files
committed
crimson/osd/pg: update PG stats on handle_rep_op
Fixes: https://tracker.ceph.com/issues/61761 Signed-off-by: Md Mahamudur Rahaman Sajib <[email protected]>
1 parent f25386f commit 82ae96f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/crimson/osd/pg.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,15 @@ PG::with_locked_obc(const hobject_t &hobj,
13661366
};
13671367
}
13681368

1369+
void PG::update_stats(const pg_stat_t &stat) {
1370+
peering_state.update_stats(
1371+
[&stat] (auto& history, auto& stats) {
1372+
stats = stat;
1373+
return false;
1374+
}
1375+
);
1376+
}
1377+
13691378
PG::interruptible_future<> PG::handle_rep_op(Ref<MOSDRepOp> req)
13701379
{
13711380
if (__builtin_expect(stopping, false)) {
@@ -1384,6 +1393,7 @@ PG::interruptible_future<> PG::handle_rep_op(Ref<MOSDRepOp> req)
13841393
auto p = req->logbl.cbegin();
13851394
std::vector<pg_log_entry_t> log_entries;
13861395
decode(log_entries, p);
1396+
update_stats(req->pg_stats);
13871397
log_operation(std::move(log_entries),
13881398
req->pg_trim_to,
13891399
req->version,

src/crimson/osd/pg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ class PG : public boost::intrusive_ref_counter<
517517
with_obc_func_t&& f);
518518

519519
interruptible_future<> handle_rep_op(Ref<MOSDRepOp> m);
520+
void update_stats(const pg_stat_t &stat);
520521
void log_operation(
521522
std::vector<pg_log_entry_t>&& logv,
522523
const eversion_t &trim_to,

src/crimson/osd/replicated_backend.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ ReplicatedBackend::_submit_transaction(std::set<pg_shard_t>&& pg_shards,
7070
encode(log_entries, m->logbl);
7171
m->pg_trim_to = osd_op_p.pg_trim_to;
7272
m->min_last_complete_ondisk = osd_op_p.min_last_complete_ondisk;
73+
m->pg_stats = pg.get_info().stats;
7374
// TODO: set more stuff. e.g., pg_states
7475
sends->emplace_back(
7576
shard_services.send_to_osd(

0 commit comments

Comments
 (0)