]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "rgw: reject PutBucketReplication on mismatched versioning and lock" 62637/head
authorShilpa Jagannath <smanjara@redhat.com>
Wed, 2 Apr 2025 18:14:35 +0000 (14:14 -0400)
committerShilpa Jagannath <smanjara@redhat.com>
Thu, 3 Apr 2025 18:43:55 +0000 (14:43 -0400)
This reverts commit 7e47deede0ba672dab8d2a26c807d8a32d46a73a.
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/rgw/rgw_rest_s3.cc
src/test/rgw/rgw_multi/tests.py

index 5f47260db7f78a6544272f0fb3db3bfb20554980..1b49b8e995c4e5a6d8a9bdefeb66eae7c2196d8f 100644 (file)
@@ -1356,28 +1356,6 @@ struct ReplicationConfiguration {
       }
       pipe->dest.bucket.emplace(dest_bk);
 
-      std::unique_ptr<rgw::sal::Bucket> dest_bucket;
-      if (int r = driver->load_bucket(s, *pipe->dest.bucket, &dest_bucket, s->yield); r < 0) {
-        if (r == -ENOENT) {
-          s->err.message = "Destination bucket must exist.";
-          return -EINVAL;
-        }
-
-        ldpp_dout(s, 0) << "ERROR: failed to load bucket info for bucket=" << *pipe->dest.bucket << " r=" << r << dendl;
-        return r;
-      }
-
-      // check versioning identicality
-      if (dest_bucket->get_info().versioned() != s->bucket->get_info().versioned()) {
-        s->err.message = "Versioning must be identical in source and destination buckets.";
-        return -EINVAL;
-      }
-      // check object lock identicality
-      if (dest_bucket->get_info().obj_lock_enabled() != s->bucket->get_info().obj_lock_enabled()) {
-        s->err.message = "Object lock must be identical in source and destination buckets.";
-        return -EINVAL;
-      }
-
       if (filter) {
         int r = filter->to_sync_pipe_filter(s->cct, &pipe->params.source.filter);
         if (r < 0) {
index 56c06fb7ce5aada98f979cb6e42b9cab5ede4d2e..c6aae4dc57af8221b1bc69a0363a74deba33eab8 100644 (file)
@@ -3916,64 +3916,3 @@ def test_bucket_replication_alt_user():
     # check that object exists in destination bucket
     k = get_key(dest, dest_bucket, objname)
     assert_equal(k.get_contents_as_string().decode('utf-8'), 'foo')
-
-@allow_bucket_replication
-def test_bucket_replication_reject_versioning_identical():
-    zonegroup = realm.master_zonegroup()
-    zonegroup_conns = ZonegroupConns(zonegroup)
-
-    source = zonegroup_conns.non_account_rw_zones[0]
-    dest = zonegroup_conns.non_account_rw_zones[1]
-
-    source_bucket = source.create_bucket(gen_bucket_name())
-    dest_bucket = dest.create_bucket(gen_bucket_name())
-    source.s3_client.put_bucket_versioning(
-        Bucket=source_bucket.name,
-        VersioningConfiguration={'Status': 'Enabled'}
-    )
-    zonegroup_meta_checkpoint(zonegroup)
-
-    # create replication configuration
-    e = assert_raises(ClientError,
-                      source.s3_client.put_bucket_replication,
-                      Bucket=source_bucket.name,
-                      ReplicationConfiguration={
-                          'Role': '',
-                          'Rules': [{
-                              'ID': 'rule1',
-                              'Status': 'Enabled',
-                              'Destination': {
-                                  'Bucket': f'arn:aws:s3:::{dest_bucket.name}',
-                              }
-                          }]
-                      })
-    assert e.response['ResponseMetadata']['HTTPStatusCode'] == 400
-
-@allow_bucket_replication
-def test_bucket_replicaion_reject_objectlock_identical():
-    zonegroup = realm.master_zonegroup()
-    zonegroup_conns = ZonegroupConns(zonegroup)
-
-    source = zonegroup_conns.non_account_rw_zones[0]
-    dest = zonegroup_conns.non_account_rw_zones[1]
-
-    source_bucket = source.create_bucket(gen_bucket_name())
-    dest_bucket_name = gen_bucket_name()
-    dest.s3_client.create_bucket(Bucket=dest_bucket_name, ObjectLockEnabledForBucket=True)
-    zonegroup_meta_checkpoint(zonegroup)
-
-    # create replication configuration
-    e = assert_raises(ClientError,
-                      source.s3_client.put_bucket_replication,
-                      Bucket=source_bucket.name,
-                      ReplicationConfiguration={
-                          'Role': '',
-                          'Rules': [{
-                              'ID': 'rule1',
-                              'Status': 'Enabled',
-                              'Destination': {
-                                  'Bucket': f'arn:aws:s3:::{dest_bucket_name}',
-                              }
-                          }]
-                      })
-    assert e.response['ResponseMetadata']['HTTPStatusCode'] == 400