Skip to content

Commit

Permalink
0003220: Cannot Register a remote node to another remote node before
Browse files Browse the repository at this point in the history
initial load
  • Loading branch information
chenson42 committed Oct 3, 2017
1 parent f29c9e6 commit 9a84cb6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Expand Up @@ -107,6 +107,7 @@ private ParameterConstants() {
public final static String REGISTRATION_REOPEN_USE_SAME_PASSWORD = "registration.reopen.use.same.password";
public final static String REGISTRATION_REQUIRE_NODE_GROUP_LINK = "registration.require.node.group.link";
public final static String REGISTRATION_REINITIALIZE_ENABLED = "registration.reinitialize.enable";
public final static String REGISTRATION_REQUIRE_INITIAL_LOAD = "registration.require.initial.load";

public final static String REGISTRATION_URL = "registration.url";
public final static String SYNC_URL = "sync.url";
Expand Down
Expand Up @@ -165,8 +165,9 @@ protected Node processRegistration(Node nodePriorToRegistration, String remoteHo
* registration is not allowed until this node has an identity
* and an initial load
*/
boolean requiresInitialLoad = parameterService.is(ParameterConstants.REGISTRATION_REQUIRE_INITIAL_LOAD, true);
NodeSecurity security = nodeService.findNodeSecurity(identity.getNodeId());
if (security == null || security.getInitialLoadTime() == null) {
if (requiresInitialLoad && (security == null || security.getInitialLoadTime() == null)) {
RegistrationRequest req = new RegistrationRequest(nodePriorToRegistration,
RegistrationStatus.ER, remoteHost, remoteAddress);
req.setErrorMessage("Cannot register a client node until this node has an initial load (ie. node_security.initial_load_time is a non null value)");
Expand Down Expand Up @@ -284,7 +285,7 @@ public boolean registerNode(Node nodePriorToRegistration, String remoteHost,
* the configuration for the node
*/
outgoingBatchService.markAllConfigAsSentForNode(processedNode.getNodeId());
extractConfiguration(out, processedNode);
extractConfiguration(out, processedNode);
}

return processedNode.isSyncEnabled();
Expand Down
Expand Up @@ -500,6 +500,14 @@ registration.reopen.use.same.password=true
# Type: boolean
registration.reinitialize.enable=false


# When this is set to true a node will have to have had an initial load prior to allowing other nodes to register with it
#
# DatabaseOverridable: true
# Tags: registration
# Type: boolean
registration.require.initial.load=true

# Initial load and reload events should normally block other channels to ensure each table
# is loaded first followed by changes captured during the initial load. Setting this to false
# will allow all channels to load in priority order even when reload events or
Expand Down

0 comments on commit 9a84cb6

Please sign in to comment.