Skip to content

Commit 9999ae0

Browse files
zacw7facebook-github-bot
authored andcommitted
test: Disable O_DIRECT in cache fuzzer (facebookincubator#12154)
Summary: Pull Request resolved: facebookincubator#12154 O_DIRECT requires I/O size needs to be the same as a disk file block size which is not handled in SSD cache. Misalignment can lead to EINVAL in some filesystem and kernel version. Reviewed By: xiaoxmeng, kagamiori, yuandagits Differential Revision: D68562695 fbshipit-source-id: 5a3dbdfed288dfb8cfa606f9d40fe0e2c0568f8a
1 parent 2d24256 commit 9999ae0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

velox/common/file/tests/FaultyFileSystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class FaultyFileSystem : public FileSystem {
4747
// Extracts the delegated real file path by removing the faulty file system
4848
// scheme prefix.
4949
inline std::string_view extractPath(std::string_view path) const override {
50-
VELOX_CHECK_EQ(path.find(scheme()), 0, "");
51-
const auto filePath = path.substr(scheme().length());
50+
const auto filePath =
51+
(path.find(scheme()) == 0) ? path.substr(scheme().length()) : path;
5252
return getFileSystem(filePath, config_)->extractPath(filePath);
5353
}
5454

velox/exec/fuzzer/CacheFuzzer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "velox/common/memory/MmapAllocator.h"
2929
#include "velox/dwio/common/CachedBufferedInput.h"
3030
#include "velox/exec/tests/utils/TempDirectoryPath.h"
31-
#include "velox/vector/fuzzer/Utils.h"
3231

3332
DEFINE_int32(steps, 10, "Number of plans to generate and test.");
3433

@@ -498,6 +497,12 @@ void CacheFuzzer::go() {
498497
FLAGS_steps > 0 || FLAGS_duration_sec > 0,
499498
"Either --steps or --duration_sec needs to be greater than zero.");
500499

500+
// O_DIRECT requires I/O size to be the same as a disk file block size which
501+
// is not handled in SSD cache. Misalignment can lead to EINVAL in some
502+
// filesystem and kernel version.
503+
//
504+
// TODO: add this support if needed later.
505+
FLAGS_ssd_odirect = false;
501506
auto startTime = std::chrono::system_clock::now();
502507
size_t iteration = 0;
503508

0 commit comments

Comments
 (0)