Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Make types.h Object Ownership Story More Explicit #247

Draft
wants to merge 6 commits into
base: s3gw
Choose a base branch
from

Conversation

irq0
Copy link
Member

@irq0 irq0 commented Nov 15, 2023

Object from types.h was still a shared pointer even though we moved
away from the std::map "cache" approach.

Make ownership more explicit and reduce scope of Object wherever
possible. Delete and refactor unused code on the way. Some code
because unsused due to the fact that many uses of Object are now
constant.

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)
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

Marcel Lauhoff added 6 commits November 15, 2023 14:51
Replace with simpler delete_version as no caller actually cared about
the previous version. Also removes the need for a transaction retry.

Signed-off-by: Marcel Lauhoff <[email protected]>
Object was a shared_ptr hidden behind 'ObjectRef' typedef. The shared
ptr stems back from when there was a map of objects cache. Since we
are no longer sharing Objects remove the shared_ptr and make the
ownership of Object explicit. In most cases by using a unique_ptr.

This also changes the behavior of refresh_meta when there is not (yet)
a database record. We used to keep objref at nullptr. Now we
initialize it with a default object that has deleted = true and set
our state.exists to false.

Signed-off-by: Marcel Lauhoff <[email protected]>
@github-actions github-actions bot added the needs-rebase Changes need a rebase label Nov 16, 2023
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-rebase Changes need a rebase
Projects
Status: In Review 👀
Development

Successfully merging this pull request may close these issues.

1 participant