-
Notifications
You must be signed in to change notification settings - Fork 552
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
Ext4 detection #13496
Conversation
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.
c0dcbf5
to
f99eb9e
Compare
src/v/syschecks/syschecks.cc
Outdated
// 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
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.
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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, " |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
src/v/syschecks/syschecks.cc
Outdated
// 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) { |
There was a problem hiding this comment.
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.
328c245
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, " |
There was a problem hiding this comment.
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"
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/37241#018c6a26-3d0d-4200-abf5-21385852cee3 |
/backport v23.2.x |
/backport v23.3.x |
Changed in redpanda-data#13496 (cherry picked from commit 31ddb2d)
Changed in redpanda-data#13496 (cherry picked from commit 31ddb2d)
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
Release Notes
Bug Fixes