This is an automated email from the ASF dual-hosted git repository.
sanpwc pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new b0698a359e5 IGNITE-26121 Print warning message if MAX_CLOCK_SKEW
exceeded (#6376)
b0698a359e5 is described below
commit b0698a359e5f2350d00da6f995c9f1cd9664d97c
Author: Alexander Lapin <[email protected]>
AuthorDate: Fri Aug 15 19:09:20 2025 +0300
IGNITE-26121 Print warning message if MAX_CLOCK_SKEW exceeded (#6376)
---
.../SchemaSynchronizationConfigurationSchema.java | 1 +
.../ignite/internal/hlc/ClockServiceImpl.java | 22 +++-
.../ignite/internal/hlc/ClockServiceTest.java | 111 +++++++++++++++++++++
.../rebalance/ItRebalanceDistributedTest.java | 18 ++--
.../partition/replicator/fixtures/Node.java | 18 ++--
.../ItPlacementDriverReplicaSideTest.java | 9 +-
.../ignite/internal/replicator/ReplicaService.java | 20 ++--
.../runner/app/ItIgniteNodeRestartTest.java | 39 ++++----
.../org/apache/ignite/internal/app/IgniteImpl.java | 2 +-
.../ignite/distributed/ReplicaUnavailableTest.java | 7 +-
.../storage/InternalTableEstimatedSizeTest.java | 2 +-
.../apache/ignite/distributed/ItTxTestCluster.java | 4 +-
12 files changed, 195 insertions(+), 58 deletions(-)
diff --git
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/configuration/SchemaSynchronizationConfigurationSchema.java
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/configuration/SchemaSynchronizationConfigurationSchema.java
index b8a9004dbdc..c1a67bc8cc0 100644
---
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/configuration/SchemaSynchronizationConfigurationSchema.java
+++
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/configuration/SchemaSynchronizationConfigurationSchema.java
@@ -43,6 +43,7 @@ public class SchemaSynchronizationConfigurationSchema {
*/
@Value(hasDefault = true)
@Range(min = 1)
+ // Please pay attention that since maxClockSkewMillis is immutable it's
cached in ClockServiceImpl.
@Immutable
@PublicName(legacyNames = "maxClockSkew")
public long maxClockSkewMillis = 500;
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/hlc/ClockServiceImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/hlc/ClockServiceImpl.java
index 93599d6249b..e486f3afa6b 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/hlc/ClockServiceImpl.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/hlc/ClockServiceImpl.java
@@ -19,16 +19,22 @@ package org.apache.ignite.internal.hlc;
import java.util.concurrent.CompletableFuture;
import java.util.function.LongSupplier;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
/**
* Default implementation of {@link ClockService}.
*/
public class ClockServiceImpl implements ClockService {
+ private final IgniteLogger log = Loggers.forClass(ClockServiceImpl.class);
+
private final HybridClock clock;
private final ClockWaiter clockWaiter;
private final LongSupplier maxClockSkewMsSupplier;
+ private volatile long maxClockSkewMillis = -1;
+
/**
* Constructor.
*/
@@ -60,6 +66,15 @@ public class ClockServiceImpl implements ClockService {
@Override
public HybridTimestamp updateClock(HybridTimestamp requestTime) {
+ // Since clock.current() is also called inside clock.update formally
it's a method call duplication.
+ // However, since benchmarks did not show any noticeable performance
penalty due to the aforementioned call duplication,
+ // design purity was prioritized over call redundancy.
+ HybridTimestamp currentLocalTimestamp = clock.current();
+ if (requestTime.getPhysical() - maxClockSkewMillis() >
currentLocalTimestamp.getPhysical()) {
+ log.warn("Maximum allowed clock drift exceeded [requestTime={},
localTime={}, maxClockSkew={}]", requestTime,
+ currentLocalTimestamp, maxClockSkewMillis());
+ }
+
return clock.update(requestTime);
}
@@ -70,6 +85,11 @@ public class ClockServiceImpl implements ClockService {
@Override
public long maxClockSkewMillis() {
- return maxClockSkewMsSupplier.getAsLong();
+ // -1 is an invalid maxClockSkewMillis, thus it might be used as a
special "non-initialized" value.
+ if (maxClockSkewMillis == -1) {
+ maxClockSkewMillis = maxClockSkewMsSupplier.getAsLong();
+ }
+
+ return maxClockSkewMillis;
}
}
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/hlc/ClockServiceTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/hlc/ClockServiceTest.java
new file mode 100644
index 00000000000..c7ccc356bcd
--- /dev/null
+++
b/modules/core/src/test/java/org/apache/ignite/internal/hlc/ClockServiceTest.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.hlc;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.internal.testframework.BaseIgniteAbstractTest;
+import org.apache.ignite.internal.testframework.log4j2.LogInspector;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mock;
+
+/**
+ * Tests of a clock service implementation. {@link ClockService}
+ */
+public class ClockServiceTest extends BaseIgniteAbstractTest {
+ private static final long MAX_CLOCK_SKEW_MILLIS = 100;
+ @Mock
+ private ClockWaiter clockWaiter;
+
+ private final ClockServiceLogInspector logInspector = new
ClockServiceLogInspector();
+
+ @BeforeEach
+ void startLogInspectors() {
+ logInspector.start();
+ }
+
+ @AfterEach
+ public void stopCluster() {
+ logInspector.stop();
+ }
+
+ @Test
+ public void testMaximumAllowedClockDriftExceededIsPrinted() {
+ HybridClock clock = new HybridClockImpl();
+ ClockServiceImpl clockService = new ClockServiceImpl(clock,
clockWaiter, () -> MAX_CLOCK_SKEW_MILLIS);
+
+ // Check that request time less than max clock skew won't trigger log
warning.
+
clockService.updateClock(clock.current().addPhysicalTime(MAX_CLOCK_SKEW_MILLIS
/ 2));
+ logInspector.assertNoMessages();
+
+ // Check that request time gt than max clock skew will trigger log
warning.
+ var timeFromFuture1 =
clock.current().addPhysicalTime(MAX_CLOCK_SKEW_MILLIS * 10);
+ clockService.updateClock(timeFromFuture1);
+ logInspector.assertMessageMatchedNtimes(1);
+
+ // Check that a request time greater than max clock skew will trigger
log warning once only.
+ // Or in other words, check that logs won't be flooded with dozens of
warnings caused by the same or similar clock skew.
+ var timeFromFuture2 =
clock.current().addPhysicalTime(MAX_CLOCK_SKEW_MILLIS * 10);
+ clockService.updateClock(timeFromFuture2);
+ clockService.updateClock(timeFromFuture2);
+ // 1 for timeFromFuture1 + timeFromFuture2
+ logInspector.assertMessageMatchedNtimes(2);
+
+ // Check that another request time greater than max clock skew will
trigger log warning once only.
+ var timeFromFuture3 =
clock.current().addPhysicalTime(MAX_CLOCK_SKEW_MILLIS * 10);
+ clockService.updateClock(timeFromFuture3);
+ // 1 for timeFromFuture1 + timeFromFuture2 + timeFromFuture3
+ logInspector.assertMessageMatchedNtimes(3);
+ }
+
+ private static class ClockServiceLogInspector {
+ private static final String EXPECTED_MESSAGE = "Maximum allowed clock
drift exceeded";
+ private final LogInspector logInspector;
+
+ private final AtomicInteger msgCount = new AtomicInteger();
+
+ ClockServiceLogInspector() {
+ this.logInspector = LogInspector.create(ClockServiceImpl.class);
+
+ logInspector.addHandler(
+ evt ->
evt.getMessage().getFormattedMessage().startsWith(EXPECTED_MESSAGE),
+ msgCount::incrementAndGet);
+ }
+
+ void start() {
+ logInspector.start();
+ }
+
+ void stop() {
+ logInspector.stop();
+ }
+
+ void assertNoMessages() {
+ assertThat(String.format("Error message '%s' is present in the
log.", EXPECTED_MESSAGE), msgCount.get(), is(0));
+ }
+
+ void assertMessageMatchedNtimes(int n) {
+ assertThat(String.format("Expected error message '%s' count
doesn't matched.", EXPECTED_MESSAGE), msgCount.get(),
+ is(n));
+ }
+ }
+}
diff --git
a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceDistributedTest.java
b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceDistributedTest.java
index 5edf198dd6b..efad905ba61 100644
---
a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceDistributedTest.java
+++
b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceDistributedTest.java
@@ -1421,9 +1421,17 @@ public class ItRebalanceDistributedTest extends
BaseIgniteAbstractTest {
LongSupplier partitionIdleSafeTimePropagationPeriodMsSupplier = ()
-> 10L;
+ clockWaiter = new ClockWaiter(name, hybridClock,
threadPoolsManager.commonScheduler());
+
+ ClockService clockService = new ClockServiceImpl(
+ hybridClock,
+ clockWaiter,
+ () -> DEFAULT_MAX_CLOCK_SKEW_MS
+ );
+
ReplicaService replicaSvc = new ReplicaService(
clusterService.messagingService(),
- hybridClock,
+ clockService,
threadPoolsManager.partitionOperationsExecutor(),
replicationConfiguration,
threadPoolsManager.commonScheduler()
@@ -1431,14 +1439,6 @@ public class ItRebalanceDistributedTest extends
BaseIgniteAbstractTest {
var resourcesRegistry = new RemotelyTriggeredResourceRegistry();
- clockWaiter = new ClockWaiter(name, hybridClock,
threadPoolsManager.commonScheduler());
-
- ClockService clockService = new ClockServiceImpl(
- hybridClock,
- clockWaiter,
- () -> DEFAULT_MAX_CLOCK_SKEW_MS
- );
-
TransactionInflights transactionInflights = new
TransactionInflights(placementDriver, clockService);
cfgStorage = new DistributedConfigurationStorage("test",
metaStorageManager);
diff --git
a/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/fixtures/Node.java
b/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/fixtures/Node.java
index 9079581cce1..14f4c9e16bb 100644
---
a/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/fixtures/Node.java
+++
b/modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/fixtures/Node.java
@@ -523,9 +523,17 @@ public class Node {
LongSupplier partitionIdleSafeTimePropagationPeriodMsSupplier = () ->
10L;
+ clockWaiter = new ClockWaiter(name, hybridClock,
threadPoolsManager.commonScheduler());
+
+ var clockService = new ClockServiceImpl(
+ hybridClock,
+ clockWaiter,
+ () -> TestIgnitionManager.DEFAULT_MAX_CLOCK_SKEW_MS
+ );
+
ReplicaService replicaSvc = new ReplicaService(
clusterService.messagingService(),
- hybridClock,
+ clockService,
threadPoolsManager.partitionOperationsExecutor(),
replicationConfiguration,
threadPoolsManager.commonScheduler()
@@ -533,14 +541,6 @@ public class Node {
resourcesRegistry = new RemotelyTriggeredResourceRegistry();
- clockWaiter = new ClockWaiter(name, hybridClock,
threadPoolsManager.commonScheduler());
-
- var clockService = new ClockServiceImpl(
- hybridClock,
- clockWaiter,
- () -> TestIgnitionManager.DEFAULT_MAX_CLOCK_SKEW_MS
- );
-
placementDriverManager = new PlacementDriverManager(
name,
metaStorageManager,
diff --git
a/modules/replicator/src/integrationTest/java/org/apache/ignite/internal/replicator/ItPlacementDriverReplicaSideTest.java
b/modules/replicator/src/integrationTest/java/org/apache/ignite/internal/replicator/ItPlacementDriverReplicaSideTest.java
index 86358eeda36..eae538872b6 100644
---
a/modules/replicator/src/integrationTest/java/org/apache/ignite/internal/replicator/ItPlacementDriverReplicaSideTest.java
+++
b/modules/replicator/src/integrationTest/java/org/apache/ignite/internal/replicator/ItPlacementDriverReplicaSideTest.java
@@ -65,6 +65,7 @@ import
org.apache.ignite.internal.configuration.RaftGroupOptionsConfigHelper;
import
org.apache.ignite.internal.configuration.testframework.ConfigurationExtension;
import
org.apache.ignite.internal.configuration.testframework.InjectConfiguration;
import org.apache.ignite.internal.failure.FailureProcessor;
+import org.apache.ignite.internal.hlc.ClockService;
import org.apache.ignite.internal.hlc.HybridClock;
import org.apache.ignite.internal.hlc.HybridClockImpl;
import org.apache.ignite.internal.hlc.TestClockService;
@@ -134,6 +135,8 @@ public class ItPlacementDriverReplicaSideTest extends
IgniteAbstractTest {
private final HybridClock clock = new HybridClockImpl();
+ private final ClockService testClockService = new TestClockService(clock);
+
private Set<String> placementDriverNodeNames;
private Set<String> nodeNames;
@@ -217,7 +220,7 @@ public class ItPlacementDriverReplicaSideTest extends
IgniteAbstractTest {
nodeName,
clusterService,
cmgManager,
- new TestClockService(clock),
+ testClockService,
Set.of(ReplicaMessageTestGroup.class),
new TestPlacementDriver(primaryReplicaSupplier),
partitionOperationsExecutor,
@@ -352,7 +355,7 @@ public class ItPlacementDriverReplicaSideTest extends
IgniteAbstractTest {
new ReplicaService(
clusterService.messagingService(),
- clock,
+ testClockService,
replicationConfiguration
).invoke(
clusterService.topologyService().getByConsistentId(leaderNodeName),
@@ -414,7 +417,7 @@ public class ItPlacementDriverReplicaSideTest extends
IgniteAbstractTest {
new ReplicaService(
clusterService.messagingService(),
- clock,
+ testClockService,
replicationConfiguration
).invoke(
clusterService.topologyService().getByConsistentId(leaderNodeName),
diff --git
a/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaService.java
b/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaService.java
index ce566735e5e..3d97023916f 100644
---
a/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaService.java
+++
b/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaService.java
@@ -35,7 +35,7 @@ import java.util.concurrent.Executor;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeoutException;
-import org.apache.ignite.internal.hlc.HybridClock;
+import org.apache.ignite.internal.hlc.ClockService;
import org.apache.ignite.internal.lang.NodeStoppingException;
import org.apache.ignite.internal.network.MessagingService;
import org.apache.ignite.internal.network.NetworkMessage;
@@ -60,8 +60,8 @@ public class ReplicaService {
/** Message service. */
private final MessagingService messagingService;
- /** A hybrid logical clock. */
- private final HybridClock clock;
+ /** A hybrid logical clock service. */
+ private final ClockService clockService;
private final Executor partitionOperationsExecutor;
@@ -79,18 +79,18 @@ public class ReplicaService {
* The constructor of replica client.
*
* @param messagingService Cluster message service.
- * @param clock A hybrid logical clock.
+ * @param clockService A hybrid logical clock service.
* @param replicationConfiguration Replication configuration.
*/
@TestOnly
public ReplicaService(
MessagingService messagingService,
- HybridClock clock,
+ ClockService clockService,
ReplicationConfiguration replicationConfiguration
) {
this(
messagingService,
- clock,
+ clockService,
ForkJoinPool.commonPool(),
replicationConfiguration,
null
@@ -101,20 +101,20 @@ public class ReplicaService {
* The constructor of replica client.
*
* @param messagingService Cluster message service.
- * @param clock A hybrid logical clock.
+ * @param clockService A hybrid logical clock service.
* @param partitionOperationsExecutor Partition operation executor.
* @param replicationConfiguration Replication configuration.
* @param retryExecutor Retry executor.
*/
public ReplicaService(
MessagingService messagingService,
- HybridClock clock,
+ ClockService clockService,
Executor partitionOperationsExecutor,
ReplicationConfiguration replicationConfiguration,
@Nullable ScheduledExecutorService retryExecutor
) {
this.messagingService = messagingService;
- this.clock = clock;
+ this.clockService = clockService;
this.partitionOperationsExecutor = partitionOperationsExecutor;
this.replicationConfiguration = replicationConfiguration;
this.retryExecutor = retryExecutor;
@@ -161,7 +161,7 @@ public class ReplicaService {
assert response instanceof ReplicaResponse : "Unexpected
message response [resp=" + response + ']';
if (response instanceof TimestampAware) {
- clock.update(((TimestampAware) response).timestamp());
+ clockService.updateClock(((TimestampAware)
response).timestamp());
}
if (response instanceof ErrorReplicaResponse) {
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
index 727472a08ef..7a9b738d62e 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
@@ -476,14 +476,6 @@ public class ItIgniteNodeRestartTest extends
BaseIgniteRestartTest {
message -> threadPoolsManager.partitionOperationsExecutor()
);
- var replicaService = new ReplicaService(
- messagingServiceReturningToStorageOperationsPool,
- hybridClock,
- threadPoolsManager.partitionOperationsExecutor(),
- replicationConfiguration,
- threadPoolsManager.commonScheduler()
- );
-
var lockManager = new HeapLockManager(systemConfiguration);
var logicalTopologyService = new
LogicalTopologyServiceImpl(logicalTopology, cmgManager);
@@ -561,6 +553,10 @@ public class ItIgniteNodeRestartTest extends
BaseIgniteRestartTest {
ConfigurationRegistry clusterConfigRegistry =
clusterCfgMgr.configurationRegistry();
+ var resourcesRegistry = new RemotelyTriggeredResourceRegistry();
+
+ GcConfiguration gcConfig =
clusterConfigRegistry.getConfiguration(GcExtensionConfiguration.KEY).gc();
+
var clockWaiter = new ClockWaiter(name, hybridClock,
scheduledExecutorService);
SchemaSynchronizationConfiguration schemaSyncConfiguration =
clusterConfigRegistry
@@ -572,6 +568,15 @@ public class ItIgniteNodeRestartTest extends
BaseIgniteRestartTest {
() -> schemaSyncConfiguration.maxClockSkewMillis().value()
);
+ var lowWatermark = new LowWatermarkImpl(
+ name,
+ gcConfig.lowWatermark(),
+ clockService,
+ vault,
+ failureProcessor,
+ clusterSvc.messagingService()
+ );
+
maxClockSkewFuture.complete(clockService::maxClockSkewMillis);
var placementDriverManager = new PlacementDriverManager(
@@ -612,24 +617,18 @@ public class ItIgniteNodeRestartTest extends
BaseIgniteRestartTest {
threadPoolsManager.tableIoExecutor(),
replicaGrpId ->
metaStorageMgr.get(pendingPartAssignmentsQueueKey((TablePartitionId)
replicaGrpId))
.thenApply(Entry::value)
-
);
- var resourcesRegistry = new RemotelyTriggeredResourceRegistry();
-
- GcConfiguration gcConfig =
clusterConfigRegistry.getConfiguration(GcExtensionConfiguration.KEY).gc();
+ TransactionInflights transactionInflights = new
TransactionInflights(placementDriverManager.placementDriver(), clockService);
- var lowWatermark = new LowWatermarkImpl(
- name,
- gcConfig.lowWatermark(),
+ var replicaService = new ReplicaService(
+ messagingServiceReturningToStorageOperationsPool,
clockService,
- vault,
- failureProcessor,
- clusterSvc.messagingService()
+ threadPoolsManager.partitionOperationsExecutor(),
+ replicationConfiguration,
+ threadPoolsManager.commonScheduler()
);
- TransactionInflights transactionInflights = new
TransactionInflights(placementDriverManager.placementDriver(), clockService);
-
var txManager = new TxManagerImpl(
name,
txConfiguration,
diff --git
a/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
b/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
index 9607b998802..8a2ca1a61ca 100644
---
a/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
+++
b/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
@@ -871,7 +871,7 @@ public class IgniteImpl implements Ignite {
ReplicaService replicaSvc = new ReplicaService(
messagingServiceReturningToStorageOperationsPool,
- clock,
+ clockService,
threadPoolsManager.partitionOperationsExecutor(),
replicationConfig,
threadPoolsManager.commonScheduler()
diff --git
a/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ReplicaUnavailableTest.java
b/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ReplicaUnavailableTest.java
index 0fddeffb16d..d77eb2b0ce0 100644
---
a/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ReplicaUnavailableTest.java
+++
b/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ReplicaUnavailableTest.java
@@ -57,6 +57,7 @@ import
org.apache.ignite.internal.cluster.management.ClusterManagementGroupManag
import
org.apache.ignite.internal.configuration.testframework.ConfigurationExtension;
import
org.apache.ignite.internal.configuration.testframework.InjectConfiguration;
import org.apache.ignite.internal.failure.NoOpFailureManager;
+import org.apache.ignite.internal.hlc.ClockService;
import org.apache.ignite.internal.hlc.HybridClock;
import org.apache.ignite.internal.hlc.HybridClockImpl;
import org.apache.ignite.internal.hlc.TestClockService;
@@ -138,6 +139,8 @@ public class ReplicaUnavailableTest extends
IgniteAbstractTest {
private final HybridClock clock = new HybridClockImpl();
+ private final ClockService testClockService = new TestClockService(clock);
+
private final TestInfo testInfo;
private ReplicaService replicaService;
@@ -197,7 +200,7 @@ public class ReplicaUnavailableTest extends
IgniteAbstractTest {
replicaService = new ReplicaService(
clusterService.messagingService(),
- clock,
+ testClockService,
replicationConfiguration
);
@@ -205,7 +208,7 @@ public class ReplicaUnavailableTest extends
IgniteAbstractTest {
NODE_NAME,
clusterService,
cmgManager,
- new TestClockService(clock),
+ testClockService,
Set.of(PartitionReplicationMessageGroup.class,
TxMessageGroup.class),
new
TestPlacementDriver(clusterService.topologyService().localMember()),
requestsExecutor,
diff --git
a/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/storage/InternalTableEstimatedSizeTest.java
b/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/storage/InternalTableEstimatedSizeTest.java
index c9e14346c2c..baca5351f23 100644
---
a/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/storage/InternalTableEstimatedSizeTest.java
+++
b/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/storage/InternalTableEstimatedSizeTest.java
@@ -221,7 +221,7 @@ public class InternalTableEstimatedSizeTest extends
BaseIgniteAbstractTest {
txManager,
tableStorage,
txStateStorage,
- new ReplicaService(clusterService.messagingService(), clock,
replicationConfiguration),
+ new ReplicaService(clusterService.messagingService(),
clockService, replicationConfiguration),
clockService,
HybridTimestampTracker.atomicTracker(null),
placementDriver,
diff --git
a/modules/table/src/testFixtures/java/org/apache/ignite/distributed/ItTxTestCluster.java
b/modules/table/src/testFixtures/java/org/apache/ignite/distributed/ItTxTestCluster.java
index 3487395afba..75b302c7268 100644
---
a/modules/table/src/testFixtures/java/org/apache/ignite/distributed/ItTxTestCluster.java
+++
b/modules/table/src/testFixtures/java/org/apache/ignite/distributed/ItTxTestCluster.java
@@ -509,7 +509,7 @@ public class ItTxTestCluster {
ReplicaService replicaSvc = spy(new ReplicaService(
clusterService.messagingService(),
- clock,
+ clockService,
partitionOperationsExecutor,
replicationConfiguration,
executor
@@ -1298,7 +1298,7 @@ public class ItTxTestCluster {
clientReplicaSvc = spy(new ReplicaService(
client.messagingService(),
- clientClock,
+ clientClockService,
partitionOperationsExecutor,
replicationConfiguration,
executor