ignite-8004 move setting compatibilityMode to head of collectGridNodeData - Fixes
@@ -639,12 +639,14 @@ public class GridClusterStateProcessor extends GridProcessorAdapter implements I
/** {@inheritDoc} */
@Override public void collectGridNodeData(DiscoveryDataBag dataBag) {
- if (!dataBag.commonDataCollectedFor(STATE_PROC.ordinal())) {
DiscoveryDataBag.JoiningNodeDiscoveryData joiningNodeData = dataBag.newJoinerDiscoveryData(STATE_PROC.ordinal());
- BaselineTopologyHistory historyToSend = null;
+ if (joiningNodeData != null && !joiningNodeData.hasJoiningNodeData())
+ compatibilityMode = true; //compatibility mode: only old nodes don't send any data on join
+
+ if (dataBag.commonDataCollectedFor(STATE_PROC.ordinal()) || joiningNodeData == null)
+ return;
- if (joiningNodeData != null) {
if (!joiningNodeData.hasJoiningNodeData() || compatibilityMode) {
//compatibility mode: old nodes don't send any data on join, so coordinator of new version
//doesn't send BaselineTopology history, only its current globalState
@@ -659,13 +661,17 @@ public class GridClusterStateProcessor extends GridProcessorAdapter implements I
if (joiningNodeData.joiningNodeData() != null)
joiningNodeState = marsh.unmarshal(
(byte[])joiningNodeData.joiningNodeData(),
- U.resolveClassLoader(ctx.config()));
- } catch (IgniteCheckedException e) {
+ U.resolveClassLoader(ctx.config())
+ );
+ }
+ catch (IgniteCheckedException e) {
U.error(log, "Failed to unmarshal disco data from joining node: " + joiningNodeData.joiningNodeId());
return;
}
+ BaselineTopologyHistory historyToSend = null;
+
if (!bltHist.isEmpty()) {
if (joiningNodeState != null && joiningNodeState.baselineTopology() != null) {
int lastId = joiningNodeState.baselineTopology().id();
@@ -678,8 +684,6 @@ public class GridClusterStateProcessor extends GridProcessorAdapter implements I
dataBag.addGridCommonData(STATE_PROC.ordinal(), new BaselineStateAndHistoryData(globalState, historyToSend));
}
- }
- }
/** {@inheritDoc} */
@Override public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data) {
