This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 055b3885c96 [Fix](inverted index) fix compound directory flush buffer
error (#28191)
055b3885c96 is described below
commit 055b3885c96a3a3e7e329be3948c7bdaf90c3831
Author: airborne12 <[email protected]>
AuthorDate: Sat Dec 9 00:57:35 2023 +0800
[Fix](inverted index) fix compound directory flush buffer error (#28191)
---
.../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 7795a441fd2..1230b15e0cc 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: [email protected]
For additional commands, e-mail: [email protected]