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_file: add timed namespace invalidation #13038

Merged
merged 1 commit into from Jan 24, 2017

Conversation

Projects
None yet
2 participants
@mattbenjamin
Contributor

mattbenjamin commented Jan 21, 2017

With change, librgw/rgw_file consumers can provide an invalidation
callback, which is used by the library to invalidate directories
whose contents should be forgotten.

The existing RGWLib GC mechanism is being used to drive this. New
configuration params have been added. The main configurable is
rgw_nfs_namespace_expire_secs, the expire timeout.

Signed-off-by: Matt Benjamin mbenjamin@redhat.com

auto expire_s = cct->_conf->rgw_nfs_namespace_expire_secs;
/* delay between gc cycles */
auto delay_s = std::max(1, std::min(120, expire_s/2));

This comment has been minimized.

@yehudasa

yehudasa Jan 24, 2017

Member

@mattbenjamin put magic 120 in #define

This comment has been minimized.

@mattbenjamin
switch (ev.t) {
case RGWLibFS::event::type::READDIR:
os << "type=READDIR;";
break;

This comment has been minimized.

@yehudasa

yehudasa Jan 24, 2017

Member

default: os << "type=<unknown>"?

This comment has been minimized.

@mattbenjamin
@@ -660,11 +662,15 @@ namespace rgw {
do {
{
lock_guard guard(state.mtx); /* LOCKED */
/* just return if we emptied events */
if (events.size() == 0) {

This comment has been minimized.

@yehudasa

yehudasa Jan 24, 2017

Member

nit events.empty() should also work

This comment has been minimized.

@mattbenjamin

mattbenjamin Jan 24, 2017

Contributor

they are synomyms

This comment has been minimized.

@mattbenjamin

mattbenjamin Jan 24, 2017

Contributor

if empty is prettier, can use that

@@ -762,6 +751,10 @@ namespace rgw {
lock_guard guard(mtx);
events.push_back(ev);
}
void push_event(const event& ev, unique_lock& guard) {

This comment has been minimized.

@yehudasa

yehudasa Jan 24, 2017

Member

@mattbenjamin method is a bit confusing, as guard is not used here. Maybe just call it differently?

This comment has been minimized.

@mattbenjamin

mattbenjamin Jan 24, 2017

Contributor

I do call with the unique_lock& argument in rgw_file.cc, l. 770 and 782

This comment has been minimized.

@mattbenjamin

mattbenjamin Jan 24, 2017

Contributor

oh, I see, ok--I should use my own helper method; or rather, I could at least use unique_lock consistently...

This comment has been minimized.

@mattbenjamin

mattbenjamin Jan 24, 2017

Contributor

oh, ok, nm; you're right, should just elide the unused arg

void stop() {
shutdown = true;
for (const auto& fs: mounted_fs) {

This comment has been minimized.

@yehudasa

yehudasa Jan 24, 2017

Member

@mattbenjamin is this part of this change, or does it merit a separate commit?

This comment has been minimized.

@mattbenjamin

mattbenjamin Jan 24, 2017

Contributor

yes, basically (I mean I think it's simplest to include it); the reasoning is, this feature existed, but was not correctly covering the mounted fs set, iirc

@mattbenjamin

This comment has been minimized.

Contributor

mattbenjamin commented Jan 24, 2017

@yehudasa this is blocking a downstream bz 1359403

rgw_file: add timed namespace invalidation
With change, librgw/rgw_file consumers can provide an invalidation
callback, which is used by the library to invalidate directories
whose contents should be forgotten.

The existing RGWLib GC mechanism is being used to drive this.  New
configuration params have been added.  The main configurable is
rgw_nfs_namespace_expire_secs, the expire timeout.

Updated post Yehuda review.

Fixes: http://tracker.ceph.com/issues/18651

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>

@yehudasa yehudasa self-requested a review Jan 24, 2017

@yehudasa

lgtm

@mattbenjamin mattbenjamin merged commit 748f0a6 into ceph:master Jan 24, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment