From 6bf2786d28bad9c5269d07e00142b57b287089f0 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Wed, 19 Jun 2019 14:43:38 -0400 Subject: [PATCH] rgw_file: introduce fast S3 Unix stats (immutable) For objects originating in S3/Swift, it is frequently acceptable to synthesize c/mtime and size stats from meta attributes in the RGW bucket index entry. Synthetic stat behavior is not compatible with mutation of file ownership and permissions via SETATTR. In future, current xattr-based, mutable, Unix stats may be moved to the bucket index. For now, use synthetic stats only when a new option rgw_nfs_s3_fast_attrs is present. Fixes: http://tracker.ceph.com/issues/40456 Signed-off-by: Matt Benjamin --- src/common/legacy_config_opts.h | 4 ++ src/common/options.cc | 6 +++ src/include/rados/rgw_file.h | 4 +- src/pybind/rgw/rgw.pyx | 15 ++++--- src/rgw/rgw_file.cc | 73 +++++++++++++++++++++++++++++---- src/rgw/rgw_file.h | 48 ++++++++++++++++++---- src/test/librgw_file.cc | 6 ++- src/test/librgw_file_aw.cc | 4 +- src/test/librgw_file_gp.cc | 5 ++- src/test/librgw_file_marker.cc | 7 ++-- src/test/librgw_file_nfsns.cc | 40 +++++++++--------- 11 files changed, 163 insertions(+), 49 deletions(-) diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 6f18e45c6b2..5156abd00c2 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1387,6 +1387,10 @@ OPTION(rgw_nfs_max_gc, OPT_INT) /* max gc events per cycle */ OPTION(rgw_nfs_write_completion_interval_s, OPT_INT) /* stateless (V3) * commit * delay */ +OPTION(rgw_nfs_s3_fast_attrs, OPT_BOOL) /* use fast S3 attrs from + * bucket index--currently + * assumes NFS mounts are + * immutable */ OPTION(rgw_zone, OPT_STR) // zone name OPTION(rgw_zone_root_pool, OPT_STR) // pool where zone specific info is stored diff --git a/src/common/options.cc b/src/common/options.cc index d967c934bf6..82c71b3a1f9 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -6063,6 +6063,12 @@ std::vector