This is an automated email from the ASF dual-hosted git repository.
liaoxin pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 8467e047ba5 branch-3.0: [Fix](mow) Multiple table locks should be
acquired in order of table ids #46305 (#46611)
8467e047ba5 is described below
commit 8467e047ba5c412c1b8d3bdb5518f2534b2a8606
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Jan 11 23:02:42 2025 +0800
branch-3.0: [Fix](mow) Multiple table locks should be acquired in order of
table ids #46305 (#46611)
Cherry-picked from #46305
Co-authored-by: Xin Liao <[email protected]>
---
.../org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java
b/fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java
index 706ab5161f4..8ccbba707c7 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java
@@ -1094,6 +1094,9 @@ public class CloudGlobalTransactionMgr implements
GlobalTransactionMgrIface {
}
}
+ // Get tables that require commit lock - only MOW tables need this:
+ // 1. Filter to keep only OlapTables with MOW enabled
+ // 2. Sort by table ID to maintain consistent locking order and
prevent deadlocks
List<Table> mowTableList = tableList.stream()
.filter(table -> table instanceof OlapTable && ((OlapTable)
table).getEnableUniqueKeyMergeOnWrite())
.sorted(Comparator.comparingLong(Table::getId))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]