osd, os: drop the OmapIterator in favor of omap_iterate. Remove ObjectMap#60890
Conversation
5d0ca38 to
d9fcde2
Compare
|
It turned out that dropping the |
| #include <map> | ||
| #include <optional> | ||
| #include <string> | ||
| #include <string_view> |
There was a problem hiding this comment.
(a note that refers to the commit description)
Maybe add, after the perf data, a word about what it is replaced with?
| std::string_view value_as_sv() override | ||
| { | ||
| if (smaller == on_main) { | ||
| return main->value_as_sv(); |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
WIP - I'll continue tomorrow
src/osd/SnapMapper.cc
Outdated
| mapping.snap < end && | ||
| mapping.hoid.pool == pool); | ||
| // invalid | ||
| dout(10) << __func__ << " stray " << mapping.hoid |
There was a problem hiding this comment.
this one really deserves an fmt::format()!
There was a problem hiding this comment.
Will send a follow up.
There was a problem hiding this comment.
The commit is ready, will push after addressing other comments.
| }; | ||
|
|
||
| template <class ClockT = mono_clock> | ||
| class time_guard { |
There was a problem hiding this comment.
is 'guard' the correct name? it's just a collector, with no alarm, right?
There was a problem hiding this comment.
I think it's analogy to the scope_guard we already have.
There was a problem hiding this comment.
No sure that's a good reason...
There was a problem hiding this comment.
<BETTER NAME NEED>!
| } | ||
|
|
||
| // TODO: deduplicate the code, preferrably by removing the string variant | ||
| int RocksDBStore::split_key(rocksdb::Slice in, string_view *prefix, string_view *key) |
There was a problem hiding this comment.
I'd rather simply return an optional
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
src/osd/ReplicatedBackend.cc
Outdated
| static uint32_t crc32_netstring(const uint32_t orig_crc, T data) | ||
| { | ||
| // this MUST be compliant marshalling format for bufferlist! | ||
| // otherwise with scrub during upgrade will happen. |
There was a problem hiding this comment.
What does the 2nd comment line means?
There was a problem hiding this comment.
There is the assumption on the on-wire format of netstring. Reworking the comment. Thanks!
| auto crc = ceph_crc32c(orig_crc, (unsigned char*)&len, sizeof(len)); | ||
| crc = ceph_crc32c(crc, (unsigned char*)data.c_str(), data.length()); | ||
|
|
||
| #ifndef _NDEBUG |
There was a problem hiding this comment.
It seems that we rarely use _NDEBUG in Ceph code. Is this the right ifdef?
There was a problem hiding this comment.
I'm pretty sure it is. My intention is to have this only in debug builds due to performance penalty.
src/osd/osd_types.h
Outdated
| std::string omap_pos; | ||
| int ret = 0; | ||
| ceph::buffer::hash data_hash, omap_hash; ///< accumulatinng hash value | ||
| ceph::buffer::hash data_hash; ///< accumulatinng hash value |
There was a problem hiding this comment.
Fixed; will push soon.
| if (--max == 0) { | ||
| more = true; | ||
| pos.omap_pos = key; | ||
| return ObjectStore::omap_iter_ret_t::STOP; |
There was a problem hiding this comment.
If 'max' is 1 when entering, do we update the hashes?
There was a problem hiding this comment.
Previously we were. Good catch, thanks!
| next_lat_acc, | ||
| c->store->cct->_conf->bluestore_log_omap_iterator_age); | ||
| return 0; | ||
| return more; |
There was a problem hiding this comment.
I'd rather not return bool as int.
src/osd/PGLog.h
Outdated
| } | ||
| missing.add(oid, std::move(item)); | ||
| } else if (p->key().substr(0, 4) == std::string("dup_")) { | ||
| } else if (key.substr(0, 4) == std::string("dup_")) { |
There was a problem hiding this comment.
Refactored altogether with missing case.
| r = SnapMapper::convert_legacy(cct, store.get(), ch, hoid, max); | ||
| if (r < 0) | ||
| goto out; | ||
| derr << __func__ << " snap_mapper upgrade from pre-octopus" |
src/tools/ceph_objectstore_tool.cc
Outdated
| ceph::signedspan total_time; | ||
| string tail_key; | ||
| std::tie(coll, ghobj, first_seek_time, last_seek_time, total_time, tail_key) = *i; | ||
| std::tie(coll, ghobj, first_seek_time, last_seek_time, total_time) = *i; |
There was a problem hiding this comment.
structured binding instead?
|
Dropping the legacy key conversion of |
920b388 to
6cb432f
Compare
|
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 <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
`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 <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Please note this also drops a BlueStore's perf counter: `l_bluestore_omap_seek_to_first_lat`. Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Please don't confuse with osdmaptool. Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
e452018 to
65b67f4
Compare
|
Squashed a fixup and rebased after trivial conflits due to the |
Introduced recently in ceph#60890. _NDEBUG is a typo for NDEBUG. Possibly confused with _DEBUG which is a Visual Studio concept. Signed-off-by: Matan Breizman <mbreizma@redhat.com>
Introduced recently in ceph#60890. _NDEBUG is a typo for NDEBUG. Possibly confused with _DEBUG which is a Visual Studio concept. Signed-off-by: Matan Breizman <mbreizma@redhat.com>
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e