Skip to content

Commit

Permalink
IGNITE-18304 Removal of daemon node support (apache#10416)
Browse files Browse the repository at this point in the history
  • Loading branch information
nizhikov authored Dec 8, 2022
1 parent 687307b commit 6c38868
Show file tree
Hide file tree
Showing 149 changed files with 242 additions and 2,197 deletions.
1 change: 0 additions & 1 deletion docs/_docs/monitoring-metrics/system-views.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ The NODES view contains information about the cluster nodes.
|CONSISTENT_ID |VARCHAR |Node's consistent ID.
|HOSTNAMES |VARCHAR |The host names of the node.
|IS_CLIENT |BOOLEAN |Indicates whether the node is a client.
|IS_DAEMON |BOOLEAN |Indicates whether the node is a daemon node.
|NODE_ID |UUID |Node ID.
|NODE_ORDER |INT |Node order within the topology.
|VERSION |VARCHAR |Node version.
Expand Down
6 changes: 3 additions & 3 deletions docs/_docs/tools/control-script.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,9 @@ control.sh --system-view nodes
Command [SYSTEM-VIEW] started
Arguments: --system-view nodes
--------------------------------------------------------------------------------
nodeId consistentId version isClient isDaemon nodeOrder addresses hostnames isLocal
a8a28869-cac6-4b17-946a-6f7f547b9f62 0:0:0:0:0:0:0:1%lo0,127.0.0.1,192.168.31.45:47500 2.10.0#20201230-sha1:00000000 false false 1 [0:0:0:0:0:0:0:1%lo0, 127.0.0.1, 192.168.31.45] [192.168.31.45] true
d580433d-c621-45ff-a558-b4df82d09613 0:0:0:0:0:0:0:1%lo0,127.0.0.1,192.168.31.45:47501 2.10.0#20201230-sha1:00000000 false false 2 [0:0:0:0:0:0:0:1%lo0, 127.0.0.1, 192.168.31.45] [192.168.31.45] false
nodeId consistentId version isClient nodeOrder addresses hostnames isLocal
a8a28869-cac6-4b17-946a-6f7f547b9f62 0:0:0:0:0:0:0:1%lo0,127.0.0.1,192.168.31.45:47500 2.10.0#20201230-sha1:00000000 false 1 [0:0:0:0:0:0:0:1%lo0, 127.0.0.1, 192.168.31.45] [192.168.31.45] true
d580433d-c621-45ff-a558-b4df82d09613 0:0:0:0:0:0:0:1%lo0,127.0.0.1,192.168.31.45:47501 2.10.0#20201230-sha1:00000000 false 2 [0:0:0:0:0:0:0:1%lo0, 127.0.0.1, 192.168.31.45] [192.168.31.45] false
Command [SYSTEM-VIEW] finished with code: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ private class TestGridClientLoadBalancer implements GridClientLoadBalancer, Grid
@Override public boolean isClient() {
return node.isClient();
}

@Override public boolean isDaemon() {
return node.isDaemon();
}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public class JdbcConnectionSelfTest extends GridCommonAbstractTest {
/** Grid count. */
private static final int GRID_CNT = 2;

/** Daemon node flag. */
private boolean daemon;

/**
* @return Config URL to use in test.
*/
Expand All @@ -58,8 +55,6 @@ protected String configURL() {

cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME), cacheConfiguration(CUSTOM_CACHE_NAME));

cfg.setDaemon(daemon);

return cfg;
}

Expand Down Expand Up @@ -165,33 +160,6 @@ public void testClientNodeId() throws Exception {
);
}

/**
* @throws Exception If failed.
*/
@Test
public void testDaemonNodeId() throws Exception {
daemon = true;

IgniteEx daemon = startGrid(GRID_CNT);

UUID daemonId = daemon.localNode().id();

final String url = CFG_URL_PREFIX + "nodeId=" + daemonId + '@' + configURL();

GridTestUtils.assertThrows(
log,
new Callable<Object>() {
@Override public Object call() throws Exception {
try (Connection conn = DriverManager.getConnection(url)) {
return conn;
}
}
},
SQLException.class,
"Failed to establish connection with node (is it a server node?): " + daemonId
);
}

/**
* @throws Exception If failed.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,6 @@ public void testGetAllColumns() throws Exception {
"SYS.NODES.CONSISTENT_ID.null",
"SYS.NODES.VERSION.null",
"SYS.NODES.IS_CLIENT.null",
"SYS.NODES.IS_DAEMON.null",
"SYS.NODES.IS_LOCAL.null",
"SYS.NODES.NODE_ORDER.null",
"SYS.NODES.ADDRESSES.null",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class CheckIndexInlineSizes extends AbstractCommand<Void> {
"All secondary indexes have the same effective inline size on all cluster nodes.";

/** Predicate to filter server nodes. */
private static final Predicate<GridClientNode> SRV_NODES = node -> !node.isClient() && !node.isDaemon();
private static final Predicate<GridClientNode> SRV_NODES = node -> !node.isClient();

