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 3aafe68a759 [Fix](inverted index) fix build index error status when
batch_next (#33532)
3aafe68a759 is described below
commit 3aafe68a759faeb3ab96e7ed195c547a185bba5f
Author: airborne12 <[email protected]>
AuthorDate: Thu Apr 11 21:26:00 2024 +0800
[Fix](inverted index) fix build index error status when batch_next (#33532)
---
be/src/olap/task/index_builder.cpp | 6 ++++++
.../fault_injection_p0/test_build_index_fault.out | 6 ++++++
.../test_build_index_fault.groovy | 24 ++++++++++++++++++----
3 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/be/src/olap/task/index_builder.cpp
b/be/src/olap/task/index_builder.cpp
index 85ba65820eb..0fb0f2c59d9 100644
--- a/be/src/olap/task/index_builder.cpp
+++ b/be/src/olap/task/index_builder.cpp
@@ -27,6 +27,7 @@
#include "olap/segment_loader.h"
#include "olap/storage_engine.h"
#include "olap/tablet_schema.h"
+#include "util/debug_points.h"
#include "util/trace.h"
namespace doris {
@@ -396,6 +397,10 @@ Status
IndexBuilder::handle_single_rowset(RowsetMetaSharedPtr output_rowset_meta
output_rowset_schema->create_block(return_columns));
while (true) {
auto status = iter->next_batch(block.get());
+ DBUG_EXECUTE_IF("IndexBuilder::handle_single_rowset", {
+ status =
Status::Error<ErrorCode::SCHEMA_CHANGE_INFO_INVALID>(
+ "next_batch fault injection");
+ });
if (!status.ok()) {
if (status.is<ErrorCode::END_OF_FILE>()) {
break;
@@ -403,6 +408,7 @@ Status
IndexBuilder::handle_single_rowset(RowsetMetaSharedPtr output_rowset_meta
LOG(WARNING)
<< "failed to read next block when schema change
for inverted index."
<< ", err=" << status.to_string();
+ return status;
}
// write inverted index data
diff --git a/regression-test/data/fault_injection_p0/test_build_index_fault.out
b/regression-test/data/fault_injection_p0/test_build_index_fault.out
index 543ca7ae5ff..3d5d60cfcaa 100644
--- a/regression-test/data/fault_injection_p0/test_build_index_fault.out
+++ b/regression-test/data/fault_injection_p0/test_build_index_fault.out
@@ -17,3 +17,9 @@
-- !count6 --
1000000
+-- !count7 --
+1000000
+
+-- !count8 --
+1000000
+
diff --git
a/regression-test/suites/fault_injection_p0/test_build_index_fault.groovy
b/regression-test/suites/fault_injection_p0/test_build_index_fault.groovy
index 988db48c6a7..84e0bae24ad 100644
--- a/regression-test/suites/fault_injection_p0/test_build_index_fault.groovy
+++ b/regression-test/suites/fault_injection_p0/test_build_index_fault.groovy
@@ -192,7 +192,7 @@ suite("test_build_index_fault", "inverted_index,
nonConcurrent,p2"){
// BUILD INDEX and expect state is FINISHED
sql """ BUILD INDEX idx_comment ON ${tableName}; """
state = wait_for_last_build_index_on_table_finish(tableName, timeout)
- assertEquals(state, "FINISHED")
+ assertEquals("FINISHED", state)
// check data
qt_count3 """ SELECT COUNT() from ${tableName}; """
@@ -209,7 +209,7 @@ suite("test_build_index_fault", "inverted_index,
nonConcurrent,p2"){
// BUILD INDEX again and expect state is FINISHED
sql """ BUILD INDEX idx_comment ON ${tableName}; """
state = wait_for_last_build_index_on_table_finish(tableName, timeout)
- assertEquals(state, "FINISHED")
+ assertEquals("FINISHED", state)
// check data
qt_count4 """ SELECT COUNT() from ${tableName}; """
@@ -219,7 +219,7 @@ suite("test_build_index_fault", "inverted_index,
nonConcurrent,p2"){
GetDebugPoint().enableDebugPointForAllBEs("fault_inject::BetaRowset::link_files_to::_link_inverted_index_file")
sql """ BUILD INDEX idx_title ON ${tableName}; """
state = wait_for_last_build_index_on_table_finish(tableName, timeout)
- assertEquals(state, "wait_timeout")
+ assertEquals("wait_timeout", state)
// check data
qt_count5 """ SELECT COUNT() from ${tableName}; """
@@ -227,7 +227,23 @@ suite("test_build_index_fault", "inverted_index,
nonConcurrent,p2"){
GetDebugPoint().disableDebugPointForAllBEs("fault_inject::BetaRowset::link_files_to::_link_inverted_index_file")
// timeout * 10 for possible fe schedule delay
state = wait_for_last_build_index_on_table_finish(tableName, timeout * 10)
- assertEquals(state, "FINISHED")
+ assertEquals("FINISHED", state)
// check data
qt_count6 """ SELECT COUNT() from ${tableName}; """
+
+ // BUILD INDEX with error injection
+ sql """ ALTER TABLE ${tableName} ADD INDEX idx_url (`url`) USING INVERTED
"""
+
GetDebugPoint().enableDebugPointForAllBEs("IndexBuilder::handle_single_rowset")
+ sql """ BUILD INDEX idx_url ON ${tableName}; """
+ state = wait_for_last_build_index_on_table_finish(tableName, timeout)
+ assertEquals("wait_timeout", state)
+ // check data
+ qt_count7 """ SELECT COUNT() from ${tableName}; """
+
+
GetDebugPoint().disableDebugPointForAllBEs("IndexBuilder::handle_single_rowset")
+ // timeout * 10 for possible fe schedule delay
+ state = wait_for_last_build_index_on_table_finish(tableName, timeout * 10)
+ assertEquals("FINISHED", state)
+ // check data
+ qt_count8 """ SELECT COUNT() from ${tableName}; """
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]