This is an automated email from the ASF dual-hosted git repository.
rpuch 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 9e1d94554eb IGNITE-25523 Improve node stop handling in
IndexBuildController (#5925)
9e1d94554eb is described below
commit 9e1d94554eb5144f33d75df310082073fa78ad78
Author: Roman Puchkovskiy <[email protected]>
AuthorDate: Thu May 29 12:19:08 2025 +0400
IGNITE-25523 Improve node stop handling in IndexBuildController (#5925)
---
.../internal/index/IndexBuildController.java | 31 +++++-----------------
1 file changed, 6 insertions(+), 25 deletions(-)
diff --git
a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
index 02200d929e6..5e4901120d0 100644
---
a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
+++
b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
@@ -32,7 +32,6 @@ import static
org.apache.ignite.internal.util.CompletableFutures.nullCompletedFu
import static org.apache.ignite.internal.util.ExceptionUtils.hasCause;
import static org.apache.ignite.internal.util.IgniteUtils.inBusyLock;
import static org.apache.ignite.internal.util.IgniteUtils.inBusyLockAsync;
-import static org.apache.ignite.lang.ErrorGroups.Common.INTERNAL_ERR;
import java.util.ArrayList;
import java.util.Set;
@@ -56,7 +55,6 @@ import org.apache.ignite.internal.failure.FailureProcessor;
import org.apache.ignite.internal.failure.FailureType;
import org.apache.ignite.internal.hlc.ClockService;
import org.apache.ignite.internal.hlc.HybridTimestamp;
-import org.apache.ignite.internal.lang.IgniteInternalException;
import org.apache.ignite.internal.lang.NodeStoppingException;
import org.apache.ignite.internal.logger.IgniteLogger;
import org.apache.ignite.internal.logger.Loggers;
@@ -78,7 +76,6 @@ import org.apache.ignite.internal.util.CompletableFutures;
import org.apache.ignite.internal.util.ExceptionUtils;
import org.apache.ignite.internal.util.IgniteSpinBusyLock;
import org.apache.ignite.network.ClusterNode;
-import org.jetbrains.annotations.Nullable;
/**
* Component is responsible for starting and stopping the building of indexes
on primary replicas.
@@ -240,7 +237,8 @@ class IndexBuildController implements ManuallyCloseable {
return CompletableFutures.allOf(startBuildIndexFutures);
}).whenComplete((res, ex) -> {
- if (ex != null && !hasCause(ex, NodeStoppingException.class,
TableClosedException.class)) {
+ // StorageClosedException happens on node stop, so we can ignore
it.
+ if (ex != null && !hasCause(ex, NodeStoppingException.class,
StorageClosedException.class)) {
failureProcessor.process(new
FailureContext(FailureType.CRITICAL_ERROR, ex));
}
});
@@ -339,7 +337,8 @@ class IndexBuildController implements ManuallyCloseable {
}
}).whenComplete((res, ex) -> {
if (ex != null) {
- if (!hasCause(ex, NodeStoppingException.class,
TableClosedException.class)) {
+ // StorageClosedException happens on node stop, so we can
ignore it.
+ if (!hasCause(ex, NodeStoppingException.class,
StorageClosedException.class)) {
failureProcessor.process(new
FailureContext(FailureType.CRITICAL_ERROR, ex));
}
}
@@ -545,12 +544,7 @@ class IndexBuildController implements ManuallyCloseable {
int tableId,
int partitionId
) {
- MvPartitionStorage mvPartition;
- try {
- mvPartition = mvTableStorage.getMvPartition(partitionId);
- } catch (StorageClosedException e) {
- throw new TableClosedException(tableId, e);
- }
+ MvPartitionStorage mvPartition =
mvTableStorage.getMvPartition(partitionId);
assert mvPartition != null : "Partition storage is missing [zoneId=" +
zoneId
+ ", tableId=" + tableId + ", partitionId=" + partitionId +
"].";
@@ -563,23 +557,10 @@ class IndexBuildController implements ManuallyCloseable {
int partitionId,
CatalogIndexDescriptor indexDescriptor
) {
- IndexStorage indexStorage;
- try {
- indexStorage = mvTableStorage.getIndex(partitionId,
indexDescriptor.id());
- } catch (StorageClosedException e) {
- throw new TableClosedException(indexDescriptor.tableId(), e);
- }
+ IndexStorage indexStorage = mvTableStorage.getIndex(partitionId,
indexDescriptor.id());
assert indexStorage != null : "Index storage is missing [partitionId="
+ partitionId + ", indexId=" + indexDescriptor.id() + "].";
return indexStorage;
}
-
- private static class TableClosedException extends IgniteInternalException {
- private static final long serialVersionUID = 1L;
-
- private TableClosedException(int tableId, @Nullable Throwable cause) {
- super(INTERNAL_ERR, "Table is closed [tableId=" + tableId + "]",
cause);
- }
- }
}