Skip to content

Commit

Permalink
Merge branch '3.12' of https://github.com/JumpMind/symmetric-ds.git i…
Browse files Browse the repository at this point in the history
…nto 3.12
  • Loading branch information
erilong committed Aug 12, 2020
2 parents 98f70ba + cf321d4 commit 200afc4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
Expand Up @@ -125,6 +125,9 @@ protected boolean processLoadFilters(DataContext context, Table table, CsvData d
foundFilters = lookupFilters(foundFilters,
table.getCatalog(), FormatUtils.WILDCARD, FormatUtils.WILDCARD);

foundFilters = lookupFilters(foundFilters,
FormatUtils.WILDCARD, table.getSchema(), FormatUtils.WILDCARD);

foundFilters = lookupFilters(foundFilters,
FormatUtils.WILDCARD, FormatUtils.WILDCARD, FormatUtils.WILDCARD);
}
Expand Down
Expand Up @@ -103,8 +103,10 @@ public boolean registerNode(Node node, String remoteHost, String remoteAddress,
* registration server cannot be reach this method will continue to try with
* random sleep periods up to one minute up until the registration succeeds
* or the maximum number of attempts has been reached.
* Returns true if we had to register with server and was successful.
* Returns false if we did not have to register.
*/
public void registerWithServer();
public boolean registerWithServer();

/**
* Client method which attempts to register with the registration.url to
Expand Down
Expand Up @@ -85,8 +85,9 @@ synchronized public RemoteNodeStatuses pullData(boolean force) {
if (identity == null || identity.isSyncEnabled()) {
long minimumPeriodMs = parameterService.getLong(ParameterConstants.PULL_MINIMUM_PERIOD_MS, -1);
if (force || !clusterService.isInfiniteLocked(ClusterConstants.PULL)) {
// register if we haven't already been registered
registrationService.registerWithServer();
// register if we haven't already been registered
// Only pull if we did not have to register this time
if (!registrationService.registerWithServer()) {
identity = nodeService.findIdentity();
if (identity != null) {
List<NodeCommunication> nodes = nodeCommunicationService
Expand All @@ -108,6 +109,10 @@ synchronized public RemoteNodeStatuses pullData(boolean force) {
nodeCommunication.setBatchToSendCount(0);
}
}
} else {
identity = nodeService.findIdentity();
log.info("Node {}:{} just registered, not pulling yet", identity != null ? identity.getNodeGroupId() : "", identity != null ? identity.getNodeId() : "");
}
} else {
log.debug("Did not run the pull process because it has been stopped");
}
Expand Down
Expand Up @@ -481,8 +481,9 @@ public boolean isRegisteredWithServer() {
/**
* @see IRegistrationService#registerWithServer()
*/
public void registerWithServer() {
boolean registered = isRegisteredWithServer();
public boolean registerWithServer() {
boolean wasRegistered = isRegisteredWithServer();
boolean registered = wasRegistered;
int maxNumberOfAttempts = parameterService
.getInt(ParameterConstants.REGISTRATION_NUMBER_OF_ATTEMPTS);

Expand All @@ -502,6 +503,7 @@ public void registerWithServer() {
"Failed after trying to register %s times.",
parameterService.getString(ParameterConstants.REGISTRATION_NUMBER_OF_ATTEMPTS)));
}
return registered != wasRegistered;
}

public synchronized boolean attemptToRegisterWithServer(int maxNumberOfAttempts) {
Expand Down

0 comments on commit 200afc4

Please sign in to comment.