Skip to content

Commit

Permalink
0004045: Load Data request with multiple nodes and "create table" option
Browse files Browse the repository at this point in the history
fails to create foreign key batches for all but one node
  • Loading branch information
erilong committed Jul 22, 2019
1 parent 824be79 commit 079e5c5
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -2082,7 +2082,7 @@ public void execute(NodeCommunication nodeCommunication, RemoteNodeStatus status
extractOutgoingBatch(processInfo, targetNode, multiBatchStagingWriter,
firstBatch, false, false, ExtractMode.FOR_SYM_CLIENT, new ClusterLockRefreshListener(clusterService));

checkSendDeferredConstraints(request, targetNode, firstBatch);
checkSendDeferredConstraints(request, childRequests, targetNode, firstBatch);
} else {
log.info("Batches already had an OK status for request {} to extract table {} for batches {} through {} for node {}. Not extracting.",
new Object[] { request.getRequestId(), request.getTableName(), request.getStartBatchId(), request.getEndBatchId(), request.getNodeId() });
Expand Down Expand Up @@ -2248,7 +2248,7 @@ public void releaseMissedExtractRequests() {
}
}

protected void checkSendDeferredConstraints(ExtractRequest request, Node targetNode, OutgoingBatch batch) {
protected void checkSendDeferredConstraints(ExtractRequest request, List<ExtractRequest> childRequests, Node targetNode, OutgoingBatch batch) {
if (parameterService.is(ParameterConstants.INITIAL_LOAD_DEFER_CREATE_CONSTRAINTS, false)) {
TableReloadRequest reloadRequest = dataService.getTableReloadRequest(request.getLoadId(), request.getTriggerId(), request.getRouterId());
if ((reloadRequest != null && reloadRequest.isCreateTable()) ||
Expand All @@ -2263,6 +2263,12 @@ protected void checkSendDeferredConstraints(ExtractRequest request, Node targetN
history, trigger.getChannelId(), null, null);
data.setNodeList(targetNode.getNodeId());
dataService.insertData(data);
for (ExtractRequest childRequest : childRequests) {
data = new Data(history.getSourceTableName(), DataEventType.CREATE, null, String.valueOf(childRequest.getLoadId()),
history, trigger.getChannelId(), null, null);
data.setNodeList(childRequest.getNodeId());
dataService.insertData(data);
}
}
success = true;
}
Expand Down

0 comments on commit 079e5c5

Please sign in to comment.