[NO ISSUE][OTH] Skip failing unregistered nodes

- user model changes: no
- storage format changes: no
- interface changes: no

Details:

- Do not attempt to fail nodes that are not registered.
- Make FileReference in MappedFileSplit use its super
  implementation that uses the iodevice resolver.
- Fix DropIndexTask message type.

Change-Id: I4715880eccf5ebb0cb96dfa71c09b2085af85647
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/12646
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: Ian Maxon <imaxon@uci.edu>
diff --git a/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/messaging/DropIndexTask.java b/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/messaging/DropIndexTask.java
index 637efa9..04f9766 100644
--- a/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/messaging/DropIndexTask.java
+++ b/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/messaging/DropIndexTask.java
@@ -23,7 +23,6 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.api.INcApplicationContext;
 import org.apache.asterix.common.exceptions.ReplicationException;
@@ -32,13 +31,15 @@
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.io.IIOManager;
 import org.apache.hyracks.api.util.IoUtil;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 /**
  * A task to drop an index that was dropped on master
  */
 public class DropIndexTask implements IReplicaTask {
 
-    private static final Logger LOGGER = Logger.getLogger(DeleteFileTask.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private final String file;
 
     public DropIndexTask(String file) {
@@ -55,7 +56,7 @@
                 IoUtil.delete(indexDir);
                 LOGGER.info(() -> "Deleted index: " + indexFile.getAbsolutePath());
             } else {
-                LOGGER.warning(() -> "Requested to delete a non-existing index: " + indexFile.getAbsolutePath());
+                LOGGER.warn(() -> "Requested to delete a non-existing index: " + indexFile.getAbsolutePath());
             }
             ReplicationProtocol.sendAck(worker.getChannel(), worker.getReusableBuffer());
         } catch (IOException e) {
@@ -65,7 +66,7 @@
 
     @Override
     public ReplicationProtocol.ReplicationRequestType getMessageType() {
-        return ReplicationProtocol.ReplicationRequestType.REPLICATE_RESOURCE_FILE;
+        return ReplicationProtocol.ReplicationRequestType.DROP_INDEX;
     }
 
     @Override
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/MappedFileSplit.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/MappedFileSplit.java
index 0a0e026..c7be4ae 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/MappedFileSplit.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/io/MappedFileSplit.java
@@ -59,7 +59,7 @@
     @Override
     public FileReference getFileReference(IIOManager ioManager) throws HyracksDataException {
         if (cached == null) {
-            cached = new FileReference(ioManager.getIODevices().get(ioDevice), getPath());
+            cached = super.getFileReference(ioManager);
         }
         return cached;
     }
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/cluster/NodeManager.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/cluster/NodeManager.java
index f54a62c..e4c98ae 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/cluster/NodeManager.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/cluster/NodeManager.java
@@ -184,6 +184,10 @@
 
     public synchronized void failNode(String nodeId) throws HyracksException {
         NodeControllerState state = nodeRegistry.get(nodeId);
+        if (state == null) {
+            LOGGER.info("node {} is not registered; no need to fail it", nodeId);
+            return;
+        }
         Set<JobId> affectedJobIds = state.getActiveJobIds();
         // Removes the node from node map.
         nodeRegistry.remove(nodeId);