/** {@inheritDoc} */
@Override public Object execute(GridClientConfiguration clientCfg, IgniteLogger log) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class ConsistencyCommand extends AbstractCommand<Object> {
private boolean parallel;

/** Predicate to filter server nodes. */
private static final Predicate<GridClientNode> SRV_NODES = node -> !node.isClient() && !node.isDaemon();
private static final Predicate<GridClientNode> SRV_NODES = node -> !node.isClient();

/** {@inheritDoc} */
@Override public Object execute(GridClientConfiguration clientCfg, IgniteLogger log) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ public abstract class GridCommandHandlerAbstractTest extends GridCommonAbstractT
/** */
protected static final String CLIENT_NODE_NAME_PREFIX = "client";

/** */
protected static final String DAEMON_NODE_NAME_PREFIX = "daemon";

/** Option is used for auto confirmation. */
protected static final String CMD_AUTO_CONFIRMATION = "--yes";

Expand Down Expand Up @@ -276,8 +273,6 @@ protected boolean idleVerifyRes(Path p) {

cfg.setClientMode(igniteInstanceName.startsWith(CLIENT_NODE_NAME_PREFIX));

cfg.setDaemon(igniteInstanceName.startsWith(DAEMON_NODE_NAME_PREFIX));

cfg.setIncludeEventTypes(EVT_CONSISTENCY_VIOLATION); // Extend if necessary.

if (encryptionEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2816,7 +2816,6 @@ public void testCacheGroupKeyChange() throws Exception {
IgniteEx ignite = startGrids(srvNodes);

startGrid(CLIENT_NODE_NAME_PREFIX);
startGrid(DAEMON_NODE_NAME_PREFIX);

ignite.cluster().state(ACTIVE);

Expand Down Expand Up @@ -2973,7 +2972,7 @@ private boolean isReencryptionStarted(String cacheName) {
for (Ignite grid : G.allGrids()) {
ClusterNode locNode = grid.cluster().localNode();

if (locNode.isClient() || locNode.isDaemon())
if (locNode.isClient())
continue;

if (((IgniteEx)grid).context().encryption().reencryptionFuture(CU.cacheId(cacheName)).isDone())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ private void checkNodesResult(Collection<IgniteEx> nodes, String nodesArg) {

for (List<String> row : rows) {
UUID rowNodeId = UUID.fromString(row.get(0));
boolean isLocal = Boolean.parseBoolean(row.get(8));
boolean isLocal = Boolean.parseBoolean(row.get(7));

assertEquals(nodeId.equals(rowNodeId), isLocal);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ public IgniteFuture<Collection<ClusterStartNodeResult>> startNodesAsync(Collecti

/**
* Sets baseline topology constructed from the cluster topology of the given version (the method succeeds
* only if the cluster topology has not changed). All client and daemon nodes will be filtered out of the
* only if the cluster topology has not changed). All client nodes will be filtered out of the
* resulting baseline.
*
* @param topVer Topology version to set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,6 @@ public final class IgniteSystemProperties {
type = Integer.class, defaults = "0")
public static final String IGNITE_RESTART_CODE = "IGNITE_RESTART_CODE";

/**
* Presence of this system property with value {@code true} will make the grid
* node start as a daemon node. Node that this system property will override
* {@link org.apache.ignite.configuration.IgniteConfiguration#isDaemon()} configuration.
*/
@SystemProperty("If true Ignite will start as a daemon node. Note that this system property " +
"will override IgniteConfiguration.isDaemon() configuration")
public static final String IGNITE_DAEMON = "IGNITE_DAEMON";

/** Defines Ignite installation folder. */
@SystemProperty(value = "Defines Ignite installation folder", type = String.class, defaults = "")
public static final String IGNITE_HOME = "IGNITE_HOME";
Expand Down
28 changes: 0 additions & 28 deletions modules/core/src/main/java/org/apache/ignite/Ignition.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,34 +117,6 @@ protected Ignition() {
// No-op.
}

/**
* Sets daemon flag.
* <p>
* If daemon flag is set then all grid instances created by the factory will be
* daemon, i.e. the local node for these instances will be a daemon node. Note that
* if daemon flag is set - it will override the same settings in {@link org.apache.ignite.configuration.IgniteConfiguration#isDaemon()}.
* Note that you can set on and off daemon flag at will.
*
* @param daemon Daemon flag to set.
*/
public static void setDaemon(boolean daemon) {
IgnitionEx.setDaemon(daemon);
}

/**
* Gets daemon flag.
* <p>
* If daemon flag it set then all grid instances created by the factory will be
* daemon, i.e. the local node for these instances will be a daemon node. Note that
* if daemon flag is set - it will override the same settings in {@link org.apache.ignite.configuration.IgniteConfiguration#isDaemon()}.
* Note that you can set on and off daemon flag at will.
*
* @return Daemon flag.
*/
public static boolean isDaemon() {
return IgnitionEx.isDaemon();
}

/**
* Sets client mode thread-local flag.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,6 @@ public interface ClusterGroup {
*/
public ClusterGroup forHost(String host, String... hosts);

/**
* Gets a cluster group consisting from the daemon nodes.
* <p>
* Daemon nodes are the usual grid nodes that participate in topology but not
* visible on the main APIs, i.e. they are not part of any cluster group. The only
* way to see daemon nodes is to use this method.
* <p>
* Daemon nodes are used primarily for management and monitoring functionality that
* is build on Ignite and needs to participate in the topology, but also needs to be
* excluded from the "normal" topology, so that it won't participate in the task execution
* or in-memory data grid storage.
*
* @return Cluster group consisting from the daemon nodes.
*/
public ClusterGroup forDaemons();

/**
* Creates a cluster group with one random node from the current cluster group.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCluster;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.lang.IgniteProductVersion;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -224,24 +223,6 @@ public interface ClusterNode extends BaselineNode {
*/
public boolean isLocal();

/**
* Tests whether or not this node is a daemon.
* <p>
* Daemon nodes are the usual cluster nodes that participate in topology but are not
* visible on the main APIs, i.e. they are not part of any cluster group. The only
* way to see daemon nodes is to use {@link IgniteCluster#forDaemons()} method.
* <p>
* Daemon nodes are used primarily for management and monitoring functionality that
* is build on Ignite and needs to participate in the topology, but should be
* excluded from the "normal" topology, so that they won't participate in the task execution
* or data grid operations.
* <p>
* Application code should never use daemon nodes.
*
* @return {@code True} if this node is a daemon, {@code false} otherwise.
*/
public boolean isDaemon();

/**
* Whether this node is cache client (see {@link IgniteConfiguration#isClientMode()}).
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.apache.ignite.cache.affinity.Affinity;
import org.apache.ignite.cache.affinity.AffinityFunction;
import org.apache.ignite.cache.store.CacheStoreSessionListener;
import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.cluster.ClusterState;
import org.apache.ignite.compute.ComputeJob;
Expand Down Expand Up @@ -345,9 +344,6 @@ public class IgniteConfiguration {
/** Marshal local jobs. */
private boolean marshLocJobs = DFLT_MARSHAL_LOCAL_JOBS;

/** Daemon flag. */
private boolean daemon;

/** Whether or not peer class loading is enabled. */
private boolean p2pEnabled = DFLT_P2P_ENABLED;

Expand Down Expand Up @@ -680,7 +676,6 @@ public IgniteConfiguration(IgniteConfiguration cfg) {
cliConnCfg = cfg.getClientConnectorConfiguration();
connectorCfg = cfg.getConnectorConfiguration();
consistentId = cfg.getConsistentId();
daemon = cfg.isDaemon();
dataStreamerPoolSize = cfg.getDataStreamerThreadPoolSize();
deployMode = cfg.getDeploymentMode();
discoStartupDelay = cfg.getDiscoveryStartupDelay();
Expand Down Expand Up @@ -796,46 +791,6 @@ public String getIgniteInstanceName() {
return igniteInstanceName;
}

/**
* Whether or not this node should be a daemon node.
* <p>
* Daemon nodes are the usual grid nodes that participate in topology but not
* visible on the main APIs, i.e. they are not part of any cluster groups. The only
* way to see daemon nodes is to use {@link ClusterGroup#forDaemons()} method.
* <p>
* Daemon nodes are used primarily for management and monitoring functionality that
* is build on Ignite and needs to participate in the topology, but also needs to be
* excluded from the "normal" topology, so that it won't participate in the task execution
* or in-memory data grid storage.
*
* @return {@code True} if this node should be a daemon node, {@code false} otherwise.
* @see ClusterGroup#forDaemons()
*/
public boolean isDaemon() {
return daemon;
}

/**
* Sets daemon flag.
* <p>
* Daemon nodes are the usual grid nodes that participate in topology but not
* visible on the main APIs, i.e. they are not part of any cluster group. The only
* way to see daemon nodes is to use {@link ClusterGroup#forDaemons()} method.
* <p>
* Daemon nodes are used primarily for management and monitoring functionality that
* is build on Ignite and needs to participate in the topology, but also needs to be
* excluded from the "normal" topology, so that it won't participate in the task execution
* or in-memory data grid storage.
*
* @param daemon Daemon flag.
* @return {@code this} for chaining.
*/
public IgniteConfiguration setDaemon(boolean daemon) {
this.daemon = daemon;

return this;
}

/**
* Sets grid name. Note that {@code null} is a default grid name.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public ClusterLocalNodeMetricsMXBeanImpl(GridDiscoveryManager discoMgr) {

/** {@inheritDoc} */
@Override public int getTotalBaselineNodes() {
if (!node.isClient() && !node.isDaemon()) {
if (!node.isClient()) {
List<? extends BaselineNode> baselineNodes = discoMgr.baselineNodes(discoMgr.topologyVersionEx());

if (baselineNodes != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,6 @@ public interface GridKernalContext extends Iterable<GridComponent> {
*/
public void printMemoryStats();

/**
* Checks whether this node is daemon.
*
* @return {@code True} if this node is daemon, {@code false} otherwise.
*/
public boolean isDaemon();

/**
* @return Performance suggestions object.
*/
Expand Down
Loading

0 comments on commit 6c38868

Please sign in to comment.