Skip to content

Commit

Permalink
rgw: wakeup lease_cr after abort on bucket sync disable
Browse files Browse the repository at this point in the history
the 'bucket sync disable' tests were causing data sync to lag behind
because these calls to lease_cr->abort() were still waiting for the
RGWContinuousLeaseCR to wake up from its sleep. added data sync
checkpoints to each 'bucket sync disable' test to make sure that data
sync catches up before running other tests, as this was causing failures
in the new 'datalog autotrim' test

Signed-off-by: Casey Bodley <cbodley@redhat.com>
  • Loading branch information
cbodley committed Feb 19, 2019
1 parent 2bd1595 commit 14c4303
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rgw/rgw_data_sync.cc
Expand Up @@ -3230,7 +3230,9 @@ int RGWRunBucketSyncCoroutine::operate()
yield call(new RGWInitBucketShardSyncStatusCoroutine(sync_env, bs, sync_status));
if (retcode == -ENOENT) {
tn->log(0, "bucket sync disabled");
lease_cr->abort(); // deleted lease object, abort instead of unlock
lease_cr->abort(); // deleted lease object, abort/wakeup instead of unlock
lease_cr->wakeup();
lease_cr.reset();
drain_all();
return set_cr_done();
}
Expand Down
6 changes: 6 additions & 0 deletions src/test/rgw/rgw_multi/tests.py
Expand Up @@ -1095,6 +1095,8 @@ def test_bucket_sync_disable():
for zone in zonegroup.zones:
check_buckets_sync_status_obj_not_exist(zone, buckets)

zonegroup_data_checkpoint(zonegroup_conns)

def test_bucket_sync_enable_right_after_disable():
zonegroup = realm.master_zonegroup()
zonegroup_conns = ZonegroupConns(zonegroup)
Expand Down Expand Up @@ -1125,6 +1127,8 @@ def test_bucket_sync_enable_right_after_disable():
for bucket_name in buckets:
zonegroup_bucket_checkpoint(zonegroup_conns, bucket_name)

zonegroup_data_checkpoint(zonegroup_conns)

def test_bucket_sync_disable_enable():
zonegroup = realm.master_zonegroup()
zonegroup_conns = ZonegroupConns(zonegroup)
Expand Down Expand Up @@ -1161,6 +1165,8 @@ def test_bucket_sync_disable_enable():
for bucket_name in buckets:
zonegroup_bucket_checkpoint(zonegroup_conns, bucket_name)

zonegroup_data_checkpoint(zonegroup_conns)

def test_multipart_object_sync():
zonegroup = realm.master_zonegroup()
zonegroup_conns = ZonegroupConns(zonegroup)
Expand Down

0 comments on commit 14c4303

Please sign in to comment.