This is an automated email from the ASF dual-hosted git repository.
sk0x50 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 0d26094f29d IGNITE-25179 Fix AssertionError on table stopping when the
colocation is enabled (#5664)
0d26094f29d is described below
commit 0d26094f29dc7a2c886e9439c835a5732173035d
Author: Slava Koptilin <[email protected]>
AuthorDate: Wed Apr 23 12:43:23 2025 +0300
IGNITE-25179 Fix AssertionError on table stopping when the colocation is
enabled (#5664)
---
.../ignite/internal/lowwatermark/LowWatermarkImpl.java | 14 ++++----------
.../replicator/PartitionReplicaLifecycleManager.java | 2 ++
.../partition/replicator/ZoneResourcesManager.java | 13 +++++++++----
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git
a/modules/low-watermark/src/main/java/org/apache/ignite/internal/lowwatermark/LowWatermarkImpl.java
b/modules/low-watermark/src/main/java/org/apache/ignite/internal/lowwatermark/LowWatermarkImpl.java
index 6a660ed1944..3946912a666 100644
---
a/modules/low-watermark/src/main/java/org/apache/ignite/internal/lowwatermark/LowWatermarkImpl.java
+++
b/modules/low-watermark/src/main/java/org/apache/ignite/internal/lowwatermark/LowWatermarkImpl.java
@@ -234,18 +234,12 @@ public class LowWatermarkImpl extends
AbstractEventProducer<LowWatermarkEvent, L
}
private void setLowWatermark(HybridTimestamp newLowWatermark) {
- updateLowWatermarkLock.writeLock().lock();
-
- try {
- HybridTimestamp lwm = lowWatermark;
+ HybridTimestamp lwm = lowWatermark;
- assert lwm == null || newLowWatermark.compareTo(lwm) > 0 :
- "Low watermark should only grow: [cur=" + lwm + ", new=" +
newLowWatermark + "]";
+ assert lwm == null || newLowWatermark.compareTo(lwm) > 0 :
+ "Low watermark should only grow: [cur=" + lwm + ", new=" +
newLowWatermark + "]";
- lowWatermark = newLowWatermark;
- } finally {
- updateLowWatermarkLock.writeLock().unlock();
- }
+ lowWatermark = newLowWatermark;
}
private void setLowWatermarkOnRecovery(@Nullable HybridTimestamp
newLowWatermark) {
diff --git
a/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java
b/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java
index da271addb01..44ef968e343 100644
---
a/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java
+++
b/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java
@@ -1586,6 +1586,8 @@ public class PartitionReplicaLifecycleManager extends
) {
ZonePartitionResources resources =
zoneResourcesManager.getZonePartitionResources(zonePartitionId);
+ requireNonNull(resources, "Zone partition resources not found
[zonePartitionId=" + zonePartitionId + ']');
+
// Register an intent to register a table-wide replica listener. On
recovery this method is called before the replica is started,
// so the listeners will be registered by the thread completing the
"replicaListenerFuture". On normal operation (where there is
// a HB relationship between zone and table creation) zone-wide
replica must already be started, this future will always be
diff --git
a/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/ZoneResourcesManager.java
b/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/ZoneResourcesManager.java
index af5cc560786..8d82e3d3178 100644
---
a/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/ZoneResourcesManager.java
+++
b/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/ZoneResourcesManager.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.partition.replicator;
+import static
org.apache.ignite.internal.util.CompletableFutures.nullCompletedFuture;
import static org.apache.ignite.internal.util.IgniteUtils.inBusyLock;
import java.util.Map;
@@ -131,15 +132,15 @@ class ZoneResourcesManager implements ManuallyCloseable {
return zonePartitionResources;
}
- ZonePartitionResources getZonePartitionResources(ZonePartitionId
zonePartitionId) {
+ @Nullable ZonePartitionResources getZonePartitionResources(ZonePartitionId
zonePartitionId) {
ZoneResources zoneResources =
resourcesByZoneId.get(zonePartitionId.zoneId());
- assert zoneResources != null : "Missing resources for zone " +
zonePartitionId.zoneId();
+ if (zoneResources == null) {
+ return null;
+ }
ZonePartitionResources zonePartitionResources =
zoneResources.resourcesByPartitionId.get(zonePartitionId.partitionId());
- assert zonePartitionResources != null : "Missing resources for
partition " + zonePartitionId;
-
return zonePartitionResources;
}
@@ -182,6 +183,10 @@ class ZoneResourcesManager implements ManuallyCloseable {
CompletableFuture<Void> removeTableResources(ZonePartitionId
zonePartitionId, int tableId) {
ZonePartitionResources resources =
getZonePartitionResources(zonePartitionId);
+ if (resources == null) {
+ return nullCompletedFuture();
+ }
+
return resources.replicaListenerFuture
.thenCompose(zoneReplicaListener -> {
zoneReplicaListener.removeTableReplicaProcessor(tableId);