Skip to content

osd: kill snapdirs - #17579

Merged
liewegas merged 55 commits into
ceph:masterfrom
liewegas:wip-kill-snapdirs
Sep 22, 2017
Merged

liewegas merged 55 commits into
ceph:masterfrom
liewegas:wip-kill-snapdirs

Conversation

@liewegas

@liewegas liewegas commented Sep 7, 2017

Copy link
Copy Markdown
Member

These are gone after luminous. This rips out all of the compat code from the
conversion and also simplifies most of hte original code now that head is
always present.

I think SnapSetContext could probably also be removed (use head obc instead),
but haven't tackled that one yet.

Broken into small patches to make each change easier to review. This will need
a careful look!

Comment thread src/osd/PrimaryLogPG.cc Outdated

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.

we need

Comment thread src/osd/PrimaryLogPG.cc Outdated

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.

i don't think that we can assume the existence of oi here. as we could have nonexistent or corrupted OI_ATTR.

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.

@liewegas this is not addressed.

Comment thread src/osd/PrimaryLogPG.cc Outdated

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.

if snapset does not exist, we should always let last_backfill_started point to check. see db798d9

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ah good catch! fixed

Comment thread src/osd/PrimaryLogPG.cc Outdated

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.

nit, might want to keep the question mark.

Comment thread src/osd/PrimaryLogPG.cc Outdated

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.

is_snap() considers snap = 0 as a clone, but we don't do so before. the snap id starts from 2. so i guess it's fine. but could you double check this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah, snap == 0 can never happen.

Comment thread src/osd/PrimaryLogPG.cc Outdated

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.

nit, could take this chance to use ranged-for loop.

Comment thread src/osd/PrimaryLogPG.cc Outdated

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.

nit, could just put:

set<snapid_t> old_snaps(citer->second.begin(), citer->second.end());

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

y

Comment thread src/osd/PrimaryLogPG.cc Outdated

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.

use emplace() to save a ctor for temporary vector instance returned by snapset.clone_snaps[coid.snap], like:

snapset.clone_snaps.emplace(
  coid.snap,
  vector<snapid_t>(new_snaps.rbegin(),new_snaps.rend()));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

y

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

actually no, we are replacing an existing member, so emplace won't work.

@tchaikov

tchaikov commented Sep 8, 2017

Copy link
Copy Markdown
Contributor

note to myself, should start from "osd/PrimaryLogPG: trim_object: simplify a bit more for post-snapdir" (inclusive) next time.

@liewegas

Copy link
Copy Markdown
Member Author

Addressed your comments so far, retesting!

Comment thread src/osd/PrimaryLogPG.cc Outdated

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.

we might want to backport this if this is a bug fix.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it's pretty harmless... I'd rather not backport it for risk of some unforeseen side-effect.

Comment thread src/osd/PrimaryLogPG.cc Outdated

@tchaikov tchaikov Sep 10, 2017 •

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.

might want to revise the commit message, s/can/can't/

Comment thread src/osd/PrimaryLogPG.cc Outdated

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.

need to check oi before dereferencing it.

The SnapSet will now never be 'legacy'.

Signed-off-by: Sage Weil <[email protected]>
- we neither need to delete or create snapdir objects
- snapset is only ever written to head; move bufferlist bss and
encode call there
- drop legacy_snapset encoding path

Signed-off-by: Sage Weil <[email protected]>
The object never exists; no need to look for it.

Signed-off-by: Sage Weil <[email protected]>
We don't care about these any more.

Signed-off-by: Sage Weil <[email protected]>
…ool names

There was a baked-in assumption that the first pool was <20 chars.
No more!

Signed-off-by: Sage Weil <[email protected]>
This was added two years ago by b61f3e4,
but I can see why it is needed here.  The test case for that
original bug (from a3442cf) passes
fine.

Signed-off-by: Sage Weil <[email protected]>
Some cache ops do writes, but none of them *create* objects, so we
should not set can_create.

Signed-off-by: Sage Weil <[email protected]>
@liewegas
liewegas merged commit 91b6523 into ceph:master Sep 22, 2017
@liewegas
liewegas deleted the wip-kill-snapdirs branch September 22, 2017 02:25
zdover23 added a commit to zdover23/ceph that referenced this pull request Mar 14, 2024
snapdir concept was removed in: ceph#17579

Co-authored-by: Zac Dover <[email protected]>
Signed-off-by: Matan Breizman <[email protected]>
Matan-B added a commit to Matan-B/ceph that referenced this pull request Mar 24, 2024
snapdir concept was removed in: ceph#17579

Co-authored-by: Zac Dover <[email protected]>
Signed-off-by: Matan Breizman <[email protected]>
zdover23 added a commit to zdover23/ceph that referenced this pull request Mar 27, 2024
snapdir concept was removed in: ceph#17579

Co-authored-by: Zac Dover <[email protected]>
Signed-off-by: Matan Breizman <[email protected]>
(cherry picked from commit 6a7f2b0)
zdover23 added a commit to zdover23/ceph that referenced this pull request Mar 27, 2024
snapdir concept was removed in: ceph#17579

Co-authored-by: Zac Dover <[email protected]>
Signed-off-by: Matan Breizman <[email protected]>
(cherry picked from commit 6a7f2b0)
zdover23 added a commit to zdover23/ceph that referenced this pull request Mar 27, 2024
snapdir concept was removed in: ceph#17579

Co-authored-by: Zac Dover <[email protected]>
Signed-off-by: Matan Breizman <[email protected]>
(cherry picked from commit 6a7f2b0)
afreen23 pushed a commit to rhcs-dashboard/ceph that referenced this pull request Jul 29, 2026
snapdir concept was removed in: ceph#17579

Co-authored-by: Zac Dover <[email protected]>
Signed-off-by: Matan Breizman <[email protected]>
(cherry picked from commit 2ebf181)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants