From fd207447d1acebbf7a62c0d03b3ec9025ac19fbd Mon Sep 17 00:00:00 2001 From: "lu.shasha" Date: Thu, 17 Aug 2017 16:02:02 +0800 Subject: [PATCH] rgw: fix lc process only schdule the first item of lc objects If more than two bucket hash to the same lc object, only the first bucket will do lifecycle operation. Other buckets lifecycle will never be schduled. Fixes: http://tracker.ceph.com/issues/21022 Signed-off-by: Shasha Lu (cherry picked from commit 9561dc0a903d9021f64857762e73887ffe46c28e) --- src/rgw/rgw_lc.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index cad0304e352..cdcfaffff77 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -202,8 +202,10 @@ bool RGWLC::if_already_run_today(time_t& start_date) localtime_r(&start_date, &bdt); if (cct->_conf->rgw_lc_debug_interval > 0) { - /* We're debugging, so say we can run */ - return false; + if (now - start_date < cct->_conf->rgw_lc_debug_interval) + return true; + else + return false; } bdt.tm_hour = 0; @@ -674,13 +676,11 @@ int RGWLC::process(int index, int max_lock_secs) l.unlock(&store->lc_pool_ctx, obj_names[index]); ret = bucket_lc_process(entry.first); bucket_lc_post(index, max_lock_secs, entry, ret); - return 0; + }while(1); + exit: l.unlock(&store->lc_pool_ctx, obj_names[index]); return 0; - - }while(1); - } void RGWLC::start_processor() -- 2.47.3