You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by tk...@apache.org on 2025/06/30 10:12:06 UTC
(ignite-3) 01/01: IGNITE-25796 debug
This is an automated email from the ASF dual-hosted git repository.
tkalkirill pushed a commit to branch ignite-25796-debug
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 2c67e31aaf5cb95e1c080a53e660e60140850959
Author: Kirill Tkalenko <tk...@yandex.ru>
AuthorDate: Mon Jun 30 13:11:45 2025 +0300
IGNITE-25796 debug
---
.../cluster/management/LocalStateStorage.java | 24 ++++++++++++++++++++++
.../raft/ClusterStateStorageManager.java | 15 ++++++++++++++
.../ignite/internal/CompatibilityTestBase.java | 12 ++++++++++-
.../org/apache/ignite/internal/RunnerNode.java | 10 ++++++++-
4 files changed, 59 insertions(+), 2 deletions(-)
diff --git a/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/LocalStateStorage.java b/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/LocalStateStorage.java
index a23d88f202b..22805053f39 100644
--- a/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/LocalStateStorage.java
+++ b/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/LocalStateStorage.java
@@ -22,6 +22,10 @@ import java.util.HashSet;
import java.util.Set;
import org.apache.ignite.internal.cluster.management.network.messages.CmgMessagesFactory;
import org.apache.ignite.internal.lang.ByteArray;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
+import org.apache.ignite.internal.tostring.IgniteToStringInclude;
+import org.apache.ignite.internal.tostring.S;
import org.apache.ignite.internal.util.io.IgniteDataInput;
import org.apache.ignite.internal.util.io.IgniteDataOutput;
import org.apache.ignite.internal.vault.VaultEntry;
@@ -41,6 +45,7 @@ class LocalStateStorage {
static class LocalState {
private final Set<String> cmgNodeNames;
+ @IgniteToStringInclude
private final ClusterTag clusterTag;
LocalState(Set<String> cmgNodeNames, ClusterTag clusterTag) {
@@ -55,6 +60,11 @@ class LocalStateStorage {
ClusterTag clusterTag() {
return clusterTag;
}
+
+ @Override
+ public String toString() {
+ return S.toString(this);
+ }
}
private final VaultManager vault;
@@ -63,12 +73,22 @@ class LocalStateStorage {
this.vault = vault;
}
+ private static final IgniteLogger LOG = Loggers.forClass(LocalStateStorage.class);
+
/**
* Retrieves the local state.
*
* @return Local state.
*/
@Nullable LocalState getLocalState() {
+ LocalState localState0 = getLocalState0();
+
+ LOG.info(">>>>> LocalStateStorage#getLocalState: {}", localState0);
+
+ return localState0;
+ }
+
+ private @Nullable LocalState getLocalState0() {
VaultEntry entry = vault.get(CMG_STATE_VAULT_KEY);
if (entry == null) {
@@ -85,6 +105,8 @@ class LocalStateStorage {
*/
void saveLocalState(LocalState state) {
vault.put(CMG_STATE_VAULT_KEY, VersionedSerialization.toBytes(state, LocalStateSerializer.INSTANCE));
+
+ LOG.info(">>>>> LocalStateStorage#saveLocalState: {}", new Exception(), state);
}
/**
@@ -92,6 +114,8 @@ class LocalStateStorage {
*/
void clear() {
vault.remove(CMG_STATE_VAULT_KEY);
+
+ LOG.info(">>>>> LocalStateStorage#clear");
}
private static class LocalStateSerializer extends VersionedSerializer<LocalState> {
diff --git a/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/ClusterStateStorageManager.java b/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/ClusterStateStorageManager.java
index 895cec94606..886f2f55ad5 100644
--- a/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/ClusterStateStorageManager.java
+++ b/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/ClusterStateStorageManager.java
@@ -31,6 +31,8 @@ import org.apache.ignite.internal.cluster.management.ClusterState;
import org.apache.ignite.internal.cluster.management.ClusterStatePersistentSerializer;
import org.apache.ignite.internal.cluster.management.topology.api.LogicalNode;
import org.apache.ignite.internal.cluster.management.topology.api.LogicalNodeSerializer;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
import org.apache.ignite.internal.versioned.VersionedSerialization;
import org.jetbrains.annotations.Nullable;
@@ -52,6 +54,8 @@ public class ClusterStateStorageManager {
this.storage = storage;
}
+ private static final IgniteLogger LOG = Loggers.forClass(ClusterStateStorageManager.class);
+
/**
* Retrieves the current CMG state or {@code null} if it has not been initialized.
*
@@ -59,6 +63,15 @@ public class ClusterStateStorageManager {
*/
@Nullable
public ClusterState getClusterState() {
+ ClusterState clusterState0 = getClusterState0();
+
+ LOG.info(">>>>> ClusterStateStorageManager#getClusterState: {}", clusterState0);
+
+ return clusterState0;
+ }
+
+ @Nullable
+ private ClusterState getClusterState0() {
byte[] value = storage.get(CMG_STATE_KEY);
return value == null ? null : VersionedSerialization.fromBytes(value, ClusterStatePersistentSerializer.INSTANCE);
@@ -71,6 +84,8 @@ public class ClusterStateStorageManager {
*/
public void putClusterState(ClusterState state) {
storage.put(CMG_STATE_KEY, VersionedSerialization.toBytes(state, ClusterStatePersistentSerializer.INSTANCE));
+
+ LOG.info(">>>>> ClusterStateStorageManager#putClusterState: {}", new Exception(), state);
}
/**
diff --git a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java
index e6f2b024bab..8e683fb39ba 100644
--- a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java
+++ b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/CompatibilityTestBase.java
@@ -82,7 +82,7 @@ public abstract class CompatibilityTestBase extends BaseIgniteAbstractTest {
@SuppressWarnings("unused")
@BeforeParameterizedClassInvocation
void startCluster(String baseVersion, TestInfo testInfo) {
- log.info("Starting nodes for base version: {}", baseVersion);
+ log.info("Starting nodes for base version: [baseVersion={}, workDir={}]}", baseVersion, workDir);
ClusterConfiguration clusterConfiguration = ClusterConfiguration.builder(testInfo, workDir)
.defaultNodeBootstrapConfigTemplate(NODE_BOOTSTRAP_CFG_TEMPLATE)
@@ -93,16 +93,26 @@ public abstract class CompatibilityTestBase extends BaseIgniteAbstractTest {
cluster = new IgniteCluster(clusterConfiguration);
cluster.start(baseVersion, nodesCount);
+ log.info(">>>>> startCluster, after start nodes: [baseVersion={}, nodesCount={}]", baseVersion, nodesCount);
+
cluster.init(this::configureInitParameters);
+ log.info(">>>>> startCluster, after init: [baseVersion={}, nodesCount={}]", baseVersion, nodesCount);
+
try (IgniteClient client = cluster.createClient()) {
setupBaseVersion(client);
}
+ log.info(">>>>> startCluster, after start client: [baseVersion={}, nodesCount={}]", baseVersion, nodesCount);
+
if (restartWithCurrentEmbeddedVersion()) {
cluster.stop();
+ log.info(">>>>> startCluster, after cluster stop: [baseVersion={}, nodesCount={}]", baseVersion, nodesCount);
+
cluster.startEmbedded(nodesCount);
+
+ log.info(">>>>> startCluster, after start embeded: [baseVersion={}, nodesCount={}]", baseVersion, nodesCount);
}
}
diff --git a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/RunnerNode.java b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/RunnerNode.java
index 3814844762f..abeec668107 100644
--- a/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/RunnerNode.java
+++ b/modules/compatibility-tests/src/testFixtures/java/org/apache/ignite/internal/RunnerNode.java
@@ -28,6 +28,7 @@ import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
+import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import java.util.stream.Collectors;
@@ -128,6 +129,8 @@ public class RunnerNode {
public void stop() {
process.destroy();
+ CompletableFuture<Process> processCompletableFuture = process.onExit();
+
try {
if (!process.waitFor(30, TimeUnit.SECONDS)) {
processLogger.info("Process did not respond to destroy, destroying forcibly: {}", nodeName);
@@ -140,8 +143,10 @@ public class RunnerNode {
}
}
+ processCompletableFuture.get(30, TimeUnit.SECONDS);
+
processLogger.info("Process stopped: {}", nodeName);
- } catch (InterruptedException e) {
+ } catch (Exception e) {
throw new RuntimeException(e);
}
}
@@ -193,6 +198,9 @@ public class RunnerNode {
"--work-dir", workDir.toString(),
"--config-path", configPath.toString()
);
+
+ pb.redirectErrorStream(true);
+
return pb.start();
}
}