Skip to content

osd, os: drop the OmapIterator in favor of omap_iterate. Remove ObjectMap - #60890

Merged
rzarzynski merged 24 commits into
ceph:mainfrom
rzarzynski:wip-os-fastomapiter-killomapiterator
Apr 7, 2025
Merged

rzarzynski merged 24 commits into
ceph:mainfrom
rzarzynski:wip-os-fastomapiter-killomapiterator

Conversation

@rzarzynski

@rzarzynski rzarzynski commented Nov 29, 2024 •

Copy link
Copy Markdown
Contributor

This is a follow-up on #60278. In contrast to it, this PR is not supposed to be backported.

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
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@rzarzynski

Copy link
Copy Markdown
Contributor Author

It turned out that dropping the OmapIterator allowed to squeeze DBObjectMap and, finally, ObjectMap as well.

@rzarzynski rzarzynski changed the title osd, os: drop the OmapIterator in favor of omap_iterate osd, os: drop the OmapIterator in favor of omap_iterate. Remove ObjectMap Dec 11, 2024
Comment thread src/os/ObjectStore.h Resolved
Comment thread src/os/ObjectStore.h Resolved
Comment thread src/os/ObjectStore.h Resolved
Comment thread src/os/ObjectStore.h Resolved
Comment thread src/osd/PrimaryLogPG.cc Resolved
Comment thread src/kv/KeyValueDB.h 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.

(a note that refers to the commit description)
Maybe add, after the perf data, a word about what it is replaced with?

Comment thread src/kv/RocksDBStore.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.

a comment line reminding the reader what the equality means? (I know it is explained in the way 'smaller' is set, but still...)

@ronen-fr ronen-fr 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.

WIP - I'll continue tomorrow

Comment thread src/osd/SnapMapper.cc Resolved
Comment thread src/osd/SnapMapper.cc Resolved
Comment thread src/osd/SnapMapper.cc Resolved
Comment thread src/osd/SnapMapper.cc Resolved
Comment thread src/osd/SnapMapper.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.

this one really deserves an fmt::format()!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will send a follow up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The commit is ready, will push after addressing other comments.

Comment thread src/common/ceph_time.h 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 'guard' the correct name? it's just a collector, with no alarm, right?

Copy link
Copy Markdown
Contributor 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 analogy to the scope_guard we already have.

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.

No sure that's a good reason...

@rzarzynski rzarzynski Dec 17, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

<BETTER NAME NEED>!

Comment thread src/kv/RocksDBStore.cc Resolved
Comment thread src/kv/RocksDBStore.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'd rather simply return an optional

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This would need to be an optional of pair of two strings (and string_views) – there are callers who rely on the if (param != nullptr) behavior. Sounds complex.

@ronen-fr ronen-fr 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.

LGTM (and a nice improvement).
Some notes/questions etc.
I'd prefer that Matan also comments on the removal of the snap-mapper format repair code.

Comment thread src/osd/ReplicatedBackend.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.

What does the 2nd comment line means?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is the assumption on the on-wire format of netstring. Reworking the comment. Thanks!

Comment thread src/osd/ReplicatedBackend.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.

It seems that we rarely use _NDEBUG in Ceph code. Is this the right ifdef?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure it is. My intention is to have this only in debug builds due to performance penalty.

Comment thread src/osd/osd_types.h 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.

sp in the comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed; will push soon.

Comment thread src/osd/ReplicatedBackend.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 'max' is 1 when entering, do we update the hashes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Previously we were. Good catch, thanks!

Comment thread src/os/bluestore/BlueStore.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'd rather not return bool as int.

Comment thread src/osd/PGLog.h 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.

starts_with ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Refactored altogether with missing case.

Comment thread src/osd/OSD.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.

@Matan-B - any problem with this?

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.

Approved here - #60855

Comment thread src/tools/ceph_objectstore_tool.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.

structured binding instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@rzarzynski

Copy link
Copy Markdown
Contributor Author

Dropping the legacy key conversion of SnapMapper is sent separately for review: #60855.

@rzarzynski
rzarzynski force-pushed the wip-os-fastomapiter-killomapiterator branch 2 times, most recently from 920b388 to 6cb432f Compare December 17, 2024 19:23
@github-actions

Copy link
Copy Markdown

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

When `get_omap_iterator()` is replaced with `omap_iterate()`,
the CRC calculations will be happening in-place, with 0copy.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
Signed-off-by: Radoslaw Zarzynski <[email protected]>
`tail_key`, and even presence of some key designated to
be a gaaurd, seems to an impementation detail of
particular `ObjectStore`.

I doubt this piece of information is useful enough to
introduce a getter for it to the `ObjectStore` interface.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
Signed-off-by: Radoslaw Zarzynski <[email protected]>
Please note this also drops a BlueStore's perf counter:
`l_bluestore_omap_seek_to_first_lat`.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
Please don't confuse with osdmaptool.

Signed-off-by: Radoslaw Zarzynski <[email protected]>
Signed-off-by: Radoslaw Zarzynski <[email protected]>
Signed-off-by: Radoslaw Zarzynski <[email protected]>
@rzarzynski
rzarzynski force-pushed the wip-os-fastomapiter-killomapiterator branch from e452018 to 65b67f4 Compare April 4, 2025 18:22
@rzarzynski

Copy link
Copy Markdown
Contributor Author

Squashed a fixup and rebased after trivial conflits due to the s/WITH_SEASTAR/WITH_CRIMSON renaming. No need to restart the ongoing QA, IMHO.

@ljflores

ljflores commented Apr 7, 2025

Copy link
Copy Markdown
Member

@rzarzynski
rzarzynski merged commit 5a91525 into ceph:main Apr 7, 2025
@Matan-B Matan-B mentioned this pull request May 26, 2025
4 of 14 tasks
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.

6 participants