Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
227c3a1
raw
Vladsz83 Feb 18, 2026
1e1dd00
fix
Vladsz83 Feb 18, 2026
43f4267
fix
Vladsz83 Feb 18, 2026
d68b352
fix
Vladsz83 Feb 19, 2026
5ac43ab
Merge branch 'master' into Message-serializer-for-TcpDiscoveryNodeAdd…
Vladsz83 Feb 19, 2026
1064805
refactoring. + dedicated if
Vladsz83 Feb 19, 2026
4adf01a
impl
Vladsz83 Feb 19, 2026
330d359
Revert "impl"
Vladsz83 Feb 19, 2026
1baa2f2
Revert "refactoring. + dedicated if"
Vladsz83 Feb 19, 2026
9067b9b
fix the serialization
Vladsz83 Feb 19, 2026
d4e6b2b
fixes
Vladsz83 Feb 20, 2026
fb52e0e
fixes
Vladsz83 Feb 20, 2026
333185b
fixes
Vladsz83 Feb 21, 2026
31a3d29
lost serialization fix
Vladsz83 Feb 21, 2026
0a2b97e
Merge branch 'master' into TcpDiscoveryNodeAddedMessage
Vladsz83 Feb 21, 2026
7272166
+ master
Vladsz83 Feb 21, 2026
31c46d9
minor
Vladsz83 Feb 21, 2026
e3e7ae2
impl
Vladsz83 Feb 21, 2026
629d051
impl
Vladsz83 Feb 22, 2026
c8a1ac8
fix
Vladsz83 Feb 22, 2026
ff8a9ee
fix
Vladsz83 Feb 22, 2026
15000d1
+ datapacket serr
Vladsz83 Feb 22, 2026
7b1351d
fix
Vladsz83 Feb 23, 2026
c1d3f81
minority
Vladsz83 Feb 23, 2026
0e72fe3
Merge branch 'master' into IGNITE-27556-TcpDiscoveryNodeAddedMessage_…
Vladsz83 Feb 24, 2026
ccc0c85
merged master
Vladsz83 Feb 24, 2026
e75a62c
reserach
Vladsz83 Feb 24, 2026
a9b9ed4
Revert "reserach"
Vladsz83 Feb 24, 2026
f47b463
Merge branch 'master' into IGNITE-27556-TcpDiscoveryNodeAddedMessage_…
Vladsz83 Feb 24, 2026
d3aa143
impl
Vladsz83 Feb 24, 2026
a1f9eac
+ TcpDiscoveryJoinRequestMessage
Vladsz83 Feb 24, 2026
554d32b
cleanup
Vladsz83 Feb 25, 2026
7ad43b8
Merge branch 'master' into IGNITE-27556-TcpDiscoveryNodeAddedMessage_…
Vladsz83 Feb 25, 2026
2015fb6
trivial
Vladsz83 Feb 26, 2026
9e84d84
Merge branch 'master' into IGNITE-27556-TcpDiscoveryNodeAddedMessage_…
Vladsz83 Feb 26, 2026
8233e7e
+ master
Vladsz83 Feb 26, 2026
a45a00b
+ master
Vladsz83 Feb 26, 2026
c401565
Merge branch 'master' into IGNITE-27556-TcpDiscoveryNodeAddedMessage_…
Vladsz83 Feb 28, 2026
e040436
Merge branch 'master' into IGNITE-27556-TcpDiscoveryNodeAddedMessage_…
Vladsz83 Mar 10, 2026
0ad2962
+ master
Vladsz83 Mar 10, 2026
27280a1
revert NodeAdded mg collection inclusion fix
Vladsz83 Mar 10, 2026
11ad3d2
minority
Vladsz83 Mar 11, 2026
39980f1
Merge branch 'master' into IGNITE-27556-TcpDiscoveryNodeAddedMessage_…
Vladsz83 Mar 13, 2026
2663f06
+ master
Vladsz83 Mar 13, 2026
c2adc31
test fix
Vladsz83 Mar 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryMetricsUpdateMessageSerializer;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddFinishedMessage;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddFinishedMessageMarshallableSerializer;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddedMessage;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddedMessageMarshallableSerializer;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessageSerializer;
import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFullMetricsMessage;
Expand Down Expand Up @@ -199,6 +201,8 @@ public DiscoveryMessageFactory(Marshaller cstDataMarshall, ClassLoader cstDataMa
factory.register((short)27, DistributedMetaStorageCasAckMessage::new, new DistributedMetaStorageCasAckMessageSerializer());
factory.register((short)28, TcpDiscoveryClientReconnectMessage::new,
new TcpDiscoveryClientReconnectMessageMarshallableSerializer(cstDataMarshall, cstDataMarshallClsLdr));
factory.register((short)29, TcpDiscoveryNodeAddedMessage::new,
new TcpDiscoveryNodeAddedMessageMarshallableSerializer(cstDataMarshall, cstDataMarshallClsLdr));

// DiscoveryCustomMessage
factory.register((short)500, CacheStatisticsModeChangeMessage::new, new CacheStatisticsModeChangeMessageSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
@GridToStringExclude
private Collection<TcpDiscoveryAbstractMessage> msgs;

/** Srialized bytes of {@link #msgs}. */
/**
* TODO: Use direct messages or a message container after https://issues.apache.org/jira/browse/IGNITE-25883

Check warning on line 54 in modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientReconnectMessage.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this TODO comment.

See more on https://sonarcloud.io/project/issues?id=apache_ignite&issues=AZz8CGkbNN4pUotumtlM&open=AZz8CGkbNN4pUotumtlM&pullRequest=12790
* Srialized bytes of {@link #msgs}.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: Serialized

*/
@Order(2)
byte[] msgsBytes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public Map<String, Object> clientNodeAttributes() {
*/
public void clientNodeAttributes(Map<String, Object> clientNodeAttrs) {
this.clientNodeAttrs = clientNodeAttrs;
clientNodeAttrsBytes = null;
}

/** {@inheritDoc} */
Expand All @@ -135,6 +136,8 @@ public void clientNodeAttributes(Map<String, Object> clientNodeAttrs) {
@Override public void finishUnmarshal(Marshaller marsh, ClassLoader clsLdr) throws IgniteCheckedException {
if (clientNodeAttrsBytes != null)
clientNodeAttrs = U.unmarshal(marsh, clientNodeAttrsBytes, clsLdr);

clientNodeAttrsBytes = null;
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,84 @@
import java.util.Collection;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.managers.discovery.DiscoveryMessageFactory;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.plugin.extensions.communication.MarshallableMessage;
import org.apache.ignite.spi.discovery.tcp.internal.DiscoveryDataPacket;
import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
import org.jetbrains.annotations.Nullable;

/**
* TODO: Use NodeMessage for {@link TcpDiscoveryNode} and {@link ClusterNode} after https://issues.apache.org/jira/browse/IGNITE-27899

Check warning on line 38 in modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this TODO comment.

See more on https://sonarcloud.io/project/issues?id=apache_ignite&issues=AZz8CGcrNN4pUotumtlK&open=AZz8CGcrNN4pUotumtlK&pullRequest=12790
* Message telling nodes that new node should be added to topology.
* When newly added node receives the message it connects to its next and finishes
* join process.
*/
@TcpDiscoveryEnsureDelivery
@TcpDiscoveryRedirectToClient
public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractTraceableMessage {
public class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractTraceableMessage implements MarshallableMessage {

Check warning on line 45 in modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Override the "equals" method in this class.

See more on https://sonarcloud.io/project/issues?id=apache_ignite&issues=AZz8CGcrNN4pUotumtlJ&open=AZz8CGcrNN4pUotumtlJ&pullRequest=12790
/** */
private static final long serialVersionUID = 0L;

/** Added node. */
private final TcpDiscoveryNode node;
private TcpDiscoveryNode node;

/** Marshalled {@link #node}. */
@Order(0)
@GridToStringExclude
byte[] nodeBytes;

/** */
private DiscoveryDataPacket dataPacket;
@Order(1)
DiscoveryDataPacket dataPacket;

/** Pending messages from previous node. */
private Collection<TcpDiscoveryAbstractMessage> msgs;

/**
* TODO: Use direct messages or a message container after https://issues.apache.org/jira/browse/IGNITE-25883

Check warning on line 65 in modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this TODO comment.

See more on https://sonarcloud.io/project/issues?id=apache_ignite&issues=AZz8CGcrNN4pUotumtlL&open=AZz8CGcrNN4pUotumtlL&pullRequest=12790
* Marshalled {@link #msgs}.
*/
@Order(2)
@GridToStringExclude
byte[] msgsBytes;

/** Current topology. Initialized by coordinator. */
@GridToStringInclude
private Collection<TcpDiscoveryNode> top;

/** Marshalled {@link #top}. */
@Order(3)
@GridToStringExclude
@Nullable byte[] topBytes;

/** */
@GridToStringInclude
private transient Collection<TcpDiscoveryNode> clientTop;

/** Topology snapshots history. */
private Map<Long, Collection<ClusterNode>> topHist;

/** Marshalled {@link #topHist}. */
@Order(4)
@GridToStringExclude
@Nullable byte[] topHistBytes;

/** Start time of the first grid node. */
private final long gridStartTime;
@Order(5)
long gridStartTime;

/** Constructor for {@link DiscoveryMessageFactory}. */
public TcpDiscoveryNodeAddedMessage() {
// No-op.
}

/**
* Constructor.
Expand All @@ -69,7 +107,8 @@
* @param dataPacket container for collecting discovery data across the cluster.
* @param gridStartTime Start time of the first grid node.
*/
public TcpDiscoveryNodeAddedMessage(UUID creatorNodeId,
public TcpDiscoveryNodeAddedMessage(
UUID creatorNodeId,
TcpDiscoveryNode node,
DiscoveryDataPacket dataPacket,
long gridStartTime
Expand All @@ -90,13 +129,17 @@
public TcpDiscoveryNodeAddedMessage(TcpDiscoveryNodeAddedMessage msg) {
super(msg);

this.node = msg.node;
this.msgs = msg.msgs;
this.top = msg.top;
this.clientTop = msg.clientTop;
this.topHist = msg.topHist;
this.dataPacket = msg.dataPacket;
this.gridStartTime = msg.gridStartTime;
node = msg.node;
nodeBytes = msg.nodeBytes;
msgs = msg.msgs;
msgsBytes = msg.msgsBytes;
top = msg.top;
topBytes = msg.topBytes;
clientTop = msg.clientTop;
topHist = msg.topHist;
topHistBytes = msg.topHistBytes;
dataPacket = msg.dataPacket;
gridStartTime = msg.gridStartTime;
}

/**
Expand All @@ -122,10 +165,9 @@
*
* @param msgs Pending messages to send to new node.
*/
public void messages(
@Nullable Collection<TcpDiscoveryAbstractMessage> msgs
) {
public void messages(@Nullable Collection<TcpDiscoveryAbstractMessage> msgs) {
this.msgs = msgs;
msgsBytes = null;
}

/**
Expand All @@ -144,6 +186,7 @@
*/
public void topology(@Nullable Collection<TcpDiscoveryNode> top) {
this.top = top;
topBytes = null;
}

/**
Expand All @@ -152,7 +195,7 @@
public void clientTopology(Collection<TcpDiscoveryNode> top) {
assert top != null && !top.isEmpty() : top;

this.clientTop = top;
clientTop = top;
}

/**
Expand All @@ -178,6 +221,7 @@
*/
public void topologyHistory(@Nullable Map<Long, Collection<ClusterNode>> topHist) {
this.topHist = topHist;
topHistBytes = null;
}

/**
Expand Down Expand Up @@ -210,6 +254,47 @@
return gridStartTime;
}

/** @param marsh marshaller. */
@Override public void prepareMarshal(Marshaller marsh) throws IgniteCheckedException {
if (node != null)
nodeBytes = U.marshal(marsh, node);

if (msgs != null)
msgsBytes = U.marshal(marsh, msgs);

if (top != null)
topBytes = U.marshal(marsh, top);

if (topHist != null)
topHistBytes = U.marshal(marsh, topHist);
}

/** {@inheritDoc} */
@Override public void finishUnmarshal(Marshaller marsh, ClassLoader clsLdr) throws IgniteCheckedException {
if (nodeBytes != null)
node = U.unmarshal(marsh, nodeBytes, clsLdr);

if (msgsBytes != null)
msgs = U.unmarshal(marsh, msgsBytes, clsLdr);

if (topBytes != null)
top = U.unmarshal(marsh, topBytes, clsLdr);

if (topHistBytes != null)
topHist = U.unmarshal(marsh, topHistBytes, clsLdr);

nodeBytes = null;
topBytes = null;
topHistBytes = null;
msgsBytes = null;
}


/** {@inheritDoc} */
@Override public short directType() {
return 29;
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(TcpDiscoveryNodeAddedMessage.class, this, "super", super.toString());
Expand Down
Loading