Skip to content
Permalink
Browse files
[NO ISSUE][ING] Do not process requests when node is not active
- user model changes: no
- storage format changes: no
- interface changes: no

Details:

- There is a chance that a node might receive an ActiveManager
  request via messaging before the node is active. We should
  respond to the CC with a failure indicating that the node
  is not active yet to avoid processing a request while the
  node is still bootstrapping.

Change-Id: Ibdf0e62902705538c0b00e93f040c13c93d8cb16
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/7943
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Reviewed-by: Hussain Towaileb <hussainht@gmail.com>
  • Loading branch information
mhubail committed Sep 18, 2020
1 parent bfe593a commit 5f5df46fdd616a9f9ee9a2e90fd86b09581e5ab4
Showing 1 changed file with 6 additions and 0 deletions.
@@ -38,6 +38,7 @@
import org.apache.asterix.common.exceptions.RuntimeDataException;
import org.apache.asterix.common.memory.ConcurrentFramePool;
import org.apache.hyracks.api.application.INCServiceContext;
import org.apache.hyracks.api.client.NodeStatus;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.util.JavaSerializationUtils;
import org.apache.hyracks.control.nc.NodeControllerService;
@@ -72,6 +73,11 @@ public ConcurrentFramePool getFramePool() {
}

public void registerRuntime(IActiveRuntime runtime) throws HyracksDataException {
NodeControllerService controllerService = (NodeControllerService) serviceCtx.getControllerService();
if (controllerService.getNodeStatus() != NodeStatus.ACTIVE) {
throw HyracksDataException.create(org.apache.hyracks.api.exceptions.ErrorCode.NODE_IS_NOT_ACTIVE,
serviceCtx.getNodeId());
}
if (shutdown) {
throw new RuntimeDataException(ErrorCode.ACTIVE_MANAGER_SHUTDOWN);
}

0 comments on commit 5f5df46

Please sign in to comment.