Skip to content

Commit

Permalink
[fix](regression) spare .testfile to make disk checker happy when inj…
Browse files Browse the repository at this point in the history
…ecting fault (#30012)
  • Loading branch information
liaoxin01 authored and Doris-Extras committed Jan 16, 2024
1 parent 3c502f6 commit 08db92a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion be/src/io/fs/local_file_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "io/fs/file_writer.h"
#include "io/fs/local_file_system.h"
#include "io/fs/path.h"
#include "olap/data_dir.h"
#include "util/doris_metrics.h"

namespace doris {
Expand Down Expand Up @@ -201,7 +202,10 @@ Status LocalFileWriter::_close(bool sync) {
}

DBUG_EXECUTE_IF("LocalFileWriter.close.failed", {
return Status::IOError("cannot close {}: {}", _path.native(), std::strerror(errno));
// spare '.testfile' to make bad disk checker happy
if (_path.filename().compare(kTestFilePath)) {
return Status::IOError("cannot close {}: {}", _path.native(), std::strerror(errno));
}
});

_closed = true;
Expand Down

0 comments on commit 08db92a

Please sign in to comment.