Bug #49446
openrgw: RGWLC::process() may starve some bucket LCs at the end of a lc.N
0%
Description
Current implementation of RGWLC::process() implicitly assumes that all
the buckets in one lc.N can be processed within one day.
So the following snippet will always reset the marker to the beginning
of a lc.N when the lc.N is processed for the first time in a day.
if(!if_already_run_today(head.start_date)) { head.start_date = now; head.marker.clear(); ret = bucket_lc_prepare(index); if (ret < 0) { ldpp_dout(this, 0) << "RGWLC::process() failed to update lc object " << obj_names[index] << ", ret=" << ret << dendl; goto exit; } }
However, this assumption may not be true, when the number of bucket
lifecycle configurations or the number of objects within buckets became
large enough. In these scenarios, the logic above may reset the marker
to the beginning when it was just pointing to some key in the middle of
lc.N. As a result, the bucket lifecycles after that key will get
no chance to be processed.
Maybe a more reasonable logic is that we should check whether the marker
is pointing to the end of a lc.N first. If yes, it is OK to reset.
But if it is not, the marker should be reserved.