Skip to content

Comments

squid: osd: fix require_min_compat_client handling for msr rules#59492

Merged
ljflores merged 5 commits intoceph:squidfrom
ljflores:wip-bz-2305110-squid
Sep 5, 2024
Merged

squid: osd: fix require_min_compat_client handling for msr rules#59492
ljflores merged 5 commits intoceph:squidfrom
ljflores:wip-bz-2305110-squid

Conversation

@ljflores
Copy link
Member

@ljflores ljflores commented Aug 28, 2024

Backport of #59474

Backport of 4b54b07

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 and others added 4 commits August 28, 2024 16:14
Unit testing
------------
```
[rzarzynski@o06 build]$ bin/unittest_features
...
[ RUN      ] features.release_features
1 argonaut features 0x40000 looks like argonaut
2 bobtail features 0x40000 looks like argonaut
3 cuttlefish features 0x40000 looks like argonaut
4 dumpling features 0x42040000 looks like dumpling
5 emperor features 0x42040000 looks like dumpling
6 firefly features 0x20842040000 looks like firefly
7 giant features 0x20842040000 looks like firefly
8 hammer features 0x1020842040000 looks like hammer
9 infernalis features 0x1020842040000 looks like hammer
10 jewel features 0x401020842040000 looks like jewel
11 kraken features 0xc01020842040000 looks like kraken
12 luminous features 0xe01020842240000 looks like luminous
13 mimic features 0xe01020842240000 looks like luminous
14 nautilus features 0xe01020842240000 looks like luminous
15 octopus features 0xe01020842240000 looks like luminous
16 pacific features 0xe01020842240000 looks like luminous
17 quincy features 0xe01020842240000 looks like luminous
18 reef features 0xe010208d2240000 looks like reef
19 squid features 0xe010248d2240000 looks like squid
[       OK ] features.release_features (0 ms)
```

Manual testing
--------------
\### `reef` client present in `squid` cluster
```
[rzarzynski@o06 build]$ bin/ceph daemon mon.a sessions | jq  -jr '.[] | .name, "\t", .con_features, "\t", .con_features_hex, "\n"' | grep client
client.?        4540701547738038271     3f03cffffffdffff
client.?        4540138322906710015     3f01cfbffffdffff
[rzarzynski@o06 build]$ bin/ceph osd get-require-min-compat-client
luminous
[rzarzynski@o06 build]$ bin/ceph osd set-require-min-compat-client squid
Error EPERM: cannot set require_min_compat_client to squid: 1 connected client(s) look like reef (missing 0x4000000000); add --yes-i-really-mean-it to do it anyway
```

\### only `squid` clients and `squid` cluster
```
[rzarzynski@o06 build]$ bin/ceph daemon mon.a sessions | jq  -jr '.[] | .name, "\t", .con_features, "\t", .con_features_hex, "\n"' | grep client
client.?        4540701547738038271     3f03cffffffdffff
client.?        4540701547738038271     3f03cffffffdffff
[rzarzynski@o06 build]$ bin/ceph osd set-require-min-compat-client squid
set require_min_compat_client to squid
```

Fixes: https://tracker.ceph.com/issues/66297
Signed-off-by: Radoslaw Zarzynski <[email protected]>
(cherry picked from commit 4b54b07)
…pool

OSDMap::get_features is used by
OSDMonitor::validate_crush_against_features via
OSDMap::get_min_compat_client() to check whether changes to the crushmap
will require newer features than the existing require_min_compat_client
field.

Monitor commands which create rules from ec profiles may result in msr
rules.  While it might be harmless to allow msr rules to exist as long
as there aren't any pools actually using the rule, it's probably simpler
to disallow their creation in the first place until
require_min_compat_client is updated.

Signed-off-by: Samuel Just <[email protected]>
(cherry picked from commit 2130115)
This was simply a mistake:

uint64_t features = 0;
features |= CEPH_FEATURE_CRUSH_MSR;
ceph_assert(HAVE_FEATURE(features, CRUSH_MSR));

will fail the assert as CEPH_FEATURE_CRUSH_MSR lacks the mask.  In
basically all cases, CEPH_FEATUREMASK_* is the correct choice.

Signed-off-by: Samuel Just <[email protected]>
(cherry picked from commit cb157b4)
Also adjusts validate_crush_against_features to use an ostream&
rather than a stringstream&.

Fixes: https://tracker.ceph.com/issues/67755
Signed-off-by: Samuel Just <[email protected]>
(cherry picked from commit 1d6b4d4)
Copy link
Contributor

@athanatos athanatos left a comment

Choose a reason for hiding this comment

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

LGTM once tested and the original merges

… profiles

Signed-off-by: Samuel Just <[email protected]>
(cherry picked from commit 4f9289e)
@github-actions github-actions bot added the tests label Sep 4, 2024
@ljflores
Copy link
Member Author

ljflores commented Sep 4, 2024

jenkins retest this please

@ljflores
Copy link
Member Author

ljflores commented Sep 4, 2024

@ljflores ljflores merged commit df9c5b0 into ceph:squid Sep 5, 2024
@ljflores ljflores deleted the wip-bz-2305110-squid branch September 5, 2024 15:54
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.

4 participants