You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by al...@apache.org on 2021/08/04 18:53:02 UTC
[asterixdb] branch master updated: [NO ISSUE][OTH] Skip failing
unregistered nodes
This is an automated email from the ASF dual-hosted git repository.
alsuliman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
The following commit(s) were added to refs/heads/master by this push:
new 68e707e [NO ISSUE][OTH] Skip failing unregistered nodes
68e707e is described below
commit 68e707ec1c6b0ac6c9ed926ebc4b3de775d95175
Author: Murtadha Hubail <mu...@couchbase.com>
AuthorDate: Wed Aug 4 03:15:36 2021 +0300
[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 <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mh...@apache.org>
Reviewed-by: Ian Maxon <im...@uci.edu>
---
.../org/apache/asterix/replication/messaging/DropIndexTask.java | 9 +++++----
.../src/main/java/org/apache/hyracks/api/io/MappedFileSplit.java | 2 +-
.../java/org/apache/hyracks/control/cc/cluster/NodeManager.java | 4 ++++
3 files changed, 10 insertions(+), 5 deletions(-)
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.DataOutputStream;
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.asterix.replication.api.IReplicationWorker;
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 class DropIndexTask implements IReplicaTask {
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 class DropIndexTask implements IReplicaTask {
@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 @@ public class MappedFileSplit extends ManagedFileSplit {
@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 class NodeManager implements INodeManager {
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);