Skip to content

Commit

Permalink
[Fix](inverted index) fix compound directory flush buffer error (apac…
Browse files Browse the repository at this point in the history
  • Loading branch information
airborne12 authored and eldenmoon committed Dec 18, 2023
1 parent 8828848 commit ed12a72
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,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

0 comments on commit ed12a72

Please sign in to comment.