Repository navigation
umbrella: rgw: stop leaving refcount tags behind on shared tails - #72821
Conversation
An appendable object writes each new part under its manifest's prefix. A copy or dedup target that shares another object's tails would append under that object's prefix. Copy the data when the source is appendable, and skip appendable objects at dedup ingress. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit e798c80) Conflicts: doc/radosgw/s3_objects_dedup.rst - umbrella lacks rgw_dedup_skip_compressed and always skips compressed objects in full dedup; kept umbrella's sentence and only added objects written with AppendObject to the skipped objects
fetch_remote_obj() and restore_obj_from_cloud() write new tail objects but keep the tail tag from the attrs they copy. An object fetched by sync can carry the tag of a copy in this zone, and every restore of a cloud object reuses the tag of its stub. Dedup can then add that tag back to older tails after a delete already removed it. Drop the tail tag from those attrs so the object keeps the tag its own write made. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit 1b2f8ee)
RGWBulkUploadOp and RGWPostObj write every file in a request with s->req_id as its tag, so all of those files share one tail tag. When dedup points two of them at the same tails they share a single ref, and deleting one of them and the source frees tails the other still uses. Add a random suffix to the request id so each file gets its own tag. Bulk upload files that are already written keep their shared tag. Dedup skips them only because their etag attr ends in a null byte. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit 71755a9)
Copying and deleting an object repeatedly keeps adding retired tags to its tails. We need those tags to stop a repeated put from removing the source object's wildcard reference. Record which source tag owns the wildcard. A put for another tag can then leave it alone, so tags only need to stay retired while the wildcard has no owner. Drop the retired tags once it has one or is gone, which also cleans up tails that already have them. An older osd would drop the owner when it rewrites the xattr, so encode with compat 3 once the owner is set and make it fail to decode instead. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit f8a9593)
Check that only the first eligible source becomes the wildcard owner. A source with a live or retired reference must not become the owner. Exercise repeated puts with and without an owner, check that retired tags are dropped once the wildcard has an owner or is gone, and that an owner forces compat 3. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit cf536fe) Conflicts: src/test/cls_refcount/test_cls_refcount.cc - umbrella lacks 28aacb0 ("test: Allow Cls tests to be run in Replicated and Fast EC pools"), so there is no ClsTestFixture and the existing tests are plain TEST()s that create their own pool; defined TestClsRefcount as a ::testing::Test fixture that creates and destroys a temp pool in SetUp()/TearDown(), and used TEST_F instead of TEST_P for the new tests
Pass the source's tail tag to cls_refcount_get() so it can own the wildcard on the source's tails. This lets deleted copies release their references without leaving a retired tag on every tail. Fall back to copying data when the source has no tail tag. Without one the wildcard gets no owner, and deleted copies would still leave retired tags on the source's tails. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit 02a60f4)
Pass the source's tail tag to cls_refcount_get(), like a copy does. Dedup and copies of a dedup target can then drop their references without leaving retired tags. A record without a tail tag holds the id tag instead, which can change on a self-copy or attribute update, so pass the tag only when it came from the tail tag. Signed-off-by: Matthew N. Heler <[email protected]> (cherry picked from commit f133d55)
There was a problem hiding this comment.
Ceph Release Engineering Audit Report
Commit Parity Visualizer
| BACKPORT PR #72821 | SOURCE PR |
SOURCE STATUS |
|---|---|---|
| 221837b rgw: don't give an appendable object another object's tails | PR #72314 | e798c80 rgw: don't give an appendable object another object's tails |
| 1969a70 rgw: give fetched and restored objects a tail tag of their own | 1b2f8ee rgw: give fetched and restored objects a tail tag of their own | |
| b49043a rgw: give each file in a bulk upload or form post a tail tag of its own | 71755a9 rgw: give each file in a bulk upload or form post a tail tag of its own | |
| 82215da cls/refcount: track the owner of the wildcard reference | f8a9593 cls/refcount: track the owner of the wildcard reference | |
| f95d0d8 test/cls_refcount: test wildcard ownership and repeated puts | cf536fe test/cls_refcount: test wildcard ownership and repeated puts | |
| 5ba6019 rgw: pass the source tail tag when copying objects | 02a60f4 rgw: pass the source tail tag when copying objects | |
| e80ff37 rgw/dedup: pass the source tail tag when sharing tails | f133d55 rgw/dedup: pass the source tail tag when sharing tails |
Automated Backport Parity Review - Cherry-Pick Conflicts / Deviations
A conflict or deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.
This does not necessarily indicate an issue but a maintainer should review.
**Click to expand conflict summaries.**
Deviation in Backport 221837b (cherry-pick of e798c80)
Affected File(s)
doc/radosgw/s3_objects_dedup.rst
Range Diff
Click to expand
--- Original (e798c80b)
+++ Backport (221837bf)
@@ -6,3 +6,10 @@
and skip appendable objects at dedup ingress.
Signed-off-by: Matthew N. Heler <[email protected]>
+(cherry picked from commit e798c80b8c5a2787743bf98744a87ed6f5c627bc)
+
+Conflicts:
+ doc/radosgw/s3_objects_dedup.rst
+- umbrella lacks rgw_dedup_skip_compressed and always skips compressed
+ objects in full dedup; kept umbrella's sentence and only added
+ objects written with AppendObject to the skipped objects
================================================================================
RANGE DIFF
================================================================================
1: e798c80b8c5 ! 1: 221837bf711 rgw: don't give an appendable object another object's tails
@@ Commit message
and skip appendable objects at dedup ingress.
Signed-off-by: Matthew N. Heler <[email protected]>
+ (cherry picked from commit e798c80b8c5a2787743bf98744a87ed6f5c627bc)
+
+ Conflicts:
+ doc/radosgw/s3_objects_dedup.rst
+ - umbrella lacks rgw_dedup_skip_compressed and always skips compressed
+ objects in full dedup; kept umbrella's sentence and only added
+ objects written with AppendObject to the skipped objects
## doc/radosgw/s3_objects_dedup.rst ##
-@@ doc/radosgw/s3_objects_dedup.rst: The dedup estimate process skips the following RGW objects:
- split-head which is unavailable on such pools)
+@@ doc/radosgw/s3_objects_dedup.rst: Dedup estimate process skips the following objects:
+ - Objects with different storage classes.
The full dedup process skips all of the above and additionally skips
--**user-encrypted** objects. Server-side **compressed** objects can
--optionally be skipped by setting :confval:`rgw_dedup_skip_compressed`.
-+**user-encrypted** objects and objects written with AppendObject. Server-side
-+**compressed** objects can optionally be skipped by setting
-+:confval:`rgw_dedup_skip_compressed`.
+-**compressed** and **user-encrypted** objects.
++**compressed** and **user-encrypted** objects and objects written with
++AppendObject.
- The minimum RGW object size to be deduplicated is controlled by the following
+ The minimum size object for dedup is controlled by the following
configuration option:
## src/rgw/driver/rados/rgw_dedup.cc ##Deviation in Backport f95d0d8 (cherry-pick of cf536fe)
Affected File(s)
src/test/cls_refcount/test_cls_refcount.cc
Range Diff
Click to expand
--- Original (cf536feb)
+++ Backport (f95d0d8d)
@@ -8,3 +8,13 @@
owner forces compat 3.
Signed-off-by: Matthew N. Heler <[email protected]>
+(cherry picked from commit cf536feb0614ad974da1082441b4c9ba078f71d5)
+
+Conflicts:
+ src/test/cls_refcount/test_cls_refcount.cc
+- umbrella lacks 28aacb0792b ("test: Allow Cls tests to be run in
+ Replicated and Fast EC pools"), so there is no ClsTestFixture and the
+ existing tests are plain TEST()s that create their own pool; defined
+ TestClsRefcount as a ::testing::Test fixture that creates and destroys
+ a temp pool in SetUp()/TearDown(), and used TEST_F instead of TEST_P
+ for the new tests
================================================================================
RANGE DIFF
================================================================================
1: cf536feb061 ! 1: f95d0d8daa9 test/cls_refcount: test wildcard ownership and repeated puts
@@ Commit message
owner forces compat 3.
Signed-off-by: Matthew N. Heler <[email protected]>
+ (cherry picked from commit cf536feb0614ad974da1082441b4c9ba078f71d5)
+
+ Conflicts:
+ src/test/cls_refcount/test_cls_refcount.cc
+ - umbrella lacks 28aacb0792b ("test: Allow Cls tests to be run in
+ Replicated and Fast EC pools"), so there is no ClsTestFixture and the
+ existing tests are plain TEST()s that create their own pool; defined
+ TestClsRefcount as a ::testing::Test fixture that creates and destroys
+ a temp pool in SetUp()/TearDown(), and used TEST_F instead of TEST_P
+ for the new tests
## src/test/cls_refcount/test_cls_refcount.cc ##
@@
@@ src/test/cls_refcount/test_cls_refcount.cc
#include "gtest/gtest.h"
#include "test/librados/test_cxx.h"
@@ src/test/cls_refcount/test_cls_refcount.cc: static librados::ObjectWriteOperation *new_op() {
+ return new librados::ObjectWriteOperation();
+ }
- class TestClsRefcount : public ceph::test::ClsTestFixture {
- // Inherits: rados, ioctx, pool_name, pool_type, SetUp(), TearDown()
++class TestClsRefcount : public ::testing::Test {
+protected:
++ librados::Rados rados;
++ librados::IoCtx ioctx;
++ string pool_name;
++
++ void SetUp() override {
++ pool_name = get_temp_pool_name();
++ ASSERT_EQ("", create_one_pool_pp(pool_name, rados));
++ ASSERT_EQ(0, rados.ioctx_create(pool_name.c_str(), ioctx));
++ }
++
++ void TearDown() override {
++ ioctx.close();
++ ASSERT_EQ(0, destroy_one_pool_pp(pool_name, rados));
++ }
++
+ void get(const string& oid, const string& tag, const string& src_tag = "") {
+ librados::ObjectWriteOperation op;
+ cls_refcount_get(op, tag, true, src_tag);
@@ src/test/cls_refcount/test_cls_refcount.cc: static librados::ObjectWriteOperatio
+ EXPECT_EQ(retired, actual.retired_refs);
+ EXPECT_EQ(owner, actual.wildcard_owner);
+ }
- };
-
-+TEST_P(TestClsRefcount, owned_wildcard)
++};
++
++TEST_F(TestClsRefcount, owned_wildcard)
+{
+ const string oid = "owned_wildcard";
+ ASSERT_EQ(0, ioctx.create(oid, true));
@@ src/test/cls_refcount/test_cls_refcount.cc: static librados::ObjectWriteOperatio
+ ASSERT_EQ(-ENOENT, ioctx.stat(oid, nullptr, nullptr));
+}
+
-+TEST_P(TestClsRefcount, wildcard_without_owner)
++TEST_F(TestClsRefcount, wildcard_without_owner)
+{
+ const string oid = "no_owner";
+ ASSERT_EQ(0, ioctx.create(oid, true));
@@ src/test/cls_refcount/test_cls_refcount.cc: static librados::ObjectWriteOperatio
+ {"retired", "copy"}));
+}
+
-+TEST_P(TestClsRefcount, retired_tags_dropped)
++TEST_F(TestClsRefcount, retired_tags_dropped)
+{
+ const string oid = "retired_dropped";
+ ASSERT_EQ(0, ioctx.create(oid, true));
@@ src/test/cls_refcount/test_cls_refcount.cc: static librados::ObjectWriteOperatio
+ ASSERT_NO_FATAL_FAILURE(check_refcount(oid, {"copy2"}, {}));
+}
+
-+TEST_P(TestClsRefcount, retired_tags_dropped_without_wildcard)
++TEST_F(TestClsRefcount, retired_tags_dropped_without_wildcard)
+{
+ // tails whose wildcard was dropped before it could have an owner
+ const string oid = "no_wildcard";
@@ src/test/cls_refcount/test_cls_refcount.cc: static librados::ObjectWriteOperatio
+ EXPECT_EQ(3, compat(objr));
+}
+
- TEST_P(TestClsRefcount, test_implicit) /* test refcount using implicit referencing of newly created objects */
+ TEST(cls_refcount, test_implicit) /* test refcount using implicit referencing of newly created objects */
{
-
+ librados::Rados rados;How to proceed:
- Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git
Conflicts:block intact) and include an explanation for changes. - Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
- Component Leads (Review): Please review the Range Diff(s) above to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting
/audit override.
Be familiar with the rules and guidelines for writing backports.
🛟 Need Help?
If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.
📋 Component Lead / Release Manager
To override the audit failure, apply releng-audit-override label or comment /audit override.
When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.
|
/audit override |
|
✅ Audit Override Applied by @adamemerson. |
|
This PR has been added to wip-anrao7-testing-2026-11-02-0650-umbrella. |
pr testing completed and approved by @ivancich , More details in : https://tracker.ceph.com/issues/82522 |
|
jenkins test windows |
backport tracker: https://tracker.ceph.com/issues/81864
backport of #72314
parent tracker: https://tracker.ceph.com/issues/81312
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh