Lock PGs on secondary OSDs to allow local reads and guarantee splitbrain prevention

This commit is contained in:
Vitaliy Filippov
2025-05-10 15:18:00 +03:00
parent 66dc116f60
commit b2416afb28
21 changed files with 676 additions and 175 deletions
+9 -10
View File
@@ -77,16 +77,7 @@ void osd_t::finish_op(osd_op_t *cur_op, int retval)
if (cur_op->op_data->pg_num > 0)
{
auto & pg = *cur_op->op_data->pg;
pg.inflight--;
assert(pg.inflight >= 0);
if ((pg.state & PG_STOPPING) && pg.inflight == 0 && !pg.flush_batch)
{
finish_stop_pg(pg);
}
else if ((pg.state & PG_REPEERING) && pg.inflight == 0 && !pg.flush_batch)
{
start_pg_peering(pg);
}
rm_inflight(pg);
}
assert(!cur_op->op_data->subops);
free(cur_op->op_data);
@@ -434,6 +425,14 @@ void osd_t::handle_primary_subop(osd_op_t *subop, osd_op_t *cur_op)
retval, expected, peer_osd
);
}
else if (opcode == OSD_OP_SEC_DELETE)
{
printf(
"delete subop to %jx:%jx v%ju failed on osd %jd: retval = %d (expected %d)\n",
subop->req.sec_del.oid.inode, subop->req.sec_del.oid.stripe, subop->req.sec_del.version,
peer_osd, retval, expected
);
}
else
{
printf(