Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ext4 detection #13496

Merged
merged 5 commits into from
Dec 20, 2023
Merged

Conversation

travisdowns
Copy link
Member

@travisdowns travisdowns commented Sep 18, 2023

Assume that ext filesystems are ext4

Due to scylladb/seastar#251 all of ext2, ext3 and ext4 will be
detected as ext2 (they shared the same superblock magic number).

This leads to an erroneous warning claiming that you are not running
on ext4 nor XFS. For now, we will simply that assume any ext detection
means ext4, as ext2 and 3 use is very limited as ext4 was rolled out
more than 15 years ago and almost entirely supplanted use of the
earlier variants.

A partial fix for:

#13469

A more involved fix may follow to resolve seastar#251.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.2.x
  • v23.1.x
  • v22.3.x

Release Notes

Bug Fixes

  • ext4 is no longer incorrectly detected as ext2 (all of ext2, 3 and 4 are assumed to be ext4).

Print the detected filsystem type at info always, since this is
critical one-time info.

Also print the detected fs type in the warning message when the type
is not xfs or ext4.
Due to scylladb/seastar#251 all of ext2, ext3 and ext4 will be
detected as ext2 (they shared the same superblock magic number).

This leads to an erroneous warning claiming that you are not running
on ext4 nor XFS. For now, we will simply that assume any ext detection
means ext4, as ext2 and 3 use is very limited as ext4 was rolled out
more than 15 years ago and almost entirely supplanted use of the
earlier variants.

In any case, the change only changes the warning message emitted, not
any other behavior.

Issue redpanda-data#13469.
To make it clearer why we treat ext2 as ext4.
src/v/syschecks/syschecks.cc Outdated Show resolved Hide resolved
// all of ext2, 3 and 4 are detected as ext2, so we just assume an
// ext2 detection means ext4 for now, see:
// https://github.com/redpanda-data/redpanda/issues/13469
if (fs == ss::fs_type::ext2) {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we just also make this check for ext3 and ext4? Then it will automatically work once upstream is fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 perhaps we should explicitly define the set of supported filesystems and the set of recommended filesystems, and log them each in these warning/error messages

Copy link
Member Author

Choose a reason for hiding this comment

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

@StephanDollberg - I'm not sure. If we get ext3 as a response, what does it mean? That upstream has been fixed and the fs being is used is actually ext3? Officially we don't support ext3, and so I'm not sure the warning is right in spirit and it's also wrong when it says "you are on ext4 ...". Similarly if upstream has been fixed, then it's wrong to include ext2 in this check: it should be changed to only include ext4 at that point.

Copy link
Member Author

Choose a reason for hiding this comment

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

However, I agree that if we ever get ext4 I guess we should print this ext4 warning. So maybe fs == ext2 || fs == ext4 is the best check? Seems weird.

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW here's my suggested upstream fix:

scylladb/seastar#1837

It does not change the behavior of the existing method, but adds a new one. So in that case we'd need another change here to use the new method. I'm not sure if it will be accept or if it's the best approach.

Copy link
Member Author

Choose a reason for hiding this comment

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

+1 perhaps we should explicitly define the set of supported filesystems and the set of recommended filesystems, and log them each in these warning/error messages

As far as I know there is only one supported and recommended file system: xfs. ext4 is in a grey zone.

In any case, does the code not explicitly define these now via its "if cascade"?

Copy link
Member

Choose a reason for hiding this comment

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

Right, from what you mentioned in the meeting I had understood that ext2/3/4 are actually quite similar.

However, I agree that if we ever get ext4 I guess we should print this ext4 warning. So maybe fs == ext2 || fs == ext4 is the best check? Seems weird.

This does seem like a good middle ground even if a bit weird.

I guess it all depends a bit on what you want to do with the seastar fix. If you are going to cherry pick it into our fork now anyway then yeah it's fine lets just merge as is. Just want to avoid a scenario where we later update seastar which fixed the detection and then this breaks. Backports also an angle to consider but I guess we never really pull in new stuff there (unless done intentionally).

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess it all depends a bit on what you want to do with the seastar fix. If you are going to cherry pick it into our fork now anyway then yeah it's fine lets just merge as is.

I don't plan to cherry-pick it immediately but see what happens upstream. I don't have any strong expectation there: it's entirely possible nothing gets accepted and so the current state of the syscheck lives forever, or maybe it will be changed to not introduce a new method but actually fix file_system_at() in which case we would suddenly start returning ext3 or ext4 here as you are concerned about.

In any case, I agree that the == ext2 | ext4 check is reasonable and I'll change it to that.

Backports also an angle to consider but I guess we never really pull in new stuff there (unless done intentionally).

Do you mean backporting this change? I plan to backport it to 23.2 only.

Copy link
Member

Choose a reason for hiding this comment

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

Do you mean backporting this change? I plan to backport it to 23.2 only.

Yeah meant this change. Sounds fine, probably no new clusters being set up on 23.1 so unlikely to run into the confusing log message.

andrwng
andrwng previously approved these changes Sep 18, 2023
Copy link
Contributor

@andrwng andrwng left a comment

Choose a reason for hiding this comment

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

Not much more to add to Stephan's comments, and they're just nits. Otherwise, LGTM

@@ -53,6 +53,7 @@ ss::future<> disk(const ss::sstring& path) {
return ss::check_direct_io_support(path).then([path] {
return ss::file_system_at(path).then([path](auto fs) {
checklog.info0("Detected file system type is {}", to_string(fs));
if (fs == ss::fs_type::ext2) {
checklog.warn(
"Path: `{}' is on ext4, not XFS. This will probably work, "
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: perhaps update to "ext4-like filesystem"

Copy link
Member Author

Choose a reason for hiding this comment

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

@andrwng - does this comment apply to line 56: if (fs == ss::fs_type::ext2) {?

Note that ss::fs_type is part of seastar.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah no it was meant for the logged warning ""Path: `{}' is on ext4, not XFS"

// all of ext2, 3 and 4 are detected as ext2, so we just assume an
// ext2 detection means ext4 for now, see:
// https://github.com/redpanda-data/redpanda/issues/13469
if (fs == ss::fs_type::ext2) {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 perhaps we should explicitly define the set of supported filesystems and the set of recommended filesystems, and log them each in these warning/error messages

As pointed out in review.
We semi-support ext4 but in the syscheck we will now check for both
ext2 and ext4, as currently ext4 is always detected as ext2, but
in the future if ext4 is returned we should also treat this as ext4.

Issue redpanda-data#13469.
@@ -53,6 +53,7 @@ ss::future<> disk(const ss::sstring& path) {
return ss::check_direct_io_support(path).then([path] {
return ss::file_system_at(path).then([path](auto fs) {
checklog.info0("Detected file system type is {}", to_string(fs));
if (fs == ss::fs_type::ext2) {
checklog.warn(
"Path: `{}' is on ext4, not XFS. This will probably work, "
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah no it was meant for the logged warning ""Path: `{}' is on ext4, not XFS"

@vbotbuildovich
Copy link
Collaborator

@travisdowns travisdowns merged commit 853d9ed into redpanda-data:dev Dec 20, 2023
25 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v23.2.x

@nvartolomei
Copy link
Contributor

/backport v23.3.x

vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this pull request Dec 22, 2023
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this pull request Dec 22, 2023
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.

None yet

5 participants