]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cloud restore : add None type for cloud-s3-glacier
authorJiffin Tony Thottan <thottanjiffin@gmail.com>
Tue, 24 Jun 2025 06:19:41 +0000 (11:49 +0530)
committerThomas Serlin <tserlin@redhat.com>
Mon, 22 Sep 2025 19:18:18 +0000 (15:18 -0400)
AWS supports various glacier conf options such as Standard, Expetided
to restore object with in a time period. Theses options may not be supported in
other S3 servers. So introducing option NoTier, so other vendors can be supported.

Resolves: rhbz#2365095

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
(cherry picked from commit a6e199398e6886806037467ae16bdef55f77b6c8)

doc/radosgw/cloud-restore.rst
src/rgw/driver/rados/rgw_lc_tier.cc
src/rgw/driver/rados/rgw_zone.cc
src/rgw/rgw_zone.cc
src/rgw/rgw_zone_types.h

index 63a7d59ffa05d1531b3d559281c170e151abbd5b..d546bc59d1dda09846e2e80be75571f36f807437 100644 (file)
@@ -92,10 +92,12 @@ the following configurables should be set accordingly:
 
 The duration for which the objects are to be restored on the remote cloud service.
 
-* ``glacier_restore_tier_type`` (``Standard`` | ``Expedited``)
+* ``glacier_restore_tier_type`` (``Standard`` | ``Expedited`` | ``NoTier``)
 
 The type of retrieval within the cloud service, which may represent different
-pricing. Supported options are ``Standard`` and ``Expedited``.
+pricing. Supported options are ``Standard``, ``Expedited`` and ``NoTier``.
+
+``NoTier`` for the s3 servers which does not follow options in ``Tier`` as per s3 protocol.
 
 
 For example:
index 7c2628d10314c8a695d3de0fba2ebc6de09fc81f..91ffeb5d2cf63aacdfd28e0cce1ae7e1d0472c2c 100644 (file)
@@ -1019,8 +1019,10 @@ int cloud_tier_restore(const DoutPrefixProvider *dpp, RGWRESTConn& dest_conn,
   bufferlist bl, out_bl;
   string resource = obj_to_aws_path(dest_obj);
 
-  const std::string tier_v = (glacier_params.glacier_restore_tier_type == GlacierRestoreTierType::Expedited) ? "Expedited" : "Standard";
-
+  std::optional<std::string> tier_v;
+  if (glacier_params.glacier_restore_tier_type != GlacierRestoreTierType::NoTier) {
+    tier_v = (glacier_params.glacier_restore_tier_type == GlacierRestoreTierType::Expedited) ? "Expedited" : "Standard";
+  }
   struct RestoreRequest {
          std::optional<uint64_t> days;
          std::optional<std::string> tier;
index c71656838df2c601e4bb13706123e3683963f6b4..79f97aeb794107f06911919d16665a4c012c84e3 100644 (file)
@@ -1537,10 +1537,12 @@ int RGWZoneGroupTierS3Glacier::update_params(const JSONFormattable& config)
   if (config.exists("glacier_restore_tier_type")) {
     string s;
     s = config["glacier_restore_tier_type"];
-    if (s != "Expedited") {
-      glacier_restore_tier_type = Standard;
-    } else {
+    if (s == "Expedited") {
       glacier_restore_tier_type = Expedited;
+    } else if (s == "NoTier") {
+      glacier_restore_tier_type = NoTier;
+    } else {
+      glacier_restore_tier_type = Standard;
     }
   }
   return 0;
index 90ff7cef106c4ccf2776468c03efb8a4145fb363..321ad138526d61963bc2cc3ab0307fd67742cdbc 100644 (file)
@@ -907,7 +907,14 @@ void RGWZoneStorageClasses::decode_json(JSONObj *obj)
 void RGWZoneGroupTierS3Glacier::dump(Formatter *f) const
 {
   encode_json("glacier_restore_days", glacier_restore_days, f);
-  string s = (glacier_restore_tier_type == Standard ? "Standard" : "Expedited");
+  string s;
+  if (glacier_restore_tier_type == Expedited) {
+    s = "Expedited";
+  } else if (glacier_restore_tier_type == NoTier) {
+    s = "NoTier";
+  } else {
+    s = "Standard";
+  }
   encode_json("glacier_restore_tier_type", s, f);
 }
 
@@ -916,10 +923,12 @@ void RGWZoneGroupTierS3Glacier::decode_json(JSONObj *obj)
   JSONDecoder::decode_json("glacier_restore_days", glacier_restore_days, obj);
   string s;
   JSONDecoder::decode_json("glacier_restore_tier_type", s, obj);
-  if (s != "Expedited") {
-    glacier_restore_tier_type = Standard;
-  } else {
+  if (s == "Expedited") {
     glacier_restore_tier_type = Expedited;
+  } else if (s == "NoTier") {
+    glacier_restore_tier_type = NoTier;
+  } else {
+    glacier_restore_tier_type = Standard;
   }
 }
 
index d3cd73c9aa0584c2097bca509493c7a213440dca..02fc3fe0bed016747f862ed8b5a58a3f97105e32 100644 (file)
@@ -545,6 +545,7 @@ WRITE_CLASS_ENCODER(RGWZoneGroupPlacementTierS3)
 enum GlacierRestoreTierType : uint8_t {
   Standard = 0,
   Expedited = 1,
+  NoTier = 2,
 };
 
 struct RGWZoneGroupTierS3Glacier {