-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](cloud) MS limit max aborted txn num for the same txn label #40414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
2 changes: 2 additions & 0 deletions
2
regression-test/data/load_p0/stream_load/test_stream_load_with_data_quality.csv
This file contains hidden or 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,2 @@ | ||
| 1, NULL, "xxx", 1 | ||
| 2, NULL, "yyy", 2 |
2 changes: 2 additions & 0 deletions
2
regression-test/data/load_p0/stream_load/test_stream_load_with_data_quality2.csv
This file contains hidden or 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,2 @@ | ||
| 1, 1, "xxx", 1 | ||
| 2, 1, "yyy", 2 |
187 changes: 187 additions & 0 deletions
187
regression-test/suites/load_p0/stream_load/test_steam_load_with_data_quality.groovy
This file contains hidden or 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,187 @@ | ||
| // 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 java.util.Random; | ||
|
|
||
| suite("test_stream_load_with_data_quality", "p0") { | ||
| if (!isCloudMode()) { | ||
| return; | ||
| } | ||
|
|
||
| def tableName = "test_stream_load_with_data_quality" | ||
| sql "DROP TABLE IF EXISTS ${tableName}" | ||
|
|
||
| sql """ | ||
| CREATE TABLE ${tableName} | ||
| ( | ||
| siteid INT DEFAULT '10', | ||
| citycode SMALLINT NOT NULL, | ||
| username VARCHAR(32) DEFAULT '', | ||
| pv BIGINT SUM DEFAULT '0' | ||
| ) | ||
| AGGREGATE KEY(siteid, citycode, username) | ||
| DISTRIBUTED BY HASH(siteid) BUCKETS 1; | ||
| """ | ||
|
|
||
| String label = UUID.randomUUID().toString().replaceAll("-", "") | ||
|
|
||
| // meta-service max_num_aborted_txn is 100 | ||
| for (int i = 0; i < 100; i++) { | ||
| streamLoad { | ||
| set 'label', "${label}" | ||
| set 'column_separator', ',' | ||
| table "${tableName}" | ||
| time 10000 | ||
| file 'test_stream_load_with_data_quality.csv' | ||
| check { result, exception, startTime, endTime -> | ||
| if (exception != null) { | ||
| throw exception | ||
| } | ||
| log.info("Stream load result: ${result}".toString()) | ||
| def json = parseJson(result) | ||
| assertEquals("fail", json.Status.toLowerCase()) | ||
| assertTrue(json.Message.contains("too many filtered rows")) | ||
| assertEquals(2, json.NumberTotalRows) | ||
| assertEquals(2, json.NumberFilteredRows) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| streamLoad { | ||
| set 'label', "${label}" | ||
| set 'column_separator', ',' | ||
| table "${tableName}" | ||
| time 10000 | ||
| file 'test_stream_load_with_data_quality.csv' | ||
| check { result, exception, startTime, endTime -> | ||
| if (exception != null) { | ||
| throw exception | ||
| } | ||
| log.info("Stream load result: ${result}".toString()) | ||
| def json = parseJson(result) | ||
| assertEquals("fail", json.Status.toLowerCase()) | ||
| assertTrue(json.Message.contains("too many aborted txn")) | ||
| } | ||
| } | ||
|
|
||
| String dbName = "regression_test_load_p0_stream_load" | ||
| test { | ||
| sql "clean label ${label} from ${dbName};" | ||
| } | ||
|
|
||
| streamLoad { | ||
| set 'label', "${label}" | ||
| set 'column_separator', ',' | ||
| table "${tableName}" | ||
| time 10000 | ||
| file 'test_stream_load_with_data_quality2.csv' | ||
| check { result, exception, startTime, endTime -> | ||
| if (exception != null) { | ||
| throw exception | ||
| } | ||
| log.info("Stream load result: ${result}".toString()) | ||
| def json = parseJson(result) | ||
| assertEquals("success", json.Status.toLowerCase()) | ||
| } | ||
| } | ||
|
|
||
| test { | ||
| sql "clean label ${label} from ${dbName};" | ||
| } | ||
|
|
||
| // meta-service max_num_aborted_txn is 100 | ||
| for (int i = 0; i < 99; i++) { | ||
| streamLoad { | ||
| set 'label', "${label}" | ||
| set 'column_separator', ',' | ||
| table "${tableName}" | ||
| time 10000 | ||
| file 'test_stream_load_with_data_quality.csv' | ||
| check { result, exception, startTime, endTime -> | ||
| if (exception != null) { | ||
| throw exception | ||
| } | ||
| log.info("Stream load result: ${result}".toString()) | ||
| def json = parseJson(result) | ||
| assertEquals("fail", json.Status.toLowerCase()) | ||
| assertTrue(json.Message.contains("too many filtered rows")) | ||
| assertEquals(2, json.NumberTotalRows) | ||
| assertEquals(2, json.NumberFilteredRows) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| streamLoad { | ||
| set 'label', "${label}" | ||
| set 'column_separator', ',' | ||
| table "${tableName}" | ||
| time 10000 | ||
| file 'test_stream_load_with_data_quality2.csv' | ||
| check { result, exception, startTime, endTime -> | ||
| if (exception != null) { | ||
| throw exception | ||
| } | ||
| log.info("Stream load result: ${result}".toString()) | ||
| def json = parseJson(result) | ||
| assertEquals("success", json.Status.toLowerCase()) | ||
| } | ||
| } | ||
|
|
||
| streamLoad { | ||
| set 'label', "${label}" | ||
| set 'column_separator', ',' | ||
| table "${tableName}" | ||
| time 10000 | ||
| file 'test_stream_load_with_data_quality2.csv' | ||
| check { result, exception, startTime, endTime -> | ||
| if (exception != null) { | ||
| throw exception | ||
| } | ||
| log.info("Stream load result: ${result}".toString()) | ||
| def json = parseJson(result) | ||
| assertEquals("label already exists", json.Status.toLowerCase()) | ||
| assertTrue(json.Message.contains("has already been used")) | ||
| } | ||
| } | ||
|
|
||
| test { | ||
| sql "clean label ${label} from ${dbName};" | ||
| } | ||
|
|
||
| streamLoad { | ||
| set 'label', "${label}" | ||
| set 'column_separator', ',' | ||
| table "${tableName}" | ||
| time 10000 | ||
| file 'test_stream_load_with_data_quality2.csv' | ||
| check { result, exception, startTime, endTime -> | ||
| if (exception != null) { | ||
| throw exception | ||
| } | ||
| log.info("Stream load result: ${result}".toString()) | ||
| def json = parseJson(result) | ||
| assertEquals("success", json.Status.toLowerCase()) | ||
| } | ||
| } | ||
|
|
||
| test { | ||
| sql "clean label ${label} from ${dbName};" | ||
| } | ||
|
|
||
| sql "DROP TABLE IF EXISTS ${tableName}" | ||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100 should be got from configs of be via http. otherwise case is not stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ms not provider http api for querying. ms's config