Skip to content

Commit a574200

Browse files
authored
IGNITE-24096 Remove GridDhtPartitionSupplyMessageV2#AVAILABLE_SINCE (#11811)
1 parent d1962ec commit a574200

File tree

5 files changed

+13
-20
lines changed

5 files changed

+13
-20
lines changed

modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtForceKeysResponse;
9494
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandMessage;
9595
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId;
96+
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyErrorMessage;
9697
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage;
97-
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessageV2;
9898
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsFullMessage;
9999
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsSingleMessage;
100100
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsSingleRequest;
@@ -315,7 +315,7 @@ public class GridIoMessageFactory implements MessageFactoryProvider {
315315
factory.register((short)134, ContinuousRoutineStartResultMessage::new);
316316
factory.register((short)135, LatchAckMessage::new);
317317
factory.register((short)157, PartitionUpdateCountersMessage::new);
318-
factory.register((short)158, GridDhtPartitionSupplyMessageV2::new);
318+
factory.register((short)158, GridDhtPartitionSupplyErrorMessage::new);
319319
factory.register((short)162, GenerateEncryptionKeyRequest::new);
320320
factory.register((short)163, GenerateEncryptionKeyResponse::new);
321321
factory.register((short)167, ServiceDeploymentProcessId::new);

modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -444,15 +444,12 @@ else if (iter.isPartitionMissing(p)) {
444444
if (grp.shared().kernalContext().isStopping())
445445
return;
446446

447-
// Sending supply messages with error requires new protocol.
448-
boolean sendErrMsg = demanderNode.version().compareTo(GridDhtPartitionSupplyMessageV2.AVAILABLE_SINCE) >= 0;
447+
boolean skipErrMsg = t instanceof IgniteSpiException;
449448

450-
if (t instanceof IgniteSpiException) {
449+
if (skipErrMsg) {
451450
if (log.isDebugEnabled())
452451
log.debug("Failed to send message to node (current node is stopping?) ["
453452
+ supplyRoutineInfo(topicId, nodeId, demandMsg) + ", msg=" + t.getMessage() + ']');
454-
455-
sendErrMsg = false;
456453
}
457454
else
458455
U.error(log, "Failed to continue supplying ["
@@ -467,7 +464,7 @@ else if (iter.isPartitionMissing(p)) {
467464
+ supplyRoutineInfo(topicId, nodeId, demandMsg) + ']', t1);
468465
}
469466

470-
if (!sendErrMsg)
467+
if (skipErrMsg)
471468
return;
472469

473470
boolean fallbackToFullRebalance = X.hasCause(t, IgniteHistoricalIteratorException.class);
@@ -491,7 +488,7 @@ else if (iter.isPartitionMissing(p)) {
491488
errMsg = supplyMsg;
492489
}
493490
else {
494-
errMsg = new GridDhtPartitionSupplyMessageV2(
491+
errMsg = new GridDhtPartitionSupplyErrorMessage(
495492
demandMsg.rebalanceId(),
496493
grp.groupId(),
497494
demandMsg.topologyVersion(),
+4-8
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,17 @@
2323
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
2424
import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
2525
import org.apache.ignite.internal.util.typedef.internal.U;
26-
import org.apache.ignite.lang.IgniteProductVersion;
2726
import org.apache.ignite.plugin.extensions.communication.MessageReader;
2827
import org.apache.ignite.plugin.extensions.communication.MessageWriter;
2928
import org.jetbrains.annotations.Nullable;
3029

3130
/**
3231
* Supply message with supplier error transfer support.
3332
*/
34-
public class GridDhtPartitionSupplyMessageV2 extends GridDhtPartitionSupplyMessage {
33+
public class GridDhtPartitionSupplyErrorMessage extends GridDhtPartitionSupplyMessage {
3534
/** */
3635
private static final long serialVersionUID = 0L;
3736

38-
/** Available since. */
39-
public static final IgniteProductVersion AVAILABLE_SINCE = IgniteProductVersion.fromString("2.7.0");
40-
4137
/** Supplying process error. */
4238
@GridDirectTransient
4339
private Throwable err;
@@ -48,7 +44,7 @@ public class GridDhtPartitionSupplyMessageV2 extends GridDhtPartitionSupplyMessa
4844
/**
4945
* Default constructor.
5046
*/
51-
public GridDhtPartitionSupplyMessageV2() {
47+
public GridDhtPartitionSupplyErrorMessage() {
5248
}
5349

5450
/**
@@ -58,7 +54,7 @@ public GridDhtPartitionSupplyMessageV2() {
5854
* @param addDepInfo Add dep info.
5955
* @param err Supply process error.
6056
*/
61-
public GridDhtPartitionSupplyMessageV2(
57+
public GridDhtPartitionSupplyErrorMessage(
6258
long rebalanceId,
6359
int grpId,
6460
AffinityTopologyVersion topVer,
@@ -133,7 +129,7 @@ public GridDhtPartitionSupplyMessageV2(
133129

134130
}
135131

136-
return reader.afterMessageRead(GridDhtPartitionSupplyMessageV2.class);
132+
return reader.afterMessageRead(GridDhtPartitionSupplyErrorMessage.class);
137133
}
138134

139135
/** {@inheritDoc} */

modules/core/src/main/resources/META-INF/classnames.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPar
11831183
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap
11841184
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap
11851185
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage
1186-
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessageV2
1186+
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyErrorMessage
11871187
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsAbstractMessage
11881188
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture$2
11891189
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture$3

modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNoAffinityExchangeTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import org.apache.ignite.internal.TestRecordingCommunicationSpi;
4747
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
4848
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffinityAssignmentRequest;
49-
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessageV2;
49+
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyErrorMessage;
5050
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsSingleMessage;
5151
import org.apache.ignite.internal.util.typedef.G;
5252
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -290,7 +290,7 @@ public void testNoAffinityChangeOnClientLeftWithMergedExchanges() throws Excepti
290290

291291
TestRecordingCommunicationSpi.spi(ig).blockMessages(new IgniteBiPredicate<ClusterNode, Message>() {
292292
@Override public boolean apply(ClusterNode node, Message msg) {
293-
return msg instanceof GridDhtPartitionSupplyMessageV2;
293+
return msg instanceof GridDhtPartitionSupplyErrorMessage;
294294
}
295295
});
296296

0 commit comments

Comments
 (0)