@@ -40,19 +40,27 @@ suite("test_flexible_partial_update_publish_conflict", "nonConcurrent") {
4040 sql """insert into ${tableName} select number, number, number, number, number, number from numbers("number" = "6"); """
4141 order_qt_sql "select k,v1,v2,v3,v4,v5,BITMAP_TO_STRING(__DORIS_SKIP_BITMAP_COL__) from ${tableName};"
4242
43- def enable_publish_spin_wait = {
43+ def enable_publish_spin_wait = { tokenName ->
4444 if (isCloudMode()) {
45- GetDebugPoint().enableDebugPointForAllFEs("CloudGlobalTransactionMgr.getDeleteBitmapUpdateLock.enable_spin_wait")
45+ GetDebugPoint().enableDebugPointForAllFEs("CloudGlobalTransactionMgr.getDeleteBitmapUpdateLock.enable_spin_wait", [token: "${tokenName}"] )
4646 } else {
47- GetDebugPoint().enableDebugPointForAllBEs("EnginePublishVersionTask::execute.enable_spin_wait")
47+ GetDebugPoint().enableDebugPointForAllBEs("EnginePublishVersionTask::execute.enable_spin_wait", [token: "${tokenName}"] )
4848 }
4949 }
5050
51- def enable_block_in_publish = {
51+ def disable_publish_spin_wait = {
5252 if (isCloudMode()) {
53- GetDebugPoint().enableDebugPointForAllFEs ("CloudGlobalTransactionMgr.getDeleteBitmapUpdateLock.block ")
53+ GetDebugPoint().disableDebugPointForAllFEs ("CloudGlobalTransactionMgr.getDeleteBitmapUpdateLock.enable_spin_wait ")
5454 } else {
55- GetDebugPoint().enableDebugPointForAllBEs("EnginePublishVersionTask::execute.block")
55+ GetDebugPoint().disableDebugPointForAllBEs("EnginePublishVersionTask::execute.enable_spin_wait")
56+ }
57+ }
58+
59+ def enable_block_in_publish = { passToken ->
60+ if (isCloudMode()) {
61+ GetDebugPoint().enableDebugPointForAllFEs("CloudGlobalTransactionMgr.getDeleteBitmapUpdateLock.block", [pass_token: "${passToken}"])
62+ } else {
63+ GetDebugPoint().enableDebugPointForAllBEs("EnginePublishVersionTask::execute.block", [pass_token: "${passToken}"])
5664 }
5765 }
5866
@@ -79,7 +87,7 @@ suite("test_flexible_partial_update_publish_conflict", "nonConcurrent") {
7987 set 'strict_mode', 'false'
8088 set 'unique_key_update_mode', 'UPDATE_FLEXIBLE_COLUMNS'
8189 file "test1.json"
82- time 20000
90+ time 40000
8391 }
8492 }
8593
@@ -93,25 +101,68 @@ suite("test_flexible_partial_update_publish_conflict", "nonConcurrent") {
93101 set 'strict_mode', 'false'
94102 set 'unique_key_update_mode', 'UPDATE_FLEXIBLE_COLUMNS'
95103 file "test2.json"
96- time 20000
104+ time 40000
97105 }
98106 }
99107
100108 Thread.sleep(500)
101109
110+ disable_publish_spin_wait()
102111 disable_block_in_publish()
103112 t1.join()
104113 t2.join()
105114
106115 order_qt_sql "select k,v1,v2,v3,v4,v5,BITMAP_TO_STRING(__DORIS_SKIP_BITMAP_COL__) from ${tableName};"
107116
117+
118+ // ==================================================================================================
119+ sql "truncate table ${tableName}"
120+ enable_publish_spin_wait("token1")
121+ enable_block_in_publish("-1")
122+ def t3 = Thread.start {
123+ sql "set insert_visible_timeout_ms=60000;"
124+ sql "sync;"
125+ sql "insert into ${tableName} values(1,1,1,1,1,1),(2,2,2,2,2,2);"
126+ }
127+ Thread.sleep(700)
128+ def t4 = Thread.start {
129+ sql "set enable_unique_key_partial_update=true;"
130+ sql "set insert_visible_timeout_ms=60000;"
131+ sql "set enable_insert_strict=false;"
132+ sql "sync;"
133+ sql "insert into ${tableName}(k,v1,v2,v3) values(1,99,99,99);"
134+ }
135+ Thread.sleep(700)
136+ enable_publish_spin_wait("token2")
137+ def t5 = Thread.start {
138+ streamLoad {
139+ table "${tableName}"
140+ set 'format', 'json'
141+ set 'read_json_by_line', 'true'
142+ set 'strict_mode', 'false'
143+ set 'unique_key_update_mode', 'UPDATE_FLEXIBLE_COLUMNS'
144+ file "test5.json"
145+ time 40000
146+ }
147+ }
148+ Thread.sleep(700)
149+ // let t3 and t4 publish
150+ enable_block_in_publish("token1")
151+ t3.join()
152+ t4.join()
153+ Thread.sleep(1000)
154+ qt_sql1 "select k,v1,v2,v3,v4,v5 from ${tableName} order by k;"
155+
156+ // let t5 publish
157+ enable_block_in_publish("token2")
158+ t5.join()
159+ qt_sql2 "select k,v1,v2,v3,v4,v5 from ${tableName} order by k;"
160+
108161 } catch(Exception e) {
109162 logger.info(e.getMessage())
110163 throw e
111164 } finally {
112165 GetDebugPoint().clearDebugPointsForAllFEs()
113166 GetDebugPoint().clearDebugPointsForAllBEs()
114167 }
115-
116- sql "DROP TABLE IF EXISTS ${tableName};"
117168}
0 commit comments