]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/dedup: tech preview for full object dedup support which means duplicate objects
authorGabriel BenHanokh <gbenhano@redhat.com>
Mon, 30 Jun 2025 13:01:14 +0000 (13:01 +0000)
committerGabriel BenHanokh <gbenhano@redhat.com>
Tue, 29 Jul 2025 08:22:28 +0000 (08:22 +0000)
will be deleted (until now they were only reported)

Signed-off-by: Gabriel BenHanokh <gbenhano@redhat.com>
src/rgw/radosgw-admin/radosgw-admin.cc
src/rgw/rgw_dedup_utils.h
src/test/rgw/dedup/test_dedup.py

index 2a79d9d421ef3ca1d701dc1da7d5ec91b20b2bab..54246e68b8dfe0f6ca4f5548c93ee8ce27739302 100644 (file)
@@ -3652,6 +3652,7 @@ int main(int argc, const char **argv)
   int skip_zero_entries = false;  // log show
   int purge_keys = false;
   int yes_i_really_mean_it = false;
+  int tech_preview = false;
   int delete_child_objects = false;
   int fix = false;
   int remove_bad = false;
@@ -4112,6 +4113,8 @@ int main(int argc, const char **argv)
       // do nothing
     } else if (ceph_argparse_binary_flag(args, i, &yes_i_really_mean_it, NULL, "--yes-i-really-mean-it", (char*)NULL)) {
       // do nothing
+    } else if (ceph_argparse_binary_flag(args, i, &tech_preview, NULL, "--tech-preview", (char*)NULL)) {
+      // do nothing
     } else if (ceph_argparse_binary_flag(args, i, &fix, NULL, "--fix", (char*)NULL)) {
       // do nothing
     } else if (ceph_argparse_binary_flag(args, i, &remove_bad, NULL, "--remove-bad", (char*)NULL)) {
@@ -9237,6 +9240,18 @@ next:
        dedup_type = dedup_req_type_t::DEDUP_TYPE_ESTIMATE;
       }
       else {
+       if (!yes_i_really_mean_it) {
+         cerr << "Full Dedup is dangerous and could lead to data loss!\n"
+              << "do you really mean it? (requires --yes-i-really-mean-it)"
+              << std::endl;
+         return EINVAL;
+       }
+       if (!tech_preview) {
+         cerr << "Full Dedup is supplied as a tech-preview only and should not be used on production systems!\n"
+              << "Please acknowledge that you understand this is a tech preview (requires --tech-preview)"
+              << std::endl;
+         return EINVAL;
+       }
        dedup_type = dedup_req_type_t::DEDUP_TYPE_FULL;
 #ifndef FULL_DEDUP_SUPPORT
        std::cerr << "Only dedup estimate is supported!" << std::endl;
index 6a1d0fc0f45833b4ddf43788188c4f0c37c2e0bd..859724acdf7114552e45ea900a03cf1237d273fb 100644 (file)
@@ -23,7 +23,7 @@
 #include "include/encoding.h"
 #include "common/dout.h"
 
-//#define FULL_DEDUP_SUPPORT
+#define FULL_DEDUP_SUPPORT
 namespace rgw::dedup {
   using work_shard_t   = uint16_t;
   using md5_shard_t    = uint16_t;
index a339e25b6b417e14011e15685c2c39a8cf6b500d..d8b3540e2bea81109125c61b6221afca081711d1 100644 (file)
@@ -1076,7 +1076,7 @@ def exec_dedup_internal(expected_dedup_stats, dry_run, max_dedup_time):
         result = admin(['dedup', 'estimate'])
         reset_full_dedup_stats(expected_dedup_stats)
     else:
-        result = admin(['dedup', 'restart'])
+        result = admin(['dedup', 'restart', '--yes-i-really-mean-it', '--tech-preview'])
 
     assert result[1] == 0
     log.debug("wait for dedup to complete")
@@ -1308,14 +1308,14 @@ def check_full_dedup_state():
     global full_dedup_state_was_checked
     global full_dedup_state_disabled
     log.debug("check_full_dedup_state:: sending FULL Dedup request")
-    result = admin(['dedup', 'restart'])
+    result = admin(['dedup', 'restart', '--yes-i-really-mean-it', '--tech-preview'])
     if result[1] == 0:
-        log.debug("full dedup is enabled!")
+        log.info("full dedup is enabled!")
         full_dedup_state_disabled = False
         result = admin(['dedup', 'abort'])
         assert result[1] == 0
     else:
-        log.debug("full dedup is disabled, skip all full dedup tests")
+        log.info("full dedup is disabled, skip all full dedup tests")
         full_dedup_state_disabled = True
 
     full_dedup_state_was_checked = True