-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add alignment process in publish phase for flexible partial update
- Loading branch information
Showing
9 changed files
with
275 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
regression-test/data/fault_injection_p0/flexible_partial_update/test1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{"k": 1, "v1": 1999} | ||
{"k": 2, "v3": 3999, "v5": 2999} | ||
{"k": 3, "v3": 3999, "v2": null} | ||
{"k": 4, "v4": 4999, "v1": 1999, "v3": 3999} | ||
{"k": 5, "v5": null} | ||
{"k": 6, "v1": 1999, "v3": 3999} |
7 changes: 7 additions & 0 deletions
7
regression-test/data/fault_injection_p0/flexible_partial_update/test2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{"k": 1, "v5": 5777, "v3": 3777, "v2": 2777} | ||
{"k": 2, "v4": 4777, "v1": 1777, "v2": null} | ||
{"k": 3, "v1": 1777, "v5": null} | ||
{"k": 4, "v2": null, "v5": 5777} | ||
{"k": 5, "v4": 4777, "v1": null, "v3": 3777} | ||
{"k": 7, "v2": null, "v5": 5777, "v3": 3777} | ||
{"k": 6, "v5": null, "v2": 2777, "v3": 3777} |
19 changes: 19 additions & 0 deletions
19
...lt_injection_p0/flexible_partial_update/test_flexible_partial_update_publish_conflict.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !sql -- | ||
0 0 0 0 0 0 0 2 0 | ||
1 1 1 1 1 1 0 2 0 | ||
2 2 2 2 2 2 0 2 0 | ||
3 3 3 3 3 3 0 2 0 | ||
4 4 4 4 4 4 0 2 0 | ||
5 5 5 5 5 5 0 2 0 | ||
|
||
-- !sql -- | ||
0 0 0 0 0 0 0 2 0 | ||
1 1999 2777 3777 1 5777 0 4 3 1,4,6 | ||
2 1777 \N 3999 4777 2999 0 4 3 3,5,6 | ||
3 1777 \N 3999 3 \N 0 4 4 2,3,4,6 | ||
4 1999 \N 3999 4999 5777 0 4 4 1,3,4,6 | ||
5 \N 5 3777 4777 \N 0 4 3 2,5,6 | ||
6 1999 2777 3777 1234 \N 0 4 3 1,4,6 | ||
7 \N \N 3777 1234 5777 0 4 3 1,4,6 | ||
|
115 changes: 115 additions & 0 deletions
115
...injection_p0/flexible_partial_update/test_flexible_partial_update_publish_conflict.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
import org.junit.Assert | ||
|
||
suite("test_flexible_partial_update_publish_conflict", "nonConcurrent") { | ||
|
||
def tableName = "test_flexible_partial_update_publish_conflict" | ||
sql """ DROP TABLE IF EXISTS ${tableName} """ | ||
sql """ CREATE TABLE ${tableName} ( | ||
`k` int(11) NULL, | ||
`v1` BIGINT NULL, | ||
`v2` BIGINT NULL DEFAULT "9876", | ||
`v3` BIGINT NOT NULL, | ||
`v4` BIGINT NOT NULL DEFAULT "1234", | ||
`v5` BIGINT NULL | ||
) UNIQUE KEY(`k`) DISTRIBUTED BY HASH(`k`) BUCKETS 1 | ||
PROPERTIES( | ||
"replication_num" = "1", | ||
"enable_unique_key_merge_on_write" = "true", | ||
"light_schema_change" = "true", | ||
"store_row_column" = "false"); """ | ||
|
||
sql """insert into ${tableName} select number, number, number, number, number, number from numbers("number" = "6"); """ | ||
order_qt_sql "select k,v1,v2,v3,v4,v5,__DORIS_DELETE_SIGN__,__DORIS_VERSION_COL__,BITMAP_COUNT(__DORIS_SKIP_BITMAP_COL__),BITMAP_TO_STRING(__DORIS_SKIP_BITMAP_COL__) from ${tableName};" | ||
|
||
def enable_publish_spin_wait = { | ||
if (isCloudMode()) { | ||
GetDebugPoint().enableDebugPointForAllFEs("CloudGlobalTransactionMgr.getDeleteBitmapUpdateLock.enable_spin_wait") | ||
} else { | ||
GetDebugPoint().enableDebugPointForAllBEs("EnginePublishVersionTask::execute.enable_spin_wait") | ||
} | ||
} | ||
|
||
def enable_block_in_publish = { | ||
if (isCloudMode()) { | ||
GetDebugPoint().enableDebugPointForAllFEs("CloudGlobalTransactionMgr.getDeleteBitmapUpdateLock.block") | ||
} else { | ||
GetDebugPoint().enableDebugPointForAllBEs("EnginePublishVersionTask::execute.block") | ||
} | ||
} | ||
|
||
def disable_block_in_publish = { | ||
if (isCloudMode()) { | ||
GetDebugPoint().disableDebugPointForAllFEs("CloudGlobalTransactionMgr.getDeleteBitmapUpdateLock.block") | ||
} else { | ||
GetDebugPoint().disableDebugPointForAllBEs("EnginePublishVersionTask::execute.block") | ||
} | ||
} | ||
|
||
try { | ||
GetDebugPoint().clearDebugPointsForAllFEs() | ||
GetDebugPoint().clearDebugPointsForAllBEs() | ||
|
||
// block the partial update in publish phase | ||
enable_publish_spin_wait() | ||
enable_block_in_publish() | ||
def t1 = Thread.start { | ||
streamLoad { | ||
table "${tableName}" | ||
set 'format', 'json' | ||
set 'read_json_by_line', 'true' | ||
set 'strict_mode', 'false' | ||
set 'unique_key_update_mode', 'FLEXIBLE_PARTIAL_UPDATE' | ||
file "test1.json" | ||
time 1000000 | ||
} | ||
} | ||
|
||
Thread.sleep(500) | ||
|
||
def t2 = Thread.start { | ||
streamLoad { | ||
table "${tableName}" | ||
set 'format', 'json' | ||
set 'read_json_by_line', 'true' | ||
set 'strict_mode', 'false' | ||
set 'unique_key_update_mode', 'FLEXIBLE_PARTIAL_UPDATE' | ||
file "test2.json" | ||
time 1000000 | ||
} | ||
} | ||
|
||
Thread.sleep(500) | ||
|
||
disable_block_in_publish() | ||
t1.join() | ||
t2.join() | ||
|
||
order_qt_sql "select k,v1,v2,v3,v4,v5,__DORIS_DELETE_SIGN__,__DORIS_VERSION_COL__,BITMAP_COUNT(__DORIS_SKIP_BITMAP_COL__),BITMAP_TO_STRING(__DORIS_SKIP_BITMAP_COL__) from ${tableName};" | ||
|
||
} catch(Exception e) { | ||
logger.info(e.getMessage()) | ||
throw e | ||
} finally { | ||
GetDebugPoint().clearDebugPointsForAllFEs() | ||
GetDebugPoint().clearDebugPointsForAllBEs() | ||
} | ||
|
||
sql "DROP TABLE IF EXISTS ${tableName};" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters