Skip to content

mds: reverse MDSMap encoding of max_xattr_size/bal_rank_mask - #55601

Merged
batrick merged 8 commits into
ceph:mainfrom
batrick:i64440
Feb 20, 2024
Merged

batrick merged 8 commits into
ceph:mainfrom
batrick:i64440

Conversation

@batrick

@batrick batrick commented Feb 15, 2024 •

Copy link
Copy Markdown
Member

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

@batrick
batrick marked this pull request as ready for review February 15, 2024 16:07
@batrick

batrick commented Feb 15, 2024

Copy link
Copy Markdown
Member Author

@xiubli

xiubli commented Feb 19, 2024

Copy link
Copy Markdown
Member

Commit e134c89 adds the bal_rank_mask with encoded (ev) version 17.  This was
merged into main Oct 2022 and made it into the reef release normally.

Commit 7b8def5 adds the max_xattr_size also with encoded (ev) version 17 but
places it before bal_rank_mask. This is problematic as there were no plans to
backport e134c89 to quincy or pacific so piggybacking on the ev 17 bump would
not work and otherwise would require the backports to be done as a set to
ensure consistency (including with the kernel client).

However, the real issue is that 7b8def5 was not merged until after reef was
already cut. This required 7b8def5 to be backported separately in [1] which
was not merged until after v18.2.1 (current reef HEAD as of this commit).
Ultimately, this means that there are reef versions (v18.2.[01]) in the wild
which expect bal_rank_mask to be encoded at ev17 and not (max_xattr_size,
bal_rank_mask). Adding to the complications, the kernel client has already
merged code [2] expecting max_xattr_size for ev17.

It was decided in a github discussion [3] to move bal_rank_mask to ev18 to
avoid updating the kernel client which was done in the main branch via 36ee8e7
and update the reef max_xattr_size backport with the same change (d8cebd6).

Unfortunately, this breaks upgrades v18.2.[01] to newer reef versions or to
main.  The reason is that monitors will encode v17 with bal_rank_mask
(max_xattr_size is not merged yet) and send that to upgraded mgrs (which are
upgraded first). The mgr will attempt to decode bal_rank_mask as a uint64_t
(max_xattr_size) but fail because an empty (by default) bal_rank_mask is simply
encoded as a signed 32-bit integer. Consequently, the mgr will fail decoding
with:

    failed to decode message of type 45 v1: End of buffer [buffer:2]

Of course the problem does not stop there, even if the mgr were able to handle
this, the monitors/mds/clients would fail in similar fashion.

So the only choice left is to fix max_xattr_size to be encoded at ev18.
Fortunately, v18.2.2 has not been released nor has any max_xattr_size backport
to quincy/pacific been merged. The main downside will be that kernels will
wrongly decode ev17 (which is already true for ceph clusters running
v18.2.[01]). A follow-up kernel fix will be required.

[1] https://tracker.ceph.com/issues/59405
[2] linux.git d93231a6bc8a452323d5fef16cca7107ce483a27
[3] ceph#53340 (comment)

Fixes: https://tracker.ceph.com/issues/64440
Signed-off-by: Patrick Donnelly <[email protected]>
Some messages are duplicated to the cluster log lookign like:

    2024-02-15T22:54:31.244 INFO:teuthology.orchestra.run.smithi033.stdout:2024-02-15T22:50:00.000263+0000 mon.smithi033 (mon.0) 558 : cluster 4 [ERR] MDS_ALL_DOWN: 1 filesystem is offline

Signed-off-by: Patrick Donnelly <[email protected]>
This is expected when bringing a volume and its mds up initially.

Signed-off-by: Patrick Donnelly <[email protected]>
This is expected for cephadm deployments where join_fs is configured, causing
affinity replacements.

Signed-off-by: Patrick Donnelly <[email protected]>
batrick added a commit to batrick/ceph that referenced this pull request Feb 20, 2024
* refs/pull/55601/head:
	qa: test fuse/kclient for mds upgrade seq
	qa: ignore OSD_DOWN during cephadm upgrades
	qa: ignore warning "Replacing daemon"
	qa: ignore MDS_INSUFFICIENT_STANDBY
	qa: remove ignorelist error parenthesis
	mds: update comment on kclient decoding of MDSMap
	qa: do upgrades from quincy and older reef minor releases
	mds: reverse MDSMap encoding of max_xattr_size/bal_rank_mask
@batrick

batrick commented Feb 20, 2024

Copy link
Copy Markdown
Member Author

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.

3 participants