Skip to content

Commit

Permalink
Merge pull request redpanda-data#13496 from travisdowns/td-13469-ext4…
Browse files Browse the repository at this point in the history
…-detection

Ext4 detection
  • Loading branch information
travisdowns authored Dec 20, 2023
2 parents 928833c + 051c63c commit 853d9ed
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions src/v/syschecks/syschecks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,56 @@
#include <seastar/core/seastar.hh>
#include <seastar/net/api.hh>

namespace {
ss::sstring to_string(ss::fs_type fs) {
switch (fs) {
case ss::fs_type::other:
return "other";
case ss::fs_type::xfs:
return "xfs";
case ss::fs_type::ext2:
return "ext2";
case ss::fs_type::ext3:
return "ext3";
case ss::fs_type::ext4:
return "ext4";
case ss::fs_type::btrfs:
return "btrfs";
case ss::fs_type::hfs:
return "hfs";
case ss::fs_type::tmpfs:
return "tmpfs";
};
return "bad_enum";
}
} // namespace

namespace syschecks {
ss::logger checklog{"syschecks"};

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) {
if (fs == ss::fs_type::ext4) {
checklog.info0("Detected file system type is {}", to_string(fs));
// Currently, 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
// We also still check for ext4, since if that is returned it means
// that seastar has been fixed to be able to detect ext4.
if (fs == ss::fs_type::ext2 || fs == ss::fs_type::ext4) {
checklog.warn(
"Path: `{}' is on ext4, not XFS. This will probably work, "
"but Redpanda is only tested on XFS and XFS is recommended "
"for best performance.",
path);
} else if (fs != ss::fs_type::xfs) {
checklog.error(
"Path: `{}' is not on XFS or ext4. This is a non-supported "
"Path: `{}' uses {} filesystem which is not XFS or ext4. "
"This is a unsupported "
"configuration. You may experience poor performance or "
"instability.",
path);
path,
to_string(fs));
}
});
});
Expand Down

0 comments on commit 853d9ed

Please sign in to comment.