Skip to content

Commit

Permalink
add sort
Browse files Browse the repository at this point in the history
  • Loading branch information
liaoxin01 committed Dec 27, 2024
1 parent 75cbbc4 commit dd25088
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -1108,6 +1109,7 @@ public boolean commitAndPublishTransaction(DatabaseIf db, List<Table> tableList,

List<Table> mowTableList = tableList.stream()
.filter(table -> table instanceof OlapTable && ((OlapTable) table).getEnableUniqueKeyMergeOnWrite())
.sorted(Comparator.comparingLong(Table::getId))
.collect(Collectors.toList());
increaseWaitingLockCount(mowTableList);
if (!MetaLockUtils.tryCommitLockTables(mowTableList, timeoutMillis, TimeUnit.MILLISECONDS)) {
Expand Down

0 comments on commit dd25088

Please sign in to comment.