Merge pull request #17061 from shashalu/fix-rgw-lc

rgw: fix lc process only schdule the first item of lc objects

Reviewed-by: Casey Bodley <cbodley@redhat.com>
Reviewed-by: fang.yuxiang <fang.yuxiang@eisoo.com>
Reviewed-by: Amit Kumar <amitkuma@redhat.com>
Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
Reviewed-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>
This commit is contained in:
Yuri Weinstein 2017-09-13 08:28:24 -07:00 committed by GitHub
commit 06b8556f17

View File

@ -202,8 +202,10 @@ bool RGWLC::if_already_run_today(time_t& start_date)
localtime_r(&start_date, &bdt); localtime_r(&start_date, &bdt);
if (cct->_conf->rgw_lc_debug_interval > 0) { if (cct->_conf->rgw_lc_debug_interval > 0) {
/* We're debugging, so say we can run */ if (now - start_date < cct->_conf->rgw_lc_debug_interval)
return false; return true;
else
return false;
} }
bdt.tm_hour = 0; 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]); l.unlock(&store->lc_pool_ctx, obj_names[index]);
ret = bucket_lc_process(entry.first); ret = bucket_lc_process(entry.first);
bucket_lc_post(index, max_lock_secs, entry, ret); bucket_lc_post(index, max_lock_secs, entry, ret);
return 0; }while(1);
exit: exit:
l.unlock(&store->lc_pool_ctx, obj_names[index]); l.unlock(&store->lc_pool_ctx, obj_names[index]);
return 0; return 0;
}while(1);
} }
void RGWLC::start_processor() void RGWLC::start_processor()