Skip to content

Commit

Permalink
0004507: Master to master setup fails to send initial load if
Browse files Browse the repository at this point in the history
registering with a node other than registration server
  • Loading branch information
jumpmind-josh committed Aug 21, 2020
1 parent 0b6073c commit d2135f2
Showing 1 changed file with 11 additions and 3 deletions.
Expand Up @@ -22,6 +22,7 @@

import static org.apache.commons.lang.StringUtils.isNotBlank;

import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -49,6 +50,8 @@
import org.jumpmind.symmetric.service.IConfigurationService;
import org.jumpmind.symmetric.service.ITriggerRouterService;

import avro.shaded.com.google.common.collect.Sets;

public class ConfigurationChangedDataRouter extends AbstractDataRouter implements IDataRouter, IBuiltInExtensionPoint {

public static final String ROUTER_TYPE = "configurationChanged";
Expand Down Expand Up @@ -340,7 +343,8 @@ protected void routeSymNodeSecurity (Node me,
String nodeIdForRecordBeingRouted, DataMetaData dataMetaData, Set<String> nodeIds, Map<String, String> columnValues) {
DataEventType eventType = dataMetaData.getData().getDataEventType();
boolean fromAnotherNode = isNotBlank(dataMetaData.getData().getSourceNodeId());

boolean masterToMasterInitialLoad = false;

if (nodeIds.contains(nodeIdForRecordBeingRouted)) {
/*
* Don't route node security to it's own node. That node will
Expand All @@ -365,7 +369,11 @@ protected void routeSymNodeSecurity (Node me,
if (reverseLoadQueued) {
remove = false;
}
}
} else if (engine.getConfigurationService().isMasterToMaster() && "1".equals(columnValues.get("INITIAL_LOAD_ENABLED"))) {
remove = false;
masterToMasterInitialLoad = true;
log.info("Master to master registration sym node security update batch allow it to sync out to nodes: " + String.join(", ", nodeIds));
}
}
if (remove) {
nodeIds.remove(nodeIdForRecordBeingRouted);
Expand All @@ -388,7 +396,7 @@ protected void routeSymNodeSecurity (Node me,
* Don't send updates where the initial load flags are enabled to other
* nodes in the cluster
*/
if ("1".equals(columnValues.get("INITIAL_LOAD_ENABLED"))) {
if ("1".equals(columnValues.get("INITIAL_LOAD_ENABLED")) && !masterToMasterInitialLoad) {
nodeIds.clear();
}
}
Expand Down

0 comments on commit d2135f2

Please sign in to comment.