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

[Fix](inverted index) fix compound directory flush buffer error #28191

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,25 @@ DorisCompoundDirectory::FSIndexOutput::~FSIndexOutput() {
void DorisCompoundDirectory::FSIndexOutput::flushBuffer(const uint8_t* b, const int32_t size) {
if (_writer != nullptr && b != nullptr && size > 0) {
Slice data {b, (size_t)size};
DBUG_EXECUTE_IF(
"DorisCompoundDirectory::FSIndexOutput._mock_append_data_error_in_fsindexoutput_"
"flushBuffer",
{
if (_writer->path().filename() == "_0.tii" ||
_writer->path().filename() == "_0.tis") {
return;
}
})
Status st = _writer->append(data);
DBUG_EXECUTE_IF(
"DorisCompoundDirectory::FSIndexOutput._status_error_in_fsindexoutput_flushBuffer",
{
st = Status::Error<doris::ErrorCode::INVERTED_INDEX_CLUCENE_ERROR>(
"flush buffer mock error");
})
if (!st.ok()) {
LOG(WARNING) << "File IO Write error: " << st.to_string();
_CLTHROWA(CL_ERR_IO, "writer append data when flushBuffer error");
}
} else {
if (_writer == nullptr) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !sql --
863
0

-- !sql --
863
0

-- !sql --
863
0

-- !sql --
863
0

-- !sql --
0

-- !sql --
0

Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,23 @@ suite("test_index_compound_directory_failure_injection", "nonConcurrent") {
} finally {
GetDebugPoint().disableDebugPointForAllBEs("DorisCompoundDirectory::FSIndexOutput._set_writer_close_status_error")
}
qt_sql "select COUNT() from ${testTable_dup} where request match 'images'"
qt_sql "select COUNT() from ${testTable_dup} where request match 'images'"
try {
create_httplogs_dup_table.call("test_index_compound_directory1")
GetDebugPoint().enableDebugPointForAllBEs("DorisCompoundDirectory::FSIndexOutput._mock_append_data_error_in_fsindexoutput_flushBuffer")
load_httplogs_data.call("test_index_compound_directory1", 'test_index_compound_directory1', 'true', 'json', 'documents-1000.json')
} finally {
GetDebugPoint().disableDebugPointForAllBEs("DorisCompoundDirectory::FSIndexOutput._mock_append_data_error_in_fsindexoutput_flushBuffer")
}
qt_sql "select COUNT() from test_index_compound_directory1 where request match 'images'"
try {
create_httplogs_dup_table.call("test_index_compound_directory2")
GetDebugPoint().enableDebugPointForAllBEs("DorisCompoundDirectory::FSIndexOutput._status_error_in_fsindexoutput_flushBuffer")
load_httplogs_data.call("test_index_compound_directory2", 'test_index_compound_directory2', 'true', 'json', 'documents-1000.json')
} finally {
GetDebugPoint().disableDebugPointForAllBEs("DorisCompoundDirectory::FSIndexOutput._status_error_in_fsindexoutput_flushBuffer")
}
qt_sql "select COUNT() from test_index_compound_directory2 where request match 'images'"
} finally {
//try_sql("DROP TABLE IF EXISTS ${testTable}")
}
Expand Down
Loading