Skip to content

Commit a22b311

Browse files
committed
[refactor](cloud) Iterate transaction table IDs directly
### What problem does this PR solve? Issue Number: close apache#67099 Related PR: apache#67813 Problem Summary: Remove the extra HashSet conversion when refreshing partition versions for visible commit retries. Iterate the supplied transaction table IDs directly and remove the artificial duplicate ID from the existing two-table test. Retain all version, timestamp, TSO, response and RPC-count assertions. ### Release note None ### Check List (For Author) - Test: Static check - FE Checkstyle passed with zero violations; git diff --check passed. - Existing unit test fixture updated; no local unit tests rerun for this two-line change. - Full CI buildall will be requested after pushing this commit. - Behavior changed: Yes. Iterate supplied table IDs without deduplication. - Does this need documentation: No
1 parent b246692 commit a22b311

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ private void refreshPartitionVersions(long dbId, long txnId, List<Long> tableIds
687687
return;
688688
}
689689
List<CloudPartition> partitions = new ArrayList<>();
690-
for (long tableId : Sets.newHashSet(tableIds)) {
690+
for (long tableId : tableIds) {
691691
Table table = db.getTableNullable(tableId);
692692
if (table == null || !table.isManagedTable()) {
693693
continue;

‎fe/fe-core/src/test/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgrTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ public void testGetTransactionIdWatermarkUsesExclusiveMetaServiceBound() throws
654654
public void testVisibleRetryRefreshesAllTablePartitions() throws Exception {
655655
CloudPartition first = addCloudPartition(1000);
656656
CloudPartition second = addCloudPartition(2000);
657-
CommitTxnResponse response = visibleRetry(List.of(first.getTableId(), second.getTableId(), first.getTableId()));
657+
CommitTxnResponse response = visibleRetry(List.of(first.getTableId(), second.getTableId()));
658658
int batchSize = Config.cloud_get_version_task_batch_size;
659659
Config.cloud_get_version_task_batch_size = 1;
660660
try (MockedStatic<VersionHelper> versions = Mockito.mockStatic(VersionHelper.class)) {

0 commit comments

Comments
 (0)