This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push: new 62125dc8cc6 [Fix](inverted index) fix compound directory flush buffer error (#28191) (#28734) 62125dc8cc6 is described below commit 62125dc8cc63d648cf938e9568bd1aa7669f46de Author: airborne12 <airborn...@gmail.com> AuthorDate: Wed Dec 20 22:25:08 2023 +0800 [Fix](inverted index) fix compound directory flush buffer error (#28191) (#28734) --- .../segment_v2/inverted_index_compound_directory.cpp | 16 ++++++++++++++++ .../test_index_compound_directory_fault_injection.out | 14 ++++++++++---- ...est_index_compound_directory_fault_injection.groovy | 18 +++++++++++++++++- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp b/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp index e563f61802f..cba340a26f4 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp @@ -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) { diff --git a/regression-test/data/fault_injection_p0/test_index_compound_directory_fault_injection.out b/regression-test/data/fault_injection_p0/test_index_compound_directory_fault_injection.out index 89a6bba7134..bf59811cc65 100644 --- a/regression-test/data/fault_injection_p0/test_index_compound_directory_fault_injection.out +++ b/regression-test/data/fault_injection_p0/test_index_compound_directory_fault_injection.out @@ -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 diff --git a/regression-test/suites/fault_injection_p0/test_index_compound_directory_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_index_compound_directory_fault_injection.groovy index e5d028a62ef..1c6f969dd2f 100644 --- a/regression-test/suites/fault_injection_p0/test_index_compound_directory_fault_injection.groovy +++ b/regression-test/suites/fault_injection_p0/test_index_compound_directory_fault_injection.groovy @@ -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}") } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org