Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/rgw/rgw_lc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you want to make "lc process" process all items of lc objects multi-times a day, you can modify this configuration item from "rgw_lc_debug_interval" to "rgw_lc_process_interval". How do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means this function is not just a debug function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think debug is more proper. If you set ExipationDays = 1, it means those objects will expire a day later. By setting rgw_lc_debug_interval, the objects will expire 1*rgw_lc_debug_interval. It just for debug.

Here just to make sure in a debug_interval bucket_lc_prepare only do once.

return true;
else
return false;
}

bdt.tm_hour = 0;
Expand Down Expand Up @@ -667,13 +669,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()
Expand Down