Skip to content

rgw/dedup: Add support for RGW versions. - #66233

Merged
benhanokh merged 2 commits into
ceph:mainfrom
benhanokh:dedup_ver
Dec 12, 2025
Merged

benhanokh merged 2 commits into
ceph:mainfrom
benhanokh:dedup_ver

Conversation

@benhanokh

@benhanokh benhanokh commented Nov 13, 2025 •

Copy link
Copy Markdown
Contributor

Dedup code will scan all instances of versioned objects and include them in the dedup process

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for RGW object versioning in the dedup process by tracking object instances and updating the dedup logic to handle versioned objects correctly.

Key Changes:

  • Added instance field to disk_record_t structure to track object versions
  • Refactored get_ioctx() to use rgw_obj_index_key for proper version-aware object identification
  • Improved duplicate detection logic to use ref_tag comparison instead of object name/bucket comparison

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/rgw/driver/rados/rgw_dedup_store.h Added instance field to disk_record_t structure and removed unused object_version field
src/rgw/driver/rados/rgw_dedup_store.cc Updated constructor, serialization, and deserialization to handle instance field
src/rgw/driver/rados/rgw_dedup.h Updated function signature to accept instance parameter
src/rgw/driver/rados/rgw_dedup.cc Propagated instance parameter through call chain, refactored get_ioctx to use rgw_obj_index_key, improved duplicate detection and marker handling
src/rgw/driver/rados/rgw_dedup_cluster.h Fixed buffer overflow in snprintf call
src/rgw/driver/rados/rgw_dedup_utils.h Removed unused build_oid helper function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@ceph ceph deleted a comment from Copilot AI Nov 15, 2025
@benhanokh
benhanokh requested a review from Copilot November 16, 2025 11:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/rgw/dedup/test_dedup.py Resolved
Comment thread src/test/rgw/dedup/test_dedup.py Resolved
Comment thread src/rgw/driver/rados/rgw_dedup.cc Resolved
Comment thread src/test/rgw/dedup/test_dedup.py Resolved
Comment thread src/test/rgw/dedup/test_dedup.py Resolved
Comment thread src/rgw/driver/rados/rgw_dedup.cc Resolved
@benhanokh
benhanokh requested a review from yuvalif November 16, 2025 16:28
@ceph ceph deleted a comment from Copilot AI Nov 16, 2025
@benhanokh
benhanokh requested review from cbodley, galsalomon66 and mattbenjamin and removed request for cbodley and yuvalif November 18, 2025 09:11
@benhanokh benhanokh added the backport tentacle PRs that is a tentacle back-port label Nov 24, 2025
}

unique_ptr<rgw::sal::Object> p_obj = bucket->get_object(p_rec->obj_name);
const rgw_obj_index_key roi_key(p_rec->obj_name, p_rec->instance);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

assert result[1] == 0 ,"Files %s and %s differ!!" % (key, tempfile)
os.remove(tempfile)

equal = filecmp.cmp(tmpfile, OUT_DIR + src_filename, shallow=False)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@galsalomon66

Copy link
Copy Markdown
Contributor

looks good , and passed the test.

@benhanokh

Copy link
Copy Markdown
Contributor Author

@benhanokh

Copy link
Copy Markdown
Contributor Author

@benhanokh

Copy link
Copy Markdown
Contributor Author

@benhanokh

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

1 similar comment
@benhanokh

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

Dedup code will scan all instances of versioned objects and include them
in the dedup process

Signed-off-by: Gabriel BenHanokh <[email protected]>
Signed-off-by: Gabriel BenHanokh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport tentacle PRs that is a tentacle back-port needs-qa rgw tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants