cosven commented on code in PR #49204:
URL: https://github.com/apache/doris/pull/49204#discussion_r2013343846
##########
regression-test/suites/fault_injection_p0/cloud/test_cloud_mow_delete_bitmap_lock_case.groovy:
##########
@@ -420,8 +526,179 @@ suite("test_cloud_mow_stream_load_with_commit_fail",
"nonConcurrent") {
assertEquals(last_total_retry + 7, total_retry)
qt_sql12 """ select * from ${tableName} order by id"""
}
+
+ //7. test parallel load
+ GetDebugPoint().disableDebugPointForAllFEs('FE.mow.check.lock.release')
+ setFeConfigTemporary(customFeConfig2) {
+
GetDebugPoint().enableDebugPointForAllBEs("CloudEngineCalcDeleteBitmapTask.execute.enable_wait")
+ def threads = []
+ def now = System.currentTimeMillis()
+ for (int k = 0; k <= 1; k++) {
+ logger.info("start load thread:" + k)
+ threads.add(Thread.startDaemon {
+ do_stream_load()
+ })
+ }
+ for (Thread th in threads) {
+ th.join()
+ }
+ def time_cost = System.currentTimeMillis() - now
+ log.info("time_cost(ms): ${time_cost}")
+ assertTrue(time_cost > 6000, "wait time should bigger than 6s")
+
+ threads = []
+ now = System.currentTimeMillis()
+ for (int k = 0; k <= 1; k++) {
+ logger.info("start insert into thread:" + k)
+ threads.add(Thread.startDaemon {
+ do_insert_into()
+ })
+ }
+ for (Thread th in threads) {
+ th.join()
+ }
+ time_cost = System.currentTimeMillis() - now
+ log.info("time_cost(ms): ${time_cost}")
+ assertTrue(time_cost > 6000, "wait time should bigger than 6s")
+
GetDebugPoint().disableDebugPointForAllBEs("CloudEngineCalcDeleteBitmapTask.execute.enable_wait")
+
+ }
+ //8. test insert into timeout config
+ setFeConfigTemporary(customFeConfig3) {
+ try {
+
GetDebugPoint().enableDebugPointForAllFEs("CloudGlobalTransactionMgr.tryCommitLock.timeout",
[sleep_time: 15])
+ sql """ set global insert_visible_timeout_ms=15000; """
+ sql """ INSERT INTO ${tableName} (id, name, score) VALUES (1,
"Emily", 25),(2, "Benjamin", 35);"""
+ } catch (Exception e) {
+ logger.info("failed: " + e.getMessage())
+ assertTrue(e.getMessage().contains("test get table cloud
commit lock timeout"))
+ } finally {
+
GetDebugPoint().disableDebugPointForAllFEs("CloudGlobalTransactionMgr.tryCommitLock.timeout")
+ sql """ set global insert_visible_timeout_ms=60000; """
+ }
+ }
+ setFeConfigTemporary(customFeConfig4) {
+ try {
+
GetDebugPoint().enableDebugPointForAllBEs("CloudEngineCalcDeleteBitmapTask.execute.enable_wait")
+ sql """ INSERT INTO ${tableName} (id, name, score) VALUES (1,
"Emily", 25),(2, "Benjamin", 35);"""
+ } catch (Exception e) {
+ logger.info("failed: " + e.getMessage())
+ assertTrue(e.getMessage().contains("Failed to calculate delete
bitmap. Timeout"))
+ } finally {
+
GetDebugPoint().disableDebugPointForAllFEs("CloudEngineCalcDeleteBitmapTask.execute.enable_wait")
+ }
+ }
+
+ //9. when load hold delete bitmap lock, compaction and schema change
will fail and retry
+ setFeConfigTemporary(customFeConfig5) {
+
GetDebugPoint().enableDebugPointForAllBEs("CloudEngineCalcDeleteBitmapTask.handle.inject_sleep",
[percent: "1.0", sleep: "10"])
+ Thread.startDaemon {
+ do_insert_into()
+ }
+ def tablets = sql_return_maparray """ show tablets from
${tableName}; """
+ logger.info("tablets: " + tablets)
+ for (def tablet in tablets) {
+ String tablet_id = tablet.TabletId
+ def tablet_info = sql_return_maparray """ show tablet
${tablet_id}; """
+ logger.info("tablet: " + tablet_info)
+ String trigger_backend_id = tablet.BackendId
+ def now = System.currentTimeMillis()
+
assertTrue(triggerCompaction(backendId_to_backendIP[trigger_backend_id],
backendId_to_backendHttpPort[trigger_backend_id],
+ "cumulative", tablet_id).contains("Success"));
+ waitForCompaction(backendId_to_backendIP[trigger_backend_id],
backendId_to_backendHttpPort[trigger_backend_id], tablet_id)
+ getTabletStatus(backendId_to_backendIP[trigger_backend_id],
backendId_to_backendHttpPort[trigger_backend_id], tablet_id);
+ def time_cost = System.currentTimeMillis() - now
+ log.info("time_cost(ms): ${time_cost}")
+ assertTrue(time_cost > 10000, "wait time should bigger than
10s")
Review Comment:
This assertion only works when the table has only one tablet.
We should assert the tablets' length is 1 and remove the for-loop.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]