Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
rgw: lock is not released when set sync marker is failed. #12197
I ran some tests with the following code to inject errors, and it's leading to an unexpected segfault.
+#if 1 + retcode = -ENOENT; // trigger early return +#else using WriteMarkerCR = RGWSimpleRadosWriteCR<rgw_meta_sync_marker>; yield call(new WriteMarkerCR(sync_env->async_rados, sync_env->store, pool, sync_env->shard_obj_name(shard_id), sync_marker)); +#endif
RGWMetaSyncShardCR::full_sync() yields for the new
yield lease_cr->go_down();, it has already set
sync_marker.state = rgw_meta_sync_marker::IncrementalSync. This means that when
RGWMetaSyncShardCR::operate() resumes, it calls into
RGWMetaSyncShardCR::incremental_sync() instead - so nothing after the
yield lease_cr->go_down(); gets executed. (without this error injection, the same is true for the
yield call(new WriteMarkerCR(...));)
I think we'll want to update and write a temporary sync marker here, and only apply the changes to our
sync_marker member variable once
full_sync() returns successfully. I'll introduce a separate PR to do that.
In the meantime, this PR can merge as is.
jenkins test this please (https://jenkins.ceph.com/job/ceph-pull-requests/15086/ has readable.sh error)