diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/lock/global/GlobalLockDefinition.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/lock/global/GlobalLockDefinition.java index 76376151d59f1..77f2d032c7af1 100644 --- a/mode/core/src/main/java/org/apache/shardingsphere/mode/lock/global/GlobalLockDefinition.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/lock/global/GlobalLockDefinition.java @@ -26,7 +26,7 @@ @Getter public final class GlobalLockDefinition implements LockDefinition { - private static final String KEY_PATTERN = "/lock/exclusive/locks/%s"; + private static final String KEY_PATTERN = "/lock/global/locks/%s"; private final String lockKey; diff --git a/mode/core/src/test/java/org/apache/shardingsphere/mode/lock/global/GlobalLockDefinitionTest.java b/mode/core/src/test/java/org/apache/shardingsphere/mode/lock/global/GlobalLockDefinitionTest.java index 82ee55f24a609..ee6bb5b62f6da 100644 --- a/mode/core/src/test/java/org/apache/shardingsphere/mode/lock/global/GlobalLockDefinitionTest.java +++ b/mode/core/src/test/java/org/apache/shardingsphere/mode/lock/global/GlobalLockDefinitionTest.java @@ -30,6 +30,6 @@ class GlobalLockDefinitionTest { void assertGetLockKey() { GlobalLock globalLock = mock(GlobalLock.class); when(globalLock.getName()).thenReturn("foo_lock"); - assertThat(new GlobalLockDefinition(globalLock).getLockKey(), is("/lock/exclusive/locks/foo_lock")); + assertThat(new GlobalLockDefinition(globalLock).getLockKey(), is("/lock/global/locks/foo_lock")); } } diff --git a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/GlobalLockPersistServiceTest.java b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/GlobalLockPersistServiceTest.java index 6a34617d5b2bf..ddc86c196835c 100644 --- a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/GlobalLockPersistServiceTest.java +++ b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/service/GlobalLockPersistServiceTest.java @@ -47,7 +47,7 @@ void setUp() { @Test void assertTryLock() { - when(repository.getDistributedLockHolder().getDistributedLock("/lock/exclusive/locks/foo_lock").tryLock(1000L)).thenReturn(true); + when(repository.getDistributedLockHolder().getDistributedLock("/lock/global/locks/foo_lock").tryLock(1000L)).thenReturn(true); GlobalLockDefinition lockDefinition = new GlobalLockDefinition(globalLock); assertTrue(new GlobalLockPersistService(repository).tryLock(lockDefinition, 1000L)); } @@ -56,6 +56,6 @@ void assertTryLock() { void assertUnlock() { GlobalLockDefinition lockDefinition = new GlobalLockDefinition(globalLock); new GlobalLockPersistService(repository).unlock(lockDefinition); - verify(repository.getDistributedLockHolder().getDistributedLock("/lock/exclusive/locks/foo_lock")).unlock(); + verify(repository.getDistributedLockHolder().getDistributedLock("/lock/global/locks/foo_lock")).unlock(); } }