From 95fecff6fdf3ce18860ff4543bd445a9cd7e2ff2 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Dec 2024 08:37:46 +0800 Subject: [PATCH] Add todo on cluster lock --- .../handler/distsql/ral/updatable/LockClusterExecutor.java | 1 + .../handler/distsql/ral/updatable/UnlockClusterExecutor.java | 1 + 2 files changed, 2 insertions(+) diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/LockClusterExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/LockClusterExecutor.java index 73d2bb59f26da..f490b58143aea 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/LockClusterExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/LockClusterExecutor.java @@ -44,6 +44,7 @@ public void executeUpdate(final LockClusterStatement sqlStatement, final Context checkAlgorithm(sqlStatement); LockContext lockContext = contextManager.getComputeNodeInstanceContext().getLockContext(); GlobalLockDefinition lockDefinition = new GlobalLockDefinition(new ClusterLock()); + // TODO should configured in SQL Statement if (lockContext.tryLock(lockDefinition, 3000L)) { try { checkState(contextManager); diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/UnlockClusterExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/UnlockClusterExecutor.java index d9d28b883f875..9b744e649564d 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/UnlockClusterExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/UnlockClusterExecutor.java @@ -39,6 +39,7 @@ public void executeUpdate(final UnlockClusterStatement sqlStatement, final Conte checkState(contextManager); LockContext lockContext = contextManager.getComputeNodeInstanceContext().getLockContext(); GlobalLockDefinition lockDefinition = new GlobalLockDefinition(new ClusterLock()); + // TODO should configured in SQL Statement if (lockContext.tryLock(lockDefinition, 3000L)) { try { checkState(contextManager);