Skip to content

Commit

Permalink
0005499: Registration left pending when client is 3.12 or newer and
Browse files Browse the repository at this point in the history
server is 3.11 or older
  • Loading branch information
erilong committed Oct 3, 2022
1 parent 6757eb7 commit b745afb
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -30,6 +30,7 @@
import org.jumpmind.db.model.Table;
import org.jumpmind.extension.IBuiltInExtensionPoint;
import org.jumpmind.symmetric.ISymmetricEngine;
import org.jumpmind.symmetric.Version;
import org.jumpmind.symmetric.common.Constants;
import org.jumpmind.symmetric.common.ParameterConstants;
import org.jumpmind.symmetric.common.TableConstants;
Expand Down Expand Up @@ -522,7 +523,18 @@ public void batchCommitted(DataContext context) {

IParameterService parameterService = engine.getParameterService();
INodeService nodeService = engine.getNodeService();


if (context.getBatch().getBatchId() == Constants.VIRTUAL_BATCH_FOR_REGISTRATION) {
String nodeId = nodeService.findIdentityNodeId();
Node sourceNode = nodeService.findNode(context.getBatch().getSourceNodeId());
if (nodeId != null && sourceNode != null && Version.isOlderThanVersion(sourceNode.getSymmetricVersion(), "3.12.0")) {
NodeSecurity security = nodeService.findNodeSecurity(nodeId);
if (security != null && (security.isRegistrationEnabled() || security.getRegistrationTime() == null)) {
engine.getRegistrationService().markNodeAsRegistered(nodeId);
}
}
}

if (context.get(CTX_KEY_FLUSH_GROUPLETS_NEEDED) != null) {
log.info("Grouplets flushed because new grouplet config came through the data loader");
engine.getGroupletService().clearCache();
Expand Down

0 comments on commit b745afb

Please sign in to comment.