Skip to content

reef: mds: optionally forbid to use standby for another fs as last resort - #53340

Merged
vshankar merged 10 commits into
ceph:reeffrom
trociny:wip-62724-reef
Dec 20, 2023
Merged

vshankar merged 10 commits into
ceph:reeffrom
trociny:wip-62724-reef

Conversation

@trociny

@trociny trociny commented Sep 8, 2023 •

Copy link
Copy Markdown
Contributor

@trociny
trociny requested review from a team as code owners September 8, 2023 16:08
@trociny
trociny removed the request for review from a team September 8, 2023 16:08
@trociny trociny added this to the reef milestone Sep 8, 2023
@trociny trociny added the cephfs Ceph File System label Sep 8, 2023
@vshankar

vshankar commented Oct 5, 2023

Copy link
Copy Markdown
Contributor

Hi @trociny, this backport has commits from Luis's changes related to max xattr. Is that intentional?

@trociny

trociny commented Oct 5, 2023

Copy link
Copy Markdown
Contributor Author

Hi @trociny, this backport has commits from Luis's changes related to max xattr. Is that intentional?

Yes, as stated in the first comment:

this PR is based on #53339 to avoid conflicts and might need rebase after #53339 is merged

@vshankar

Copy link
Copy Markdown
Contributor

This change would require a rebase once some of other reef backports are merged. Just FYI - @trociny

@ljflores

ljflores commented Nov 1, 2023

Copy link
Copy Markdown
Member

Hey @trociny, I'm seeing a compile failure that seems related to your PR:
https://jenkins.ceph.com/job/ceph-dev-new-build/ARCH=x86_64,AVAILABLE_ARCH=x86_64,AVAILABLE_DIST=focal,DIST=focal,MACHINE_SIZE=gigantic/73728/consoleFull

/build/ceph-18.2.0-1165-g8a1887ea/src/mds/Server.cc: In member function 'void Server::handle_client_readdir_snapdiff(MDRequestRef&)':
/build/ceph-18.2.0-1165-g8a1887ea/src/mds/Server.cc:11416:41: error: 'class ConfigValues' has no member named 'mds_max_xattr_pairs_size'
11416 |     max_bytes = (512 << 10) + g_conf()->mds_max_xattr_pairs_size;
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~
[ 49%] Building CXX object src/mds/CMakeFiles/mds.dir/__/mgr/MDSPerfMetricTypes.cc.o

Can you take a look? I am removing the "needs-qa" label for now. Feel free to re-add it when the PR is ready for testing again.

@vshankar

vshankar commented Nov 2, 2023

Copy link
Copy Markdown
Contributor

Hey @trociny, I'm seeing a compile failure that seems related to your PR: https://jenkins.ceph.com/job/ceph-dev-new-build/ARCH=x86_64,AVAILABLE_ARCH=x86_64,AVAILABLE_DIST=focal,DIST=focal,MACHINE_SIZE=gigantic/73728/consoleFull

/build/ceph-18.2.0-1165-g8a1887ea/src/mds/Server.cc: In member function 'void Server::handle_client_readdir_snapdiff(MDRequestRef&)':
/build/ceph-18.2.0-1165-g8a1887ea/src/mds/Server.cc:11416:41: error: 'class ConfigValues' has no member named 'mds_max_xattr_pairs_size'
11416 |     max_bytes = (512 << 10) + g_conf()->mds_max_xattr_pairs_size;
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~
[ 49%] Building CXX object src/mds/CMakeFiles/mds.dir/__/mgr/MDSPerfMetricTypes.cc.o

Can you take a look? I am removing the "needs-qa" label for now. Feel free to re-add it when the PR is ready for testing again.

@ifed01 changes #53229 are merged which uses mds_max_xattr_pairs_size - with this change, that bit needs to be fixed to use the config from the mdsmap.

This new configuration option will allow to define the maximum size for a
filesystem xattrs blob.  This is a filesystem-wide knob that will replace
the per-MDS mds_max_xattr_pairs_size option.

