From 1727412761531ee3fcf898668187f4cc9e160957 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 (cherry picked from commit 6bf2786d28bad9c5269d07e00142b57b287089f0) Conflicts: src/common/options.cc src/pybind/rgw/rgw.pyx src/rgw/rgw_file.cc - no "MkObjResult RGWLibFS::symlink(...)" in mimic --- 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 | 70 +++++++++++++++++++++++++++++---- 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, 161 insertions(+), 48 deletions(-) diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index c0c00640ebbd..91c32f1e6a16 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1379,6 +1379,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 5f2c4e03a352..31b3d48ac6f8 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -5491,6 +5491,12 @@ std::vector