Skip to content
Permalink
Browse files
[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>
  • Loading branch information
mhubail committed Aug 4, 2021
1 parent e627046 commit 68e707ec1c6b0ac6c9ed926ebc4b3de775d95175
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
@@ -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 @@ public void perform(INcApplicationContext appCtx, IReplicationWorker worker) {
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 @@ public void perform(INcApplicationContext appCtx, IReplicationWorker worker) {

@Override
public ReplicationProtocol.ReplicationRequestType getMessageType() {
return ReplicationProtocol.ReplicationRequestType.REPLICATE_RESOURCE_FILE;
return ReplicationProtocol.ReplicationRequestType.DROP_INDEX;
}

@Override
@@ -59,7 +59,7 @@ public File getFile(IIOManager ioManager) throws HyracksDataException {
@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;
}
@@ -184,6 +184,10 @@ public synchronized Pair<Collection<String>, Collection<JobId>> removeDeadNodes(

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);

0 comments on commit 68e707e

Please sign in to comment.