Note:

The kernel client patch to handle this new configuration was merged before
the corresponding ceph-side pull-request.  This was unfortunate because in
the meantime PR ceph#43284 was merged and the encoding/decoding of
'bal_rank_mask' got in between.  Hence the 'max_xattr_size' is being
encoding/decoded before 'bal_rank_mask'.

URL: https://tracker.ceph.com/issues/55725
Signed-off-by: Luís Henriques <[email protected]>
(cherry picked from commit 7b8def5)
@rishabh-d-dave

Copy link
Copy Markdown
Contributor

@trociny PR #53339 has been merged, please rebase this PR.

@trociny

trociny commented Nov 21, 2023

Copy link
Copy Markdown
Contributor Author

@trociny PR #53339 has been merged, please rebase this PR.

I don't see it has been merged. To me it looks like it has been closed in favor to this PR.

@rishabh-d-dave rishabh-d-dave 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.

@yuriw

yuriw commented Dec 4, 2023

Copy link
Copy Markdown
Contributor

@trociny @vshankar @leonid-s-usov This was tested and ready for merge
pls resolve comments and merge
ref: https://trello.com/c/ukGRxNyt

@vshankar

vshankar commented Dec 4, 2023

Copy link
Copy Markdown
Contributor

@trociny @vshankar @leonid-s-usov This was tested and ready for merge
pls resolve comments and merge
ref: https://trello.com/c/ukGRxNyt

This would require additional fixes and retest. The change has been marked as unapproved for now.

This is required for a reef client to work with a higher revision
MDS, since essentially, this happens:

reef(client):

if (version >=17) {
    decode(bal_rank_mask, p);
}

and higher-revision MDS (say, upcoming squid):

version = 17
encode(version, bl);
...
...
encode(max_xattr_size, bl);
encode(bal_rank_mask, bl);

The client incorrectly decodes max_xattr_size (type: uint64_t) into
bal_rank_mask (type: string).

This situation ended up due to a couple of reasons:

* the kclient patchset hanlding `max_xattr_size` was merged early on
  and another MDS side change that bumped the MDSMap encoding version
  to 17 got merged in the midst (PR ceph#43284). Details in comment:

        ceph#46357 (comment)

* The reef backport for PR ceph#46357 got delayed (and, reef branched out).

Which means reef(18.2.0) user-space clients are broken with higher version
MDSs.

Fixes: https://tracker.ceph.com/issues/63713
Signed-off-by: Venky Shankar <[email protected]>
(cherry picked from commit 36ee8e7)
@vshankar

Copy link
Copy Markdown
Contributor

@vshankar

Copy link
Copy Markdown
Contributor

jenkins test windows

@vshankar vshankar 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.

@vshankar

Copy link
Copy Markdown
Contributor

@leonid-s-usov The merge is blocked by your change requested. Could you PTAL and do the needful.

@leonid-s-usov leonid-s-usov 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.

I am happy to see that the versioning has been rigorously discussed and addressed according to the consensus.

@vshankar
vshankar merged commit 2f49744 into ceph:reef Dec 20, 2023
batrick added a commit to batrick/ceph that referenced this pull request Feb 15, 2024
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]>
batrick added a commit to batrick/ceph that referenced this pull request Feb 20, 2024
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]>
batrick added a commit to batrick/ceph that referenced this pull request Feb 20, 2024
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]>
(cherry picked from commit 78abfea)
batrick added a commit to batrick/ceph that referenced this pull request Mar 22, 2024
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]>
(cherry picked from commit 78abfea)
afreen23 pushed a commit to rhcs-dashboard/ceph that referenced this pull request Jul 29, 2026
Commit 879080a 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 f39916e 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 879080a 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 f39916e was not merged until after reef was
already cut. This required f39916e 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 e0f1084
and update the reef max_xattr_size backport with the same change (7fefda43).

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]>
(cherry picked from commit 7ca167f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

10 participants