Skip to content

Commit 5a04ecc

Browse files
authored
Merge pull request ceph#65465 from knrt10/wip-kautilya-renable-testmigration
crimson/osd: fix assertion fail in prepare_clone Reviewed-by: Ilya Dryomov <[email protected]> Reviewed-by: Matan Breizman <[email protected]>
2 parents 9e1d3f1 + f5ed57a commit 5a04ecc

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

src/crimson/osd/ops_executer.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,19 @@ class OpsExecuter {
450450

451451
version_t get_last_user_version() const;
452452

453+
bool has_cloning_ctx() const {
454+
return cloning_ctx != nullptr;
455+
}
456+
457+
const hobject_t& get_cloning_coid() const {
458+
ceph_assert(has_cloning_ctx());
459+
return cloning_ctx->coid;
460+
}
461+
462+
void reset_cloning_ctx() {
463+
cloning_ctx.reset();
464+
}
465+
453466
ObjectContextRef prepare_clone(
454467
const hobject_t& coid,
455468
const ObjectState& initial_obs);

src/crimson/osd/pg.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,8 +1155,19 @@ PG::run_executer_fut PG::run_executer(
11551155
{
11561156
LOG_PREFIX(PG::run_executer);
11571157
auto rollbacker = ox.create_rollbacker(
1158-
[obc_data = duplicate_obc_data(obc)](auto &obc) mutable {
1158+
[FNAME, obc_data = duplicate_obc_data(obc), &ox, this](auto &obc) mutable {
1159+
// First, revert the OBC state
11591160
obc->update_from(obc_data);
1161+
// Then clean up any prepared clone OBCs
1162+
if (ox.has_cloning_ctx()) {
1163+
const auto coid = ox.get_cloning_coid();
1164+
DEBUGDPP("cleaning up clone OBC for {} reqid={}",
1165+
FNAME, coid, ox.get_message().get_reqid());
1166+
// Use single-key clear by passing [coid, coid] to avoid impacting other clones
1167+
this->obc_registry.clear_range(coid, coid);
1168+
// Reset the cloning context directly
1169+
ox.reset_cloning_ctx();
1170+
}
11601171
});
11611172
auto rollback_on_error = seastar::defer([&rollbacker] {
11621173
rollbacker.rollback_obc_if_modified();

src/test/librbd/test_DeepCopy.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,6 @@ TEST_F(TestDeepCopy, CloneFlatten)
510510

511511
TEST_F(TestDeepCopy, Stress)
512512
{
513-
// https://tracker.ceph.com/issues/72042
514-
SKIP_IF_CRIMSON();
515513
test_stress();
516514
}
517515

@@ -609,8 +607,6 @@ TEST_F(TestDeepCopy, CloneFlatten_SmallerDstObjSize)
609607

610608
TEST_F(TestDeepCopy, Stress_SmallerDstObjSize)
611609
{
612-
// https://tracker.ceph.com/issues/72042
613-
SKIP_IF_CRIMSON();
614610
uint64_t order = m_src_ictx->order - 1 - rand() % 2;
615611
ASSERT_EQ(0, m_opts.set(RBD_IMAGE_OPTION_ORDER, order));
616612
uint64_t stripe_unit = m_src_ictx->stripe_unit >> 2;

src/test/librbd/test_Migration.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,8 +1103,6 @@ TEST_F(TestMigration, CloneFlatten)
11031103

11041104
TEST_F(TestMigration, TriggerAssertSnapcSeq)
11051105
{
1106-
// https://tracker.ceph.com/issues/72041
1107-
SKIP_IF_CRIMSON();
11081106
auto size = m_ictx->size;
11091107

11101108
write((size >> 1) + 0, 10, 'A');
@@ -1165,8 +1163,6 @@ TEST_F(TestMigration, AbortWithoutSnapshots) {
11651163
}
11661164

11671165
TEST_F(TestMigration, AbortWithSnapshots) {
1168-
// https://tracker.ceph.com/issues/72650
1169-
SKIP_IF_CRIMSON();
11701166
test_snaps();
11711167
migration_prepare(m_ioctx, m_image_name);
11721168
migration_status(RBD_IMAGE_MIGRATION_STATE_PREPARED);
@@ -1390,15 +1386,11 @@ TEST_F(TestMigration, Stress)
13901386

13911387
TEST_F(TestMigration, Stress2)
13921388
{
1393-
// https://tracker.ceph.com/issues/72705
1394-
SKIP_IF_CRIMSON();
13951389
test_stress2(false);
13961390
}
13971391

13981392
TEST_F(TestMigration, StressLive)
13991393
{
1400-
// https://tracker.ceph.com/issues/72709
1401-
SKIP_IF_CRIMSON();
14021394
test_stress2(true);
14031395
}
14041396

0 commit comments

Comments
 (0)