diff options
60 files changed, 350 insertions, 672 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizer.java index 15e52e48c3a..86fee1ab9bc 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizer.java @@ -127,7 +127,7 @@ public class MultiTenantRpcAuthorizer implements RpcAuthorizer { } throw new AuthorizationException( String.format( - "Peer is not allowed to access config for owned by %s. Peer is owned by %s", + "Peer is not allowed to access config owned by %s. Peer is owned by %s", resolvedApplication.toShortString(), peerOwner.toShortString())); } default: @@ -149,7 +149,9 @@ public class MultiTenantRpcAuthorizer implements RpcAuthorizer { if (filesOwnedByApplication.contains(requestedFile)) { return; // allowed to access } - throw new AuthorizationException(String.format("Peer is not allowed to access file %s. Peer is owned by %s", requestedFile.value(), peerOwner.toShortString())); + throw new AuthorizationException( + String.format("Peer is not allowed to access file reference %s. Peer is owned by %s. File references owned by this application: %s", + requestedFile.value(), peerOwner.toShortString(), filesOwnedByApplication)); default: throw new AuthorizationException(String.format("'%s' nodes are not allowed to access files", peerIdentity.nodeType())); } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java index a1d4f28cb74..9f5a297103d 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/security/MultiTenantRpcAuthorizerTest.java @@ -148,7 +148,7 @@ public class MultiTenantRpcAuthorizerTest { Request fileRequest = createFileRequest(new FileReference("other-file-reference")); - exceptionRule.expectMessage("Peer is not allowed to access file other-file-reference"); + exceptionRule.expectMessage("Peer is not allowed to access file reference other-file-reference. Peer is owned by mytenant.myapplication. File references owned by this application: [file 'myfilereference']"); exceptionRule.expectCause(instanceOf(AuthorizationException.class)); authorizer.authorizeFileRequest(fileRequest) @@ -168,7 +168,7 @@ public class MultiTenantRpcAuthorizerTest { Request configRequest = createConfigRequest(new ConfigKey<>("name", "configid", "namespace"), HOSTNAME); - exceptionRule.expectMessage("Peer is not allowed to access config for owned by mytenant.myapplication. Peer is owned by malice.malice-app"); + exceptionRule.expectMessage("Peer is not allowed to access config owned by mytenant.myapplication. Peer is owned by malice.malice-app"); exceptionRule.expectCause(instanceOf(AuthorizationException.class)); authorizer.authorizeConfigRequest(configRequest) diff --git a/container-search/src/main/java/com/yahoo/search/cache/package-info.java b/container-search/src/main/java/com/yahoo/search/cache/package-info.java deleted file mode 100644 index fb3a9188a55..00000000000 --- a/container-search/src/main/java/com/yahoo/search/cache/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * Cache package, exported to keep the ignored legacy cache config around until Vespa 7. - * - * @author bratseth - */ -@ExportPackage -package com.yahoo.search.cache; - -import com.yahoo.osgi.annotation.ExportPackage; diff --git a/container-search/src/main/java/com/yahoo/search/cluster/ClusterSearcher.java b/container-search/src/main/java/com/yahoo/search/cluster/ClusterSearcher.java index e99199d85f7..dd8b953e3d0 100644 --- a/container-search/src/main/java/com/yahoo/search/cluster/ClusterSearcher.java +++ b/container-search/src/main/java/com/yahoo/search/cluster/ClusterSearcher.java @@ -63,9 +63,7 @@ public abstract class ClusterSearcher<T> extends PingableSearcher implements Nod } } - /** - * Pinging a node, called from ClusterMonitor - */ + /** Pinging a node, called from ClusterMonitor */ @Override public final void ping(T p, Executor executor) { log(LogLevel.FINE, "Sending ping to: ", p); @@ -149,9 +147,10 @@ public abstract class ClusterSearcher<T> extends PingableSearcher implements Nod do { // The loop is in case there are other searchers available able to produce results if (connection == null) - return search(query, execution, ErrorMessage - .createNoBackendsInService("No in node could handle " + query + " according to " + - hasher + " in " + this)); + return search(query, + execution, + ErrorMessage.createNoBackendsInService("No in node could handle " + query + + " according to " + hasher + " in " + this)); if (timedOut(query)) return new Result(query, ErrorMessage.createTimeout("No time left for searching")); @@ -189,7 +188,7 @@ public abstract class ClusterSearcher<T> extends PingableSearcher implements Nod } /** - * This is called (instead of search(quer,execution,connextion) to handle + * This is called (instead of search(query, execution, connection) to handle * searches where no (suitable) backend was available. The default * implementation returns an error result. */ @@ -198,7 +197,7 @@ public abstract class ClusterSearcher<T> extends PingableSearcher implements Nod } /** - * Call search(Query,Execution,T) and handle any exceptions returned which + * Call search(Query, Execution, T) and handle any exceptions returned which * we do not want to propagate upwards By default this catches all runtime * exceptions and puts them into the result */ @@ -214,13 +213,12 @@ public abstract class ClusterSearcher<T> extends PingableSearcher implements Nod } if (result == null) - result = new Result(query, ErrorMessage - .createBackendCommunicationError("No result returned in " + this + - " from " + connection + " for " + query)); + result = new Result(query, ErrorMessage.createBackendCommunicationError("No result returned in " + this + + " from " + connection + " for " + query)); if (result.hits().getError() != null) { log(LogLevel.FINE, "FAILED: ", query); - } else if (!result.isCached()) { + } else if ( ! result.isCached()) { log(LogLevel.FINE, "WORKING: ", query); } else { log(LogLevel.FINE, "CACHE HIT: ", query); @@ -243,15 +241,13 @@ public abstract class ClusterSearcher<T> extends PingableSearcher implements Nod T connection = nodes.select(code, 0); if (connection != null) { if (timedOut(query)) { - result.hits().addError( - ErrorMessage.createTimeout("No time left to get summaries for " + result)); + result.hits().addError(ErrorMessage.createTimeout("No time left to get summaries for " + result)); } else { // query.setTimeout(getNodeTimeout(query)); doFill(connection, result, summaryClass, execution); } } else { - result.hits().addError( - ErrorMessage.createNoBackendsInService("Could not fill '" + result + "' in '" + this + "'")); + result.hits().addError(ErrorMessage.createNoBackendsInService("Could not fill '" + result + "' in '" + this + "'")); } } @@ -259,10 +255,8 @@ public abstract class ClusterSearcher<T> extends PingableSearcher implements Nod try { fill(result, summaryClass, execution, connection); } catch (RuntimeException e) { - result.hits().addError( - ErrorMessage - .createBackendCommunicationError("Error filling " + result + " from " + connection + ": " + - Exceptions.toMessageString(e))); + result.hits().addError(ErrorMessage.createBackendCommunicationError("Error filling " + result + " from " + connection + ": " + + Exceptions.toMessageString(e))); } if (result.hits().getError() != null) { log(LogLevel.FINE, "FAILED: ", result.getQuery()); diff --git a/container-search/src/main/java/com/yahoo/search/cluster/Hasher.java b/container-search/src/main/java/com/yahoo/search/cluster/Hasher.java index 5eda79a0885..46752b0bedb 100644 --- a/container-search/src/main/java/com/yahoo/search/cluster/Hasher.java +++ b/container-search/src/main/java/com/yahoo/search/cluster/Hasher.java @@ -98,14 +98,13 @@ public class Hasher<T> { * and determines how often this node will be selected compared * to the other nodes */ - public synchronized void add(T node,int load) { - assert(nodes != null); - if(!nodes.hasNode(node)) { + public synchronized void add(T node, int load) { + if ( ! nodes.hasNode(node)) { NodeFactor<T>[] oldNodes = nodes.nodes; @SuppressWarnings("unchecked") - NodeFactor<T>[] newNodes = (NodeFactor<T>[]) new NodeFactor[oldNodes.length+ 1]; - System.arraycopy(oldNodes,0,newNodes,0,oldNodes.length); - newNodes[newNodes.length-1] = new NodeFactor<>(node, load); + NodeFactor<T>[] newNodes = (NodeFactor<T>[]) new NodeFactor[oldNodes.length + 1]; + System.arraycopy(oldNodes, 0, newNodes, 0, oldNodes.length); + newNodes[newNodes.length - 1] = new NodeFactor<>(node, load); //Atomic switch due to volatile nodes = new NodeList<>(newNodes); @@ -114,7 +113,7 @@ public class Hasher<T> { /** Removes a node */ public synchronized void remove(T node) { - if( nodes.hasNode(node)) { + if (nodes.hasNode(node)) { NodeFactor<T>[] oldNodes = nodes.nodes; @SuppressWarnings("unchecked") NodeFactor<T>[] newNodes = (NodeFactor<T>[]) new NodeFactor[oldNodes.length - 1]; @@ -128,10 +127,9 @@ public class Hasher<T> { } } - /** - * Returns a list of nodes that are up. - */ + /** Returns a list of nodes that are up.*/ public NodeList<T> getNodes() { return nodes; } + } diff --git a/container-search/src/main/java/com/yahoo/search/cluster/PingableSearcher.java b/container-search/src/main/java/com/yahoo/search/cluster/PingableSearcher.java index 145970f5407..57bb5c9d47d 100644 --- a/container-search/src/main/java/com/yahoo/search/cluster/PingableSearcher.java +++ b/container-search/src/main/java/com/yahoo/search/cluster/PingableSearcher.java @@ -14,8 +14,7 @@ import com.yahoo.search.searchchain.Execution; */ public abstract class PingableSearcher extends Searcher { - public PingableSearcher() { - } + public PingableSearcher() { } public PingableSearcher(ComponentId id) { super(id); diff --git a/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java b/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java index 30d0bc6f0e1..4f7ab227113 100644 --- a/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java +++ b/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java @@ -109,9 +109,23 @@ import com.yahoo.search.grouping.GroupingRequest; */ public class VespaSerializer { - // TODO refactor, too much copy/paste + // TODO: Refactor, too much copy/paste + + private static abstract class Serializer<ITEM extends Item> { + + abstract void onExit(StringBuilder destination, ITEM item); + + String separator(Deque<SerializerWrapper> state) { + throw new UnsupportedOperationException("Having several items for this query operator serializer, " + + this.getClass().getSimpleName() + ", not yet implemented."); + } + + abstract boolean serialize(StringBuilder destination, ITEM item); + + } + + private static class AndSegmentSerializer extends Serializer<AndSegmentItem> { - private static class AndSegmentSerializer extends Serializer { private static void serializeWords(StringBuilder destination, AndSegmentItem segment) { for (int i = 0; i < segment.getItemCount(); ++i) { if (i > 0) { @@ -129,22 +143,21 @@ public class VespaSerializer { } @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, AndSegmentItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { + boolean serialize(StringBuilder destination, AndSegmentItem item) { return serialize(destination, item, true); } - static boolean serialize(StringBuilder destination, Item item, boolean includeField) { - AndSegmentItem phrase = (AndSegmentItem) item; - Substring origin = phrase.getOrigin(); + static boolean serialize(StringBuilder destination, AndSegmentItem item, boolean includeField) { + Substring origin = item.getOrigin(); String image; int offset; int length; if (origin == null) { - image = phrase.getRawWord(); + image = item.getRawWord(); offset = 0; length = image.length(); } else { @@ -154,22 +167,23 @@ public class VespaSerializer { } if (includeField) { - destination.append(normalizeIndexName(phrase.getIndexName())).append(" contains "); + destination.append(normalizeIndexName(item.getIndexName())).append(" contains "); } destination.append("([{"); serializeOrigin(destination, image, offset, length); destination.append(", \"").append(AND_SEGMENTING).append("\": true"); destination.append("}]"); destination.append(PHRASE).append('('); - serializeWords(destination, phrase); + serializeWords(destination, item); destination.append("))"); return false; } } - private static class AndSerializer extends Serializer { + private static class AndSerializer extends Serializer<AndItem> { + @Override - void onExit(StringBuilder destination, Item item) { + void onExit(StringBuilder destination, AndItem item) { destination.append(')'); } @@ -179,45 +193,46 @@ public class VespaSerializer { } @Override - boolean serialize(StringBuilder destination, Item item) { + boolean serialize(StringBuilder destination, AndItem item) { destination.append("("); return true; } } - private static class DotProductSerializer extends Serializer { + private static class DotProductSerializer extends Serializer<WeightedSetItem> { + @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, WeightedSetItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - serializeWeightedSetContents(destination, DOT_PRODUCT, (WeightedSetItem) item); + boolean serialize(StringBuilder destination, WeightedSetItem item) { + serializeWeightedSetContents(destination, DOT_PRODUCT, item); return false; } } - private static class EquivSerializer extends Serializer { + private static class EquivSerializer extends Serializer<EquivItem> { + @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, EquivItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - EquivItem e = (EquivItem) item; - String annotations = leafAnnotations(e); - destination.append(getIndexName(e.getItem(0))).append(" contains "); + boolean serialize(StringBuilder destination, EquivItem item) { + String annotations = leafAnnotations(item); + destination.append(getIndexName(item.getItem(0))).append(" contains "); if (annotations.length() > 0) { destination.append("([{").append(annotations).append("}]"); } destination.append(EQUIV).append('('); int initLen = destination.length(); - for (Iterator<Item> i = e.getItemIterator(); i.hasNext();) { + for (Iterator<Item> i = item.getItemIterator(); i.hasNext();) { Item x = i.next(); if (destination.length() > initLen) { destination.append(", "); } if (x instanceof PhraseItem) { - PhraseSerializer.serialize(destination, x, false); + PhraseSerializer.serialize(destination, (PhraseItem)x, false); } else { destination.append('"'); escape(((IndexedItem) x).getIndexedString(), destination); @@ -233,22 +248,22 @@ public class VespaSerializer { } - private static class NearSerializer extends Serializer { + private static class NearSerializer extends Serializer<NearItem> { + @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, NearItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - NearItem n = (NearItem) item; - String annotations = nearAnnotations(n); + boolean serialize(StringBuilder destination, NearItem item) { + String annotations = nearAnnotations(item); - destination.append(getIndexName(n.getItem(0))).append(" contains "); + destination.append(getIndexName(item.getItem(0))).append(" contains "); if (annotations.length() > 0) { destination.append('(').append(annotations); } destination.append(NEAR).append('('); int initLen = destination.length(); - for (ListIterator<Item> i = n.getItemIterator(); i.hasNext();) { + for (ListIterator<Item> i = item.getItemIterator(); i.hasNext();) { WordItem close = (WordItem) i.next(); if (destination.length() > initLen) { destination.append(", "); @@ -273,13 +288,13 @@ public class VespaSerializer { } - private static class UriSerializer extends Serializer { + private static class UriSerializer extends Serializer<UriItem> { + @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, UriItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - UriItem uriItem = (UriItem) item; + boolean serialize(StringBuilder destination, UriItem uriItem) { String annotations = uriAnnotations(uriItem); destination.append(uriItem.getIndexName()).append(" contains "); @@ -314,10 +329,10 @@ public class VespaSerializer { } - private static class NotSerializer extends Serializer { + private static class NotSerializer extends Serializer<NotItem> { @Override - void onExit(StringBuilder destination, Item item) { + void onExit(StringBuilder destination, NotItem item) { destination.append(')'); } @@ -331,32 +346,32 @@ public class VespaSerializer { } @Override - boolean serialize(StringBuilder destination, Item item) { + boolean serialize(StringBuilder destination, NotItem item) { destination.append("("); return true; } } - private static class NullSerializer extends Serializer { + private static class NullSerializer extends Serializer<NullItem> { @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, NullItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { + boolean serialize(StringBuilder destination, NullItem item) { throw new NullItemException("NullItem encountered in query tree. This is usually a symptom of an invalid " + "query or an error in a query transformer."); } + } - private static class NumberSerializer extends Serializer { + private static class NumberSerializer extends Serializer<IntItem> { @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, IntItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - IntItem intItem = (IntItem) item; + boolean serialize(StringBuilder destination, IntItem intItem) { if (intItem.getFromLimit().number().equals(intItem.getToLimit().number())) { destination.append(normalizeIndexName(intItem.getIndexName())).append(" = "); annotatedNumberImage(intItem, intItem.getFromLimit().number().toString(), destination); @@ -446,30 +461,27 @@ public class VespaSerializer { } } - private static class BoolSerializer extends Serializer { + private static class BoolSerializer extends Serializer<BoolItem> { @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, BoolItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - BoolItem intItem = (BoolItem) item; - destination.append(normalizeIndexName(intItem.getIndexName())).append(" = "); - destination.append(((BoolItem) item).stringValue()); + boolean serialize(StringBuilder destination, BoolItem item) { + destination.append(normalizeIndexName(item.getIndexName())).append(" = "); + destination.append(item.stringValue()); return false; } } - private static class RegExpSerializer extends Serializer { + private static class RegExpSerializer extends Serializer<RegExpItem> { @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, RegExpItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - RegExpItem regexp = (RegExpItem) item; - + boolean serialize(StringBuilder destination, RegExpItem regexp) { String annotations = leafAnnotations(regexp); destination.append(normalizeIndexName(regexp.getIndexName())).append(" matches "); annotatedTerm(destination, regexp, annotations); @@ -477,24 +489,23 @@ public class VespaSerializer { } } - private static class ONearSerializer extends Serializer { + private static class ONearSerializer extends Serializer<ONearItem> { @Override - void onExit(StringBuilder destination, Item item) { + void onExit(StringBuilder destination, ONearItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - NearItem n = (NearItem) item; - String annotations = NearSerializer.nearAnnotations(n); + boolean serialize(StringBuilder destination, ONearItem item) { + String annotations = NearSerializer.nearAnnotations(item); - destination.append(getIndexName(n.getItem(0))).append(" contains "); + destination.append(getIndexName(item.getItem(0))).append(" contains "); if (annotations.length() > 0) { destination.append('(').append(annotations); } destination.append(ONEAR).append('('); int initLen = destination.length(); - for (ListIterator<Item> i = n.getItemIterator(); i.hasNext();) { + for (ListIterator<Item> i = item.getItemIterator(); i.hasNext();) { WordItem close = (WordItem) i.next(); if (destination.length() > initLen) { destination.append(", "); @@ -511,10 +522,10 @@ public class VespaSerializer { } - private static class OrSerializer extends Serializer { + private static class OrSerializer extends Serializer<OrItem> { @Override - void onExit(StringBuilder destination, Item item) { + void onExit(StringBuilder destination, OrItem item) { destination.append(')'); } @@ -524,13 +535,13 @@ public class VespaSerializer { } @Override - boolean serialize(StringBuilder destination, Item item) { + boolean serialize(StringBuilder destination, OrItem item) { destination.append("("); return true; } } - private static class PhraseSegmentSerializer extends Serializer { + private static class PhraseSegmentSerializer extends Serializer<PhraseSegmentItem> { private static void serializeWords(StringBuilder destination, PhraseSegmentItem segment) { for (int i = 0; i < segment.getItemCount(); ++i) { @@ -549,10 +560,10 @@ public class VespaSerializer { } @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, PhraseSegmentItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { + boolean serialize(StringBuilder destination, PhraseSegmentItem item) { return serialize(destination, item, true); } @@ -593,34 +604,28 @@ public class VespaSerializer { } } - private static class PhraseSerializer extends Serializer { + private static class PhraseSerializer extends Serializer<PhraseItem> { + @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, PhraseItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { + boolean serialize(StringBuilder destination, PhraseItem item) { return serialize(destination, item, true); } - static boolean serialize(StringBuilder destination, Item item, boolean includeField) { - - PhraseItem phrase = (PhraseItem) item; + static boolean serialize(StringBuilder destination, PhraseItem phrase, boolean includeField) { String annotations = leafAnnotations(phrase); - if (includeField) { - destination.append(normalizeIndexName(phrase.getIndexName())) - .append(" contains "); - - } - if (annotations.length() > 0) { + if (includeField) + destination.append(normalizeIndexName(phrase.getIndexName())).append(" contains "); + if (annotations.length() > 0) destination.append("([{").append(annotations).append("}]"); - } destination.append(PHRASE).append('('); for (int i = 0; i < phrase.getItemCount(); ++i) { - if (i > 0) { + if (i > 0) destination.append(", "); - } Item current = phrase.getItem(i); if (current instanceof WordItem) { WordSerializer.serializeWordWithoutIndex(destination, current); @@ -629,48 +634,43 @@ public class VespaSerializer { } else if (current instanceof WordAlternativesItem) { WordAlternativesSerializer.serialize(destination, (WordAlternativesItem) current, false); } else { - throw new IllegalArgumentException( - "Serializing of " - + current.getClass().getSimpleName() - + " in phrases not implemented, please report this as a bug."); + throw new IllegalArgumentException("Serializing of " + current.getClass().getSimpleName() + + " in phrases not implemented, please report this as a bug."); } } destination.append(')'); - if (annotations.length() > 0) { + if (annotations.length() > 0) destination.append(')'); - } return false; } } - private static class SameElementSerializer extends Serializer { + private static class SameElementSerializer extends Serializer<SameElementItem> { @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, SameElementItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { + boolean serialize(StringBuilder destination, SameElementItem item) { return serialize(destination, item, true); } - static boolean serialize(StringBuilder destination, Item item, boolean includeField) { - SameElementItem sameElement = (SameElementItem) item; - + static boolean serialize(StringBuilder destination, SameElementItem item, boolean includeField) { if (includeField) { - destination.append(normalizeIndexName(sameElement.getFieldName())).append(" contains "); + destination.append(normalizeIndexName(item.getFieldName())).append(" contains "); } destination.append(SAME_ELEMENT).append('('); - for (int i = 0; i < sameElement.getItemCount(); ++i) { + for (int i = 0; i < item.getItemCount(); ++i) { if (i > 0) { destination.append(", "); } - Item current = sameElement.getItem(i); + Item current = item.getItem(i); if (current instanceof WordItem) { - new WordSerializer().serialize(destination, current); + new WordSerializer().serialize(destination, (WordItem)current); } else if (current instanceof IntItem) { - new NumberSerializer().serialize(destination, current); + new NumberSerializer().serialize(destination, (IntItem)current); } else { throw new IllegalArgumentException("Serializing of " + current.getClass().getSimpleName() + " in same_element is not implemented, please report this as a bug."); @@ -683,17 +683,17 @@ public class VespaSerializer { } - private static class PredicateQuerySerializer extends Serializer { + private static class PredicateQuerySerializer extends Serializer<PredicateQueryItem> { + @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, PredicateQueryItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - PredicateQueryItem pItem = (PredicateQueryItem) item; - destination.append("predicate(").append(pItem.getIndexName()).append(','); - appendFeatures(destination, pItem.getFeatures()); + boolean serialize(StringBuilder destination, PredicateQueryItem item) { + destination.append("predicate(").append(item.getIndexName()).append(','); + appendFeatures(destination, item.getFeatures()); destination.append(','); - appendFeatures(destination, pItem.getRangeFeatures()); + appendFeatures(destination, item.getRangeFeatures()); destination.append(')'); return false; } @@ -738,13 +738,13 @@ public class VespaSerializer { } - private static class RangeSerializer extends Serializer { + private static class RangeSerializer extends Serializer<RangeItem> { + @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, RangeItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - RangeItem range = (RangeItem) item; + boolean serialize(StringBuilder destination, RangeItem range) { String annotations = leafAnnotations(range); if (annotations.length() > 0) { destination.append("[{").append(annotations).append("}]"); @@ -768,9 +768,10 @@ public class VespaSerializer { } } - private static class RankSerializer extends Serializer { + private static class RankSerializer extends Serializer<RankItem> { + @Override - void onExit(StringBuilder destination, Item item) { + void onExit(StringBuilder destination, RankItem item) { destination.append(')'); } @@ -780,7 +781,7 @@ public class VespaSerializer { } @Override - boolean serialize(StringBuilder destination, Item item) { + boolean serialize(StringBuilder destination, RankItem item) { destination.append(RANK).append('('); return true; @@ -788,14 +789,14 @@ public class VespaSerializer { } - private static class WordAlternativesSerializer extends Serializer { + private static class WordAlternativesSerializer extends Serializer<WordAlternativesItem> { @Override - void onExit(StringBuilder destination, Item item) { } + void onExit(StringBuilder destination, WordAlternativesItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - return serialize(destination, (WordAlternativesItem) item, true); + boolean serialize(StringBuilder destination, WordAlternativesItem item) { + return serialize(destination, item, true); } static boolean serialize(StringBuilder destination, WordAlternativesItem alternatives, boolean includeField) { @@ -839,7 +840,7 @@ public class VespaSerializer { comma(destination, initLen); destination.append('"'); escape(alternative.word, destination); - destination.append("\": ").append(Double.toString(alternative.exactness)); + destination.append("\": ").append(alternative.exactness); } destination.append("})"); if (needsAnnotations) { @@ -849,85 +850,15 @@ public class VespaSerializer { } } - private static abstract class Serializer { - abstract void onExit(StringBuilder destination, Item item); - - String separator(Deque<SerializerWrapper> state) { - throw new UnsupportedOperationException("Having several items for this query operator serializer, " - + this.getClass().getSimpleName() + ", not yet implemented."); - } - - abstract boolean serialize(StringBuilder destination, Item item); - } - - private static final class SerializerWrapper { - int subItems; - final Serializer type; - final Item item; - - SerializerWrapper(Serializer type, Item item) { - subItems = 0; - this.type = type; - this.item = item; - } - - } - - private static final class TokenComparator implements Comparator<Entry<Object, Integer>> { - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public int compare(Entry<Object, Integer> o1, Entry<Object, Integer> o2) { - Comparable c1 = (Comparable) o1.getKey(); - Comparable c2 = (Comparable) o2.getKey(); - return c1.compareTo(c2); - } - } - - private static class VespaVisitor extends QueryVisitor { - - final StringBuilder destination; - final Deque<SerializerWrapper> state = new ArrayDeque<>(); - - VespaVisitor(StringBuilder destination) { - this.destination = destination; - } - - @Override - public void onExit() { - SerializerWrapper w = state.removeFirst(); - w.type.onExit(destination, w.item); - w = state.peekFirst(); - if (w != null) { - w.subItems += 1; - } - } - - @Override - public boolean visit(Item item) { - Serializer doIt = dispatch.get(item.getClass()); + private static class WandSerializer extends Serializer<WandItem> { - if (doIt == null) { - throw new IllegalArgumentException(item.getClass() + " not supported for YQL+ marshalling."); - } - - if (state.peekFirst() != null && state.peekFirst().subItems > 0) { - destination.append(state.peekFirst().type.separator(state)); - } - state.addFirst(new SerializerWrapper(doIt, item)); - return doIt.serialize(destination, item); - - } - } - - private static class WandSerializer extends Serializer { @Override - void onExit(StringBuilder destination, Item item) { + void onExit(StringBuilder destination, WandItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - serializeWeightedSetContents(destination, WAND, (WeightedSetItem) item, specificAnnotations((WandItem) item)); + boolean serialize(StringBuilder destination, WandItem item) { + serializeWeightedSetContents(destination, WAND, item, specificAnnotations(item)); return false; } @@ -952,9 +883,10 @@ public class VespaSerializer { } - private static class WeakAndSerializer extends Serializer { + private static class WeakAndSerializer extends Serializer<WeakAndItem> { + @Override - void onExit(StringBuilder destination, Item item) { + void onExit(StringBuilder destination, WeakAndItem item) { destination.append(')'); if (needsAnnotationBlock((WeakAndItem) item)) { destination.append(')'); @@ -971,20 +903,19 @@ public class VespaSerializer { } @Override - boolean serialize(StringBuilder destination, Item item) { - WeakAndItem w = (WeakAndItem) item; - if (needsAnnotationBlock(w)) { + boolean serialize(StringBuilder destination, WeakAndItem item) { + if (needsAnnotationBlock(item)) { destination.append("([{"); } int lengthBeforeAnnotations = destination.length(); - if (nonDefaultTargetNumHits(w)) { - destination.append('"').append(TARGET_NUM_HITS).append("\": ").append(w.getN()); + if (nonDefaultTargetNumHits(item)) { + destination.append('"').append(TARGET_NUM_HITS).append("\": ").append(item.getN()); } - if (nonDefaultScoreThreshold(w)) { + if (nonDefaultScoreThreshold(item)) { comma(destination, lengthBeforeAnnotations); - destination.append('"').append(SCORE_THRESHOLD).append("\": ").append(w.getScoreThreshold()); + destination.append('"').append(SCORE_THRESHOLD).append("\": ").append(item.getScoreThreshold()); } - if (needsAnnotationBlock(w)) { + if (needsAnnotationBlock(item)) { destination.append("}]"); } destination.append(WEAK_AND).append('('); @@ -1000,32 +931,32 @@ public class VespaSerializer { } } - private static class WeightedSetSerializer extends Serializer { + private static class WeightedSetSerializer extends Serializer<WeightedSetItem> { + @Override - void onExit(StringBuilder destination, Item item) { + void onExit(StringBuilder destination, WeightedSetItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - serializeWeightedSetContents(destination, WEIGHTED_SET, (WeightedSetItem) item); + boolean serialize(StringBuilder destination, WeightedSetItem item) { + serializeWeightedSetContents(destination, WEIGHTED_SET, item); return false; } } - private static class WordSerializer extends Serializer { + private static class WordSerializer extends Serializer<WordItem> { @Override - void onExit(StringBuilder destination, Item item) { + void onExit(StringBuilder destination, WordItem item) { } @Override - boolean serialize(StringBuilder destination, Item item) { - WordItem w = (WordItem) item; - StringBuilder wordAnnotations = getAllAnnotations(w); + boolean serialize(StringBuilder destination, WordItem item) { + StringBuilder wordAnnotations = getAllAnnotations(item); - destination.append(normalizeIndexName(w.getIndexName())).append(" contains "); - VespaSerializer.annotatedTerm(destination, w, wordAnnotations.toString()); + destination.append(normalizeIndexName(item.getIndexName())).append(" contains "); + VespaSerializer.annotatedTerm(destination, item, wordAnnotations.toString()); return false; } @@ -1118,8 +1049,68 @@ public class VespaSerializer { } - private static final char[] DIGITS = new char[] { '0', '1', '2', '3', '4', - '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + private static final class SerializerWrapper { + int subItems; + final Serializer type; + final Item item; + + SerializerWrapper(Serializer type, Item item) { + subItems = 0; + this.type = type; + this.item = item; + } + + } + + private static final class TokenComparator implements Comparator<Entry<Object, Integer>> { + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public int compare(Entry<Object, Integer> o1, Entry<Object, Integer> o2) { + Comparable c1 = (Comparable) o1.getKey(); + Comparable c2 = (Comparable) o2.getKey(); + return c1.compareTo(c2); + } + } + + private static class VespaVisitor extends QueryVisitor { + + final StringBuilder destination; + final Deque<SerializerWrapper> state = new ArrayDeque<>(); + + VespaVisitor(StringBuilder destination) { + this.destination = destination; + } + + @Override + public void onExit() { + SerializerWrapper w = state.removeFirst(); + w.type.onExit(destination, w.item); + w = state.peekFirst(); + if (w != null) { + w.subItems += 1; + } + } + + @Override + public boolean visit(Item item) { + Serializer doIt = dispatch.get(item.getClass()); + + if (doIt == null) { + throw new IllegalArgumentException(item.getClass() + " not supported for YQL+ marshalling."); + } + + if (state.peekFirst() != null && state.peekFirst().subItems > 0) { + destination.append(state.peekFirst().type.separator(state)); + } + state.addFirst(new SerializerWrapper(doIt, item)); + return doIt.serialize(destination, item); + + } + } + + private static final char[] DIGITS = + new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; private static final Map<Class<?>, Serializer> dispatch; diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java index 89d922db806..f0972643bd5 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java @@ -25,6 +25,9 @@ public interface TesterCloud { /** Returns whether the container is ready to serve. */ boolean ready(URI endpointUrl); + /** Returns whether the test container is ready to serve */ + boolean testerReady(URI endpointUrl); + /** Returns whether the given URL is registered in DNS. */ boolean exists(URI endpointUrl); diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java index d723de8ba19..227f35498ce 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java @@ -54,12 +54,6 @@ public class NodeRepositoryNode { private String wantedOsVersion; @JsonProperty("failCount") private Integer failCount; - @JsonProperty("hardwareFailure") - private Boolean hardwareFailure; - @JsonProperty("hardwareFailureDescription") - private String hardwareFailureDescription; - @JsonProperty("hardwareDivergence") - private String hardwareDivergence; @JsonProperty("environment") private NodeEnvironment environment; @JsonProperty("type") @@ -241,30 +235,6 @@ public class NodeRepositoryNode { this.failCount = failCount; } - public Boolean getHardwareFailure() { - return hardwareFailure; - } - - public void setHardwareFailure(Boolean hardwareFailure) { - this.hardwareFailure = hardwareFailure; - } - - public String getHardwareFailureDescription() { - return hardwareFailureDescription; - } - - public void setHardwareDivergence(String hardwareDivergence) { - this.hardwareDivergence = hardwareDivergence; - } - - public String getHardwareDivergence() { - return hardwareDivergence; - } - - public void setHardwareFailureDescription(String hardwareFailureDescription) { - this.hardwareFailureDescription = hardwareFailureDescription; - } - public NodeEnvironment getEnvironment() { return environment; } @@ -442,9 +412,6 @@ public class NodeRepositoryNode { ", currentOsVersion='" + currentOsVersion + '\'' + ", wantedOsVersion='" + wantedOsVersion + '\'' + ", failCount=" + failCount + - ", hardwareFailure=" + hardwareFailure + - ", hardwareFailureDescription='" + hardwareFailureDescription + '\'' + - ", hardwareDivergence='" + hardwareDivergence + '\'' + ", environment=" + environment + ", type=" + type + ", wantedDockerImage='" + wantedDockerImage + '\'' + diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java index ce5cc128d78..ce4d44eadce 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java @@ -39,7 +39,12 @@ public class MockTesterCloud implements TesterCloud { } @Override - public boolean ready(URI resterUrl) { + public boolean ready(URI testerUrl) { + return true; + } + + @Override + public boolean testerReady(URI testerUrl) { return true; } diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index 7053c3cacc8..797b28a25b4 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -349,7 +349,12 @@ public class InternalStepRunner implements StepRunner { for (URI endpoint : endpoints.get(zoneId).values()) { URI workingEndpoint = controller.jobController().withWorkingSchemeAndPort(endpoint, id); - if ( ! controller.jobController().cloud().ready(workingEndpoint)) { + + boolean ready = id.instance().isTester() ? + controller.jobController().cloud().testerReady(workingEndpoint) + : controller.jobController().cloud().ready(workingEndpoint); + + if (!ready) { logger.log("Failed to get 100 consecutive OKs from " + workingEndpoint); return false; } @@ -450,7 +455,7 @@ public class InternalStepRunner implements StepRunner { return Optional.of(error); } - if ( ! controller.jobController().cloud().ready(testerEndpoint.get())) { + if ( ! controller.jobController().cloud().testerReady(testerEndpoint.get())) { logger.log(WARNING, "Tester container went bad!"); return Optional.of(error); } @@ -480,7 +485,7 @@ public class InternalStepRunner implements StepRunner { logger.log(INFO, "Tester certificate expired before tests could complete."); return Optional.of(aborted); } - }; + } Optional<URI> testerEndpoint = controller.jobController().testerEndpoint(id); if ( ! testerEndpoint.isPresent()) { diff --git a/documentapi/src/main/java/com/yahoo/documentapi/DocumentAccess.java b/documentapi/src/main/java/com/yahoo/documentapi/DocumentAccess.java index 2d6010fce41..d6c3d3ce92f 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/DocumentAccess.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/DocumentAccess.java @@ -11,20 +11,20 @@ import com.yahoo.config.subscription.ConfigSubscriber; * access to documents in a document repository. The document api contains four * separate access types: </p> * - * <ul><li><b>Synchronous random access</b> - provided by {@link SyncSession}, - * allows simple access where throughput is not a concern.</li> + * <ul> + * <li><b>Synchronous random access</b> - provided by {@link SyncSession}, + * allows simple access where throughput is not a concern. * <li><b>Asynchronous random access</b> - provided by {@link AsyncSession}, - * allows document repository writes and random access with high - * throughput.</li> + * allows document repository writes and random access with high throughput. * <li><b>Visiting</b> - provided by {@link VisitorSession}, allows a set of * documents to be accessed in an order decided by the document repository. This - * allows much higher read throughput than random access.</li> + * allows much higher read throughput than random access. * <li><b>Subscription</b> - provided by {@link SubscriptionSession}, allows * changes to a defined set of documents in the repository to be - * visited.</li></ul> + * visited. + * </ul> * - * <p>This class is the factory for creating the four session types mentioned - * above.</p> + * <p>This class is the factory for creating the four session types mentioned above.</p> * * <p>There may be multiple implementations of the document api classes. If * default configuration is sufficient, use the {@link #createDefault} method to @@ -35,8 +35,7 @@ import com.yahoo.config.subscription.ConfigSubscriber; * access types defined in this interface. For example, some document * repositories, like indexes, are <i>write only</i>. Others may support random * access, but not visiting and subscription. Any method which is not supported - * by the underlying implementation will throw - * UnsupportedOperationException.</p> + * by the underlying implementation will throw UnsupportedOperationException.</p> * * <p>Access to this class is thread-safe.</p> * @@ -50,22 +49,22 @@ public abstract class DocumentAccess { private final ConfigSubscriber documentTypeConfigSubscriber; /** - * <p>This is a convenience method to return a document access object with + * This is a convenience method to return a document access object with * all default parameter values. The client that calls this method is also * responsible for shutting the object down when done. If an error occurred * while attempting to create such an object, this method will throw an - * exception.</p> + * exception. * - * @return A running document access object with all default configuration. + * @return a running document access object with all default configuration */ public static DocumentAccess createDefault() { return new com.yahoo.documentapi.messagebus.MessageBusDocumentAccess(); } /** - * <p>Constructs a new document access object.</p> + * Constructs a new document access object. * - * @param params The parameters to use for setup. + * @param params the parameters to use for setup */ protected DocumentAccess(DocumentAccessParams params) { super(); @@ -80,89 +79,70 @@ public abstract class DocumentAccess { } /** - * <p>Returns a session for synchronous document access. Use this for simple - * access.</p> + * Returns a session for synchronous document access. Use this for simple access. * - * @param parameters The parameters of this sync session. - * @return A session to use for synchronous document access. - * @throws UnsupportedOperationException If this access implementation does - * not support synchronous access. - * @throws RuntimeException If an error prevented the session - * from being created. + * @param parameters the parameters of this sync session + * @return a session to use for synchronous document access + * @throws UnsupportedOperationException if this access implementation does not support synchronous access + * @throws RuntimeException if an error prevented the session from being created. */ public abstract SyncSession createSyncSession(SyncParameters parameters); /** - * <p>Returns a session for asynchronous document access. Use this if high - * operation throughput is required.</p> + * Returns a session for asynchronous document access. Use this if high operation throughput is required. * - * @param parameters The parameters of this async session. - * @return A session to use for asynchronous document access. - * @throws UnsupportedOperationException If this access implementation does - * not support asynchronous access. - * @throws RuntimeException If an error prevented the session - * from being created. + * @param parameters the parameters of this async session. + * @return a session to use for asynchronous document access. + * @throws UnsupportedOperationException if this access implementation does not support asynchronous access. + * @throws RuntimeException if an error prevented the session from being created */ public abstract AsyncSession createAsyncSession(AsyncParameters parameters); /** - * <p>Run a visitor with the given visitor parameters, and get the result - * back here.</p> + * Run a visitor with the given visitor parameters, and get the result back here. * * @param parameters The parameters of this visitor session. - * @return A session used to track progress of the visitor and get the - * actual data returned. - * @throws UnsupportedOperationException If this access implementation does - * not support visiting. - * @throws RuntimeException If an error prevented the session - * from being created. - * @throws ParseException If the document selection string - * could not be parsed. + * @return a session used to track progress of the visitor and get the actual data returned. + * @throws UnsupportedOperationException if this access implementation does not support visiting + * @throws RuntimeException if an error prevented the session from being created + * @throws ParseException if the document selection string could not be parsed */ public abstract VisitorSession createVisitorSession(VisitorParameters parameters) throws ParseException; /** - * <p>Creates a destination session for receiving data from visiting. The - * visitor must be started and progress tracked through a visitor - * session.</p> + * Creates a destination session for receiving data from visiting. + * The visitor must be started and progress tracked through a visitor session. * - * @param parameters The parameters of this visitor destination session. - * @return A session used to get the actual data returned. - * @throws UnsupportedOperationException If this access implementation does - * not support visiting. + * @param parameters the parameters of this visitor destination session + * @return a session used to get the actual data returned + * @throws UnsupportedOperationException if this access implementation does not support visiting. */ public abstract VisitorDestinationSession createVisitorDestinationSession(VisitorDestinationParameters parameters); /** - * <p>Creates a subscription and returns a session for getting data from - * it. Use this to get document operations being done by other parties.</p> + * Creates a subscription and returns a session for getting data from it. + * Use this to get document operations being done by other parties. * - * @param parameters The parameters of this subscription session. - * @return A session to use for document subscription. - * @throws UnsupportedOperationException If this access implementation does - * not support subscription. - * @throws RuntimeException If an error prevented the session - * from being created. + * @param parameters The parameters of this subscription session + * @return a session to use for document subscription + * @throws UnsupportedOperationException if this access implementation does not support subscription + * @throws RuntimeException if an error prevented the session from being created */ public abstract SubscriptionSession createSubscription(SubscriptionParameters parameters); /** - * <p>Returns a session for document subscription. Use this to get document - * operations being done by other parties.</p> + * Returns a session for document subscription. Use this to get document operations being done by other parties. * - * @param parameters The parameters of this subscription session. - * @return A session to use for document subscription. - * @throws UnsupportedOperationException If this access implementation does - * not support subscription. - * @throws RuntimeException If an error prevented the session - * from being created. + * @param parameters the parameters of this subscription session + * @return a session to use for document subscription + * @throws UnsupportedOperationException if this access implementation does not support subscription + * @throws RuntimeException if an error prevented the session from being created */ public abstract SubscriptionSession openSubscription(SubscriptionParameters parameters); /** * Shuts down the underlying sessions used by this DocumentAccess; - * subsequent use of this DocumentAccess will throw unspecified exceptions, - * depending on implementation. + * subsequent use of this DocumentAccess will throw unspecified exceptions, depending on implementation. * Classes overriding this must call super.shutdown(). */ public void shutdown() { @@ -170,13 +150,7 @@ public abstract class DocumentAccess { documentTypeConfigSubscriber.close(); } - /** - * <p>Returns the {@link DocumentTypeManager} used by this - * DocumentAccess.</p> - * - * @return The document type manager. - */ - public DocumentTypeManager getDocumentTypeManager() { - return documentTypeManager; - } + /** Returns the {@link DocumentTypeManager} used by this DocumentAccess. */ + public DocumentTypeManager getDocumentTypeManager() { return documentTypeManager; } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ExportPackages.java b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ExportPackages.java index 7a09690b35d..6e890fd2c2d 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ExportPackages.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ExportPackages.java @@ -59,18 +59,6 @@ public class ExportPackages { for (int i = 1; i < jars.length; ++i) { out.append(", ").append(getExportedPackages(jars[i])); } - - //TODO: temporary additions for backwards compatibility with Vespa 6. Remove when all apps have been built with 7 - out.append(", ") - .append("javax.annotation, ") - .append("javax.activation, ") - .append("javax.xml.bind.annotation.adapters, ") - .append("javax.xml.bind.annotation, ") - .append("javax.xml.bind.attachment, ") - .append("javax.xml.bind.helpers, ") - .append("javax.xml.bind.util, ") - .append("javax.xml.bind"); - return out.toString(); } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java index 3895e70376a..dfd190b14f5 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java @@ -433,9 +433,6 @@ public class NodeRepository extends AbstractComponent { * @throws IllegalArgumentException if the node has hardware failure */ public Node setDirty(Node node, Agent agent, String reason) { - if (node.status().hardwareFailureDescription().isPresent()) - throw new IllegalArgumentException("Could not deallocate " + node.hostname() + ": It has a hardware failure"); - return db.writeTo(Node.State.dirty, node, agent, Optional.of(reason)); } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporter.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporter.java index 0505dc754ff..c2f815b9d5d 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporter.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporter.java @@ -122,8 +122,7 @@ public class MetricsReporter extends Maintainer { metric.set("wantToRetire", node.status().wantToRetire() ? 1 : 0, context); metric.set("wantToDeprovision", node.status().wantToDeprovision() ? 1 : 0, context); - metric.set("hardwareFailure", node.status().hardwareFailureDescription().isPresent() ? 1 : 0, context); - metric.set("hardwareDivergence", node.status().hardwareDivergence().isPresent() ? 1 : 0, context); + metric.set("failReport", NodeFailer.reasonsToFailParentHost(node).isEmpty() ? 0 : 1, context); orchestrator.apply(new HostName(node.hostname())) .map(status -> status == HostStatus.ALLOWED_TO_BE_DOWN ? 1 : 0) diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailer.java index ad147781841..67e0800a3f0 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailer.java @@ -164,10 +164,6 @@ public class NodeFailer extends Maintainer { for (Node node : nodeRepository().getNodes(Node.State.ready)) { if (expectConfigRequests(node) && ! hasNodeRequestedConfigAfter(node, oldestAcceptableRequestTime)) { nodesByFailureReason.put(node, "Not receiving config requests from node"); - } else if (node.status().hardwareFailureDescription().isPresent()) { - nodesByFailureReason.put(node, "Node has hardware failure"); - } else if (node.status().hardwareDivergence().isPresent()) { - nodesByFailureReason.put(node, "Node has hardware divergence"); } else { Node hostNode = node.parentHostname().flatMap(parent -> nodeRepository().getNode(parent)).orElse(node); List<String> failureReports = reasonsToFailParentHost(hostNode); @@ -211,18 +207,14 @@ public class NodeFailer extends Maintainer { if (node.history().hasEventBefore(History.Event.Type.down, graceTimeEnd) && ! applicationSuspended(node)) { nodesByFailureReason.put(node, "Node has been down longer than " + downTimeLimit); } else if (hostSuspended(node, activeNodes)) { - if (node.status().hardwareFailureDescription().isPresent()) { - nodesByFailureReason.put(node, "Node has hardware failure: " + node.status().hardwareFailureDescription().get()); - } else { - Node hostNode = node.parentHostname().flatMap(parent -> nodeRepository().getNode(parent)).orElse(node); - if (hostNode.type().isDockerHost()) { - List<String> failureReports = reasonsToFailParentHost(hostNode); - if (failureReports.size() > 0) { - if (hostNode.equals(node)) { - nodesByFailureReason.put(node, "Host has failure reports: " + failureReports); - } else { - nodesByFailureReason.put(node, "Parent (" + hostNode + ") has failure reports: " + failureReports); - } + Node hostNode = node.parentHostname().flatMap(parent -> nodeRepository().getNode(parent)).orElse(node); + if (hostNode.type().isDockerHost()) { + List<String> failureReports = reasonsToFailParentHost(hostNode); + if (failureReports.size() > 0) { + if (hostNode.equals(node)) { + nodesByFailureReason.put(node, "Host has failure reports: " + failureReports); + } else { + nodesByFailureReason.put(node, "Parent (" + hostNode + ") has failure reports: " + failureReports); } } } @@ -241,10 +233,6 @@ public class NodeFailer extends Maintainer { /** Returns whether node has any kind of hardware issue */ static boolean hasHardwareIssue(Node node, NodeRepository nodeRepository) { - if (node.status().hardwareFailureDescription().isPresent() || node.status().hardwareDivergence().isPresent()) { - return true; - } - Node hostNode = node.parentHostname().flatMap(parent -> nodeRepository.getNode(parent)).orElse(node); return reasonsToFailParentHost(hostNode).size() > 0; } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Status.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Status.java index 68a1cf5cd8a..5c86b40395d 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Status.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Status.java @@ -21,10 +21,8 @@ public class Status { private final Optional<Version> vespaVersion; private final Optional<DockerImage> dockerImage; private final int failCount; - private final Optional<String> hardwareFailureDescription; private final boolean wantToRetire; private final boolean wantToDeprovision; - private final Optional<String> hardwareDivergence; private final Optional<Version> osVersion; private final Optional<Instant> firmwareVerifiedAt; @@ -32,61 +30,50 @@ public class Status { Optional<Version> vespaVersion, Optional<DockerImage> dockerImage, int failCount, - Optional<String> hardwareFailureDescription, boolean wantToRetire, boolean wantToDeprovision, - Optional<String> hardwareDivergence, Optional<Version> osVersion, Optional<Instant> firmwareVerifiedAt) { - Objects.requireNonNull(hardwareDivergence, "Hardware divergence must be non-null"); - hardwareDivergence.ifPresent(s -> requireNonEmptyString(s, "Hardware divergence must be non-empty")); this.reboot = Objects.requireNonNull(generation, "Generation must be non-null"); this.vespaVersion = Objects.requireNonNull(vespaVersion, "Vespa version must be non-null").filter(v -> !Version.emptyVersion.equals(v)); this.dockerImage = Objects.requireNonNull(dockerImage, "Docker image must be non-null").filter(d -> !DockerImage.EMPTY.equals(d)); this.failCount = failCount; - this.hardwareFailureDescription = Objects.requireNonNull(hardwareFailureDescription, "Hardware failure description must be non-null"); this.wantToRetire = wantToRetire; this.wantToDeprovision = wantToDeprovision; - this.hardwareDivergence = hardwareDivergence; this.osVersion = Objects.requireNonNull(osVersion, "OS version must be non-null"); this.firmwareVerifiedAt = Objects.requireNonNull(firmwareVerifiedAt, "Firmware check instant must be non-null"); } /** Returns a copy of this with the reboot generation changed */ - public Status withReboot(Generation reboot) { return new Status(reboot, vespaVersion, dockerImage, failCount, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, firmwareVerifiedAt); } + public Status withReboot(Generation reboot) { return new Status(reboot, vespaVersion, dockerImage, failCount, wantToRetire, wantToDeprovision, osVersion, firmwareVerifiedAt); } /** Returns the reboot generation of this node */ public Generation reboot() { return reboot; } /** Returns a copy of this with the vespa version changed */ - public Status withVespaVersion(Version version) { return new Status(reboot, Optional.of(version), dockerImage, failCount, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, firmwareVerifiedAt); } + public Status withVespaVersion(Version version) { return new Status(reboot, Optional.of(version), dockerImage, failCount, wantToRetire, wantToDeprovision, osVersion, firmwareVerifiedAt); } /** Returns the Vespa version installed on the node, if known */ public Optional<Version> vespaVersion() { return vespaVersion; } /** Returns a copy of this with the docker image changed */ - public Status withDockerImage(DockerImage dockerImage) { return new Status(reboot, vespaVersion, Optional.of(dockerImage), failCount, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, firmwareVerifiedAt); } + public Status withDockerImage(DockerImage dockerImage) { return new Status(reboot, vespaVersion, Optional.of(dockerImage), failCount, wantToRetire, wantToDeprovision, osVersion, firmwareVerifiedAt); } /** Returns the docker image the node is running, if known */ public Optional<DockerImage> dockerImage() { return dockerImage; } - public Status withIncreasedFailCount() { return new Status(reboot, vespaVersion, dockerImage, failCount + 1, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, firmwareVerifiedAt); } + public Status withIncreasedFailCount() { return new Status(reboot, vespaVersion, dockerImage, failCount + 1, wantToRetire, wantToDeprovision, osVersion, firmwareVerifiedAt); } - public Status withDecreasedFailCount() { return new Status(reboot, vespaVersion, dockerImage, failCount - 1, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, firmwareVerifiedAt); } + public Status withDecreasedFailCount() { return new Status(reboot, vespaVersion, dockerImage, failCount - 1, wantToRetire, wantToDeprovision, osVersion, firmwareVerifiedAt); } - public Status setFailCount(Integer value) { return new Status(reboot, vespaVersion, dockerImage, value, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, firmwareVerifiedAt); } + public Status setFailCount(Integer value) { return new Status(reboot, vespaVersion, dockerImage, value, wantToRetire, wantToDeprovision, osVersion, firmwareVerifiedAt); } /** Returns how many times this node has been moved to the failed state. */ public int failCount() { return failCount; } - public Status withHardwareFailureDescription(Optional<String> hardwareFailureDescription) { return new Status(reboot, vespaVersion, dockerImage, failCount, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, firmwareVerifiedAt); } - - /** Returns the type of the last hardware failure detected on this node, or empty if none */ - public Optional<String> hardwareFailureDescription() { return hardwareFailureDescription; } - /** Returns a copy of this with the want to retire flag changed */ public Status withWantToRetire(boolean wantToRetire) { - return new Status(reboot, vespaVersion, dockerImage, failCount, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, firmwareVerifiedAt); + return new Status(reboot, vespaVersion, dockerImage, failCount, wantToRetire, wantToDeprovision, osVersion, firmwareVerifiedAt); } /** @@ -99,7 +86,7 @@ public class Status { /** Returns a copy of this with the want to de-provision flag changed */ public Status withWantToDeprovision(boolean wantToDeprovision) { - return new Status(reboot, vespaVersion, dockerImage, failCount, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, firmwareVerifiedAt); + return new Status(reboot, vespaVersion, dockerImage, failCount, wantToRetire, wantToDeprovision, osVersion, firmwareVerifiedAt); } /** @@ -109,16 +96,9 @@ public class Status { return wantToDeprovision; } - public Status withHardwareDivergence(Optional<String> hardwareDivergence) { - return new Status(reboot, vespaVersion, dockerImage, failCount, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, firmwareVerifiedAt); - } - - /** Returns hardware divergence report as JSON string, if any */ - public Optional<String> hardwareDivergence() { return hardwareDivergence; } - /** Returns a copy of this with the current OS version set to version */ public Status withOsVersion(Version version) { - return new Status(reboot, vespaVersion, dockerImage, failCount, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, Optional.of(version), firmwareVerifiedAt); + return new Status(reboot, vespaVersion, dockerImage, failCount, wantToRetire, wantToDeprovision, Optional.of(version), firmwareVerifiedAt); } /** Returns the current OS version of this node, if any */ @@ -128,7 +108,7 @@ public class Status { /** Returns a copy of this with the firmwareVerifiedAt set to the given instant. */ public Status withFirmwareVerifiedAt(Instant instant) { - return new Status(reboot, vespaVersion, dockerImage, failCount, hardwareFailureDescription, wantToRetire, wantToDeprovision, hardwareDivergence, osVersion, Optional.of(instant)); + return new Status(reboot, vespaVersion, dockerImage, failCount, wantToRetire, wantToDeprovision, osVersion, Optional.of(instant)); } /** Returns the last time this node had firmware that was verified to be up to date. */ @@ -138,14 +118,7 @@ public class Status { /** Returns the initial status of a newly provisioned node */ public static Status initial() { - return new Status(Generation.initial(), Optional.empty(), Optional.empty(), 0, Optional.empty(), false, - false, Optional.empty(), Optional.empty(), Optional.empty()); - } - - private void requireNonEmptyString(String value, String message) { - Objects.requireNonNull(value, message); - if (value.trim().isEmpty()) - throw new IllegalArgumentException(message + ", but was '" + value + "'"); + return new Status(Generation.initial(), Optional.empty(), Optional.empty(), 0, false, + false, Optional.empty(), Optional.empty()); } - } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/NodeSerializer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/NodeSerializer.java index 0726ff61fdd..98dc45ce62a 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/NodeSerializer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/NodeSerializer.java @@ -68,11 +68,9 @@ public class NodeSerializer { private static final String vespaVersionKey = "vespaVersion"; private static final String currentDockerImageKey = "currentDockerImage"; private static final String failCountKey = "failCount"; - private static final String hardwareFailureKey = "hardwareFailure"; private static final String nodeTypeKey = "type"; private static final String wantToRetireKey = "wantToRetire"; private static final String wantToDeprovisionKey = "wantToDeprovision"; - private static final String hardwareDivergenceKey = "hardwareDivergence"; private static final String osVersionKey = "osVersion"; private static final String firmwareCheckKey = "firmwareCheck"; private static final String reportsKey = "reports"; @@ -137,14 +135,11 @@ public class NodeSerializer { node.status().vespaVersion().ifPresent(version -> object.setString(vespaVersionKey, version.toString())); node.status().dockerImage().ifPresent(image -> object.setString(currentDockerImageKey, image.asString())); object.setLong(failCountKey, node.status().failCount()); - node.status().hardwareFailureDescription().ifPresent(failure -> object.setString(hardwareFailureKey, failure)); object.setBool(wantToRetireKey, node.status().wantToRetire()); object.setBool(wantToDeprovisionKey, node.status().wantToDeprovision()); node.allocation().ifPresent(allocation -> toSlime(allocation, object.setObject(instanceKey))); toSlime(node.history(), object.setArray(historyKey)); object.setString(nodeTypeKey, toString(node.type())); - node.status().hardwareDivergence().ifPresent(hardwareDivergence -> object.setString(hardwareDivergenceKey, - hardwareDivergence)); node.status().osVersion().ifPresent(version -> object.setString(osVersionKey, version.toString())); node.status().firmwareVerifiedAt().ifPresent(instant -> object.setLong(firmwareCheckKey, instant.toEpochMilli())); node.reports().toSlime(object, reportsKey); @@ -225,10 +220,8 @@ public class NodeSerializer { versionFromSlime(object.field(vespaVersionKey)), dockerImageFromSlime(object.field(currentDockerImageKey)), (int)object.field(failCountKey).asLong(), - hardwareFailureDescriptionFromSlime(object), object.field(wantToRetireKey).asBool(), object.field(wantToDeprovisionKey).asBool(), - removeQuotedNulls(hardwareDivergenceFromSlime(object)), versionFromSlime(object.field(osVersionKey)), instantFromSlime(object.field(firmwareCheckKey))); } @@ -316,32 +309,12 @@ public class NodeSerializer { return Optional.empty(); } - private Optional<String> hardwareDivergenceFromSlime(Inspector object) { - if (object.field(hardwareDivergenceKey).valid()) { - return Optional.of(object.field(hardwareDivergenceKey).asString()); - } - return Optional.empty(); - } - - // Remove when we no longer have "null" strings for this field in the node repo - private Optional<String> removeQuotedNulls(Optional<String> value) { - return value.filter(v -> !v.equals("null")); - } - - private Set<String> ipAddressesFromSlime(Inspector object, String key) { ImmutableSet.Builder<String> ipAddresses = ImmutableSet.builder(); object.field(key).traverse((ArrayTraverser) (i, item) -> ipAddresses.add(item.asString())); return ipAddresses.build(); } - private Optional<String> hardwareFailureDescriptionFromSlime(Inspector object) { - if (object.field(hardwareFailureKey).valid()) { - return Optional.of(object.field(hardwareFailureKey).asString()); - } - return Optional.empty(); - } - private Optional<String> modelNameFromSlime(Inspector object) { if (object.field(modelNameKey).valid()) { return Optional.of(object.field(modelNameKey).asString()); diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java index c46cdb11c10..8dcf3c260f5 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodePatcher.java @@ -41,7 +41,6 @@ import static com.yahoo.config.provision.NodeResources.DiskSpeed.slow; */ public class NodePatcher { - private static final String HARDWARE_FAILURE_DESCRIPTION = "hardwareFailureDescription"; private static final String WANT_TO_RETIRE = "wantToRetire"; private static final String WANT_TO_DEPROVISION = "wantToDeprovision"; @@ -96,7 +95,6 @@ public class NodePatcher { private List<Node> applyFieldRecursive(List<Node> childNodes, String name, Inspector value) { switch (name) { - case HARDWARE_FAILURE_DESCRIPTION: case WANT_TO_RETIRE: case WANT_TO_DEPROVISION: return childNodes.stream() @@ -129,8 +127,6 @@ public class NodePatcher { return node.with(node.status().setFailCount(asLong(value).intValue())); case "flavor" : return node.with(nodeFlavors.getFlavorOrThrow(asString(value))); - case HARDWARE_FAILURE_DESCRIPTION: - return node.with(node.status().withHardwareFailureDescription(removeQuotedNulls(asOptionalString(value)))); case "parentHostname" : return node.withParentHostname(asString(value)); case "ipAddresses" : @@ -141,8 +137,6 @@ public class NodePatcher { return node.withWantToRetire(asBoolean(value), Agent.operator, clock.instant()); case WANT_TO_DEPROVISION : return node.with(node.status().withWantToDeprovision(asBoolean(value))); - case "hardwareDivergence" : - return node.with(node.status().withHardwareDivergence(removeQuotedNulls(asOptionalString(value)))); case "reports" : return nodeWithPatchedReports(node, value); case "openStackId" : @@ -187,7 +181,6 @@ public class NodePatcher { }); return node.with(reportsBuilder.build()); - } private Set<String> asStringSet(Inspector field) { diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodesResponse.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodesResponse.java index e1e21268ac4..4ebd458aa15 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodesResponse.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/v2/NodesResponse.java @@ -180,14 +180,11 @@ class NodesResponse extends HttpResponse { node.status().vespaVersion().ifPresent(version -> object.setString("vespaVersion", version.toFullString())); currentDockerImage(node).ifPresent(dockerImage -> object.setString("currentDockerImage", dockerImage.asString())); object.setLong("failCount", node.status().failCount()); - object.setBool("hardwareFailure", node.status().hardwareFailureDescription().isPresent()); - node.status().hardwareFailureDescription().ifPresent(failure -> object.setString("hardwareFailureDescription", failure)); object.setBool("wantToRetire", node.status().wantToRetire()); object.setBool("wantToDeprovision", node.status().wantToDeprovision()); toSlime(node.history(), object.setArray("history")); ipAddressesToSlime(node.ipAddresses(), object.setArray("ipAddresses")); ipAddressesToSlime(node.ipAddressPool().asSet(), object.setArray("additionalIpAddresses")); - node.status().hardwareDivergence().ifPresent(hardwareDivergence -> object.setString("hardwareDivergence", hardwareDivergence)); node.reports().toSlime(object, "reports"); node.modelName().ifPresent(modelName -> object.setString("modelName", modelName)); } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/FailedExpirerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/FailedExpirerTest.java index 2b6bbdc6963..8509722b016 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/FailedExpirerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/FailedExpirerTest.java @@ -26,6 +26,8 @@ import com.yahoo.vespa.flags.InMemoryFlagSource; import com.yahoo.vespa.hosted.provision.Node; import com.yahoo.vespa.hosted.provision.NodeRepository; import com.yahoo.vespa.hosted.provision.node.Agent; +import com.yahoo.vespa.hosted.provision.node.Report; +import com.yahoo.vespa.hosted.provision.node.Reports; import com.yahoo.vespa.hosted.provision.provisioning.FlavorConfigBuilder; import com.yahoo.vespa.hosted.provision.provisioning.NodeRepositoryProvisioner; import com.yahoo.vespa.hosted.provision.testutils.MockNameResolver; @@ -33,6 +35,7 @@ import com.yahoo.vespa.hosted.provision.testutils.MockProvisionServiceProvider; import org.junit.Test; import java.time.Duration; +import java.time.Instant; import java.util.List; import java.util.Optional; import java.util.Set; @@ -155,30 +158,7 @@ public class FailedExpirerTest { } @Test - public void ensure_failed_docker_nodes_are_deallocated() { - FailureScenario scenario = new FailureScenario(SystemName.main, Environment.prod) - .withNode(NodeType.host, FailureScenario.defaultFlavor, "parent1") - .withNode(NodeType.host, FailureScenario.defaultFlavor, "parent2") - .withNode(NodeType.host, FailureScenario.defaultFlavor, "parent3") - .setReady("parent1", "parent2", "parent3") - .allocate(tenantHostApplicationId, tenantHostApplicationClusterSpec, tenantHostApplicationCapacity) - .withNode(NodeType.tenant, FailureScenario.dockerFlavor, "node1", "parent1") - .withNode(NodeType.tenant, FailureScenario.dockerFlavor, "node2", "parent2") - .withNode(NodeType.tenant, FailureScenario.dockerFlavor, "node3", "parent3") - .setReady("node1", "node2", "node3") - .allocate(ClusterSpec.Type.content, FailureScenario.dockerFlavor, "node1", "node2", "node3") - .failNode(4, "node1") - .failWithHardwareFailure("node2", "node3"); - - scenario.clock().advance(Duration.ofDays(5)); - scenario.expirer().run(); - - scenario.assertNodesIn(Node.State.parked, "node2", "node3"); - scenario.assertNodesIn(Node.State.dirty, "node1"); - } - - @Test - public void ensure_parked_docker_host() { + public void ensure_failed_docker_host_is_not_parked_unless_all_children_are() { FailureScenario scenario = new FailureScenario(SystemName.main, Environment.prod) .withNode(NodeType.host, FailureScenario.defaultFlavor, "parent1") .withNode(NodeType.host, FailureScenario.defaultFlavor, "parent2") @@ -191,17 +171,16 @@ public class FailedExpirerTest { .setReady("node1", "node2", "node3") .allocate(ClusterSpec.Type.content, FailureScenario.dockerFlavor, "node1", "node2", "node3") .failNode(8, "node3") - .failWithHardwareFailure("node2", "node3") .failWithHardwareFailure("parent2"); scenario.clock.advance(Duration.ofDays(5)); - scenario.expirer().run(); // Run twice because parent can only be parked after the child scenario.expirer().run(); - scenario.assertNodesIn(Node.State.parked, "parent2", "node2", "node3"); + scenario.assertNodesIn(Node.State.parked); + scenario.assertNodesIn(Node.State.failed, "parent2"); // Not parked because child (node2) isn't } @Test - public void ensure_failed_docker_host_is_not_parked_unless_all_children_are() { + public void ensure_parked_docker_host() { FailureScenario scenario = new FailureScenario(SystemName.main, Environment.prod) .withNode(NodeType.host, FailureScenario.defaultFlavor, "parent1") .withNode(NodeType.host, FailureScenario.defaultFlavor, "parent2") @@ -224,8 +203,6 @@ public class FailedExpirerTest { .failWithHardwareFailure("parent3"); scenario.clock().advance(Duration.ofDays(3)); - - scenario.expirer().run(); // Run twice because parent can only be parked after the child scenario.expirer().run(); scenario.assertNodesIn(Node.State.failed, "parent3", "node3", "node4"); @@ -325,8 +302,8 @@ public class FailedExpirerTest { public FailureScenario failWithHardwareFailure(String... hostname) { Stream.of(hostname).forEach(h -> { Node node = get(h); - nodeRepository.write(node.with(node.status().withHardwareFailureDescription( - Optional.of("memory_mcelog"))), () -> {}); + Report report = Report.basicReport("reportId", Report.Type.HARD_FAIL, Instant.EPOCH, "hardware failure"); + nodeRepository.write(node.with(new Reports().withReport(report)), () -> {}); nodeRepository.fail(h, Agent.system, "Failed by unit test"); }); return this; diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporterTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporterTest.java index 7c30c905983..c5af068c30b 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporterTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporterTest.java @@ -81,8 +81,7 @@ public class MetricsReporterTest { expectedMetrics.put("wantToReboot", 0); expectedMetrics.put("wantToRetire", 0); expectedMetrics.put("wantToDeprovision", 0); - expectedMetrics.put("hardwareFailure", 0); - expectedMetrics.put("hardwareDivergence", 0); + expectedMetrics.put("failReport", 0); expectedMetrics.put("allowedToBeDown", 0); expectedMetrics.put("numberOfServices", 0L); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailerTest.java index 1cf5ce252d7..e2fd8a8721c 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailerTest.java @@ -8,6 +8,7 @@ import com.yahoo.vespa.applicationmodel.ServiceStatus; import com.yahoo.vespa.hosted.provision.Node; import com.yahoo.vespa.hosted.provision.NodeRepository; import com.yahoo.vespa.hosted.provision.node.Report; +import com.yahoo.vespa.hosted.provision.node.Reports; import org.junit.Test; import java.time.Duration; @@ -17,7 +18,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -37,22 +37,8 @@ import static org.mockito.Mockito.when; */ public class NodeFailerTest { - @Test - public void fail_nodes_with_hardware_failure_if_allowed_to_be_down() { - NodeFailTester tester = NodeFailTester.withTwoApplicationsOnDocker(6); - String hostWithHwFailure = selectFirstParentHostWithNActiveNodesExcept(tester.nodeRepository, 2); - - // Set hardware failure to the parent and all its children - tester.nodeRepository.getNodes().stream() - .filter(node -> node.parentHostname().map(parent -> parent.equals(hostWithHwFailure)) - .orElse(node.hostname().equals(hostWithHwFailure))) - .forEach(node -> { - Node updatedNode = node.with(node.status().withHardwareFailureDescription(Optional.of("HW failure"))); - tester.nodeRepository.write(updatedNode, () -> {}); - }); - - testNodeFailingWith(tester, hostWithHwFailure); - } + private static final Report badTotalMemorySizeReport = Report.basicReport( + "badTotalMemorySize", HARD_FAIL, Instant.now(), "too low"); @Test public void fail_nodes_with_severe_reports_if_allowed_to_be_down() { @@ -60,7 +46,6 @@ public class NodeFailerTest { String hostWithFailureReports = selectFirstParentHostWithNActiveNodesExcept(tester.nodeRepository, 2); // Set failure report to the parent and all its children. - Report badTotalMemorySizeReport = Report.basicReport("badTotalMemorySize", HARD_FAIL, Instant.now(), "too low"); tester.nodeRepository.getNodes().stream() .filter(node -> node.hostname().equals(hostWithFailureReports)) .forEach(node -> { @@ -214,8 +199,8 @@ public class NodeFailerTest { // Hardware failures are detected on two ready nodes, which are then failed Node readyFail1 = tester.nodeRepository.getNodes(NodeType.tenant, Node.State.ready).get(2); Node readyFail2 = tester.nodeRepository.getNodes(NodeType.tenant, Node.State.ready).get(3); - tester.nodeRepository.write(readyFail1.with(readyFail1.status().withHardwareFailureDescription(Optional.of("memory_mcelog"))), () -> {}); - tester.nodeRepository.write(readyFail2.with(readyFail2.status().withHardwareFailureDescription(Optional.of("disk_smart"))), () -> {}); + tester.nodeRepository.write(readyFail1.with(new Reports().withReport(badTotalMemorySizeReport)), () -> {}); + tester.nodeRepository.write(readyFail2.with(new Reports().withReport(badTotalMemorySizeReport)), () -> {}); assertEquals(4, tester.nodeRepository.getNodes(NodeType.tenant, Node.State.ready).size()); tester.failer.run(); assertEquals(2, tester.nodeRepository.getNodes(NodeType.tenant, Node.State.ready).size()); @@ -510,14 +495,11 @@ public class NodeFailerTest { Node readyNode = tester.createReadyNodes(1).get(0); tester.failer.run(); - assertEquals(Node.State.ready, readyNode.state()); - tester.nodeRepository.write(readyNode.with(readyNode.status() - .withHardwareDivergence(Optional.of("{\"specVerificationReport\":{\"actualIpv6Connection\":false}}"))), () -> {}); + tester.nodeRepository.write(readyNode.with(new Reports().withReport(badTotalMemorySizeReport)), () -> {}); tester.failer.run(); - assertEquals(1, tester.nodeRepository.getNodes(Node.State.failed).size()); } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/persistence/SerializationTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/persistence/SerializationTest.java index 8ab7e7e909a..23699879ceb 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/persistence/SerializationTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/persistence/SerializationTest.java @@ -84,7 +84,6 @@ public class SerializationTest { node = node.with(FlavorConfigBuilder.createDummies("large").getFlavorOrThrow("large")); node = node.with(node.status().withVespaVersion(Version.fromString("1.2.3"))); node = node.with(node.status().withIncreasedFailCount().withIncreasedFailCount()); - node = node.with(node.status().withHardwareFailureDescription(Optional.of("memory_mcelog"))); node = node.with(NodeType.tenant); Node copy = nodeSerializer.fromJson(Node.State.provisioned, nodeSerializer.toJson(node)); @@ -98,7 +97,6 @@ public class SerializationTest { assertEquals("large", copy.flavor().name()); assertEquals("1.2.3", copy.status().vespaVersion().get().toString()); assertEquals(2, copy.status().failCount()); - assertEquals("memory_mcelog", copy.status().hardwareFailureDescription().get()); assertEquals(node.allocation().get().owner(), copy.allocation().get().owner()); assertEquals(node.allocation().get().membership(), copy.allocation().get().membership()); assertEquals(node.allocation().get().isRemovable(), copy.allocation().get().isRemovable()); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java index d3848866ba5..cad885104f3 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java @@ -7,8 +7,6 @@ import com.yahoo.application.container.handler.Request; import com.yahoo.application.container.handler.Response; import com.yahoo.config.provision.NodeType; import com.yahoo.io.IOUtils; -import com.yahoo.slime.Cursor; -import com.yahoo.slime.Slime; import com.yahoo.text.Utf8; import com.yahoo.vespa.config.SlimeUtils; import com.yahoo.vespa.hosted.provision.NodeRepository; @@ -22,7 +20,6 @@ import org.junit.Test; import java.io.File; import java.io.IOException; -import java.nio.charset.CharacterCodingException; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.Arrays; @@ -209,9 +206,6 @@ public class RestApiTest { Utf8.toBytes("{\"currentVespaVersion\": \"5.104.142\"}"), Request.Method.PATCH), "{\"message\":\"Updated host4.yahoo.com\"}"); assertResponse(new Request("http://localhost:8080/nodes/v2/node/host4.yahoo.com", - Utf8.toBytes("{\"hardwareFailureDescription\": \"memory_mcelog\"}"), Request.Method.PATCH), - "{\"message\":\"Updated host4.yahoo.com\"}"); - assertResponse(new Request("http://localhost:8080/nodes/v2/node/host4.yahoo.com", Utf8.toBytes("{\"parentHostname\": \"parent.yahoo.com\"}"), Request.Method.PATCH), "{\"message\":\"Updated host4.yahoo.com\"}"); assertResponse(new Request("http://localhost:8080/nodes/v2/node/host4.yahoo.com", @@ -350,22 +344,21 @@ public class RestApiTest { } @Test - public void fails_to_deallocate_node_with_hardware_failure() throws Exception { + public void fails_to_ready_node_with_hard_fail() throws Exception { assertResponse(new Request("http://localhost:8080/nodes/v2/node", ("[" + asNodeJson("host12.yahoo.com", "default") + "]"). getBytes(StandardCharsets.UTF_8), Request.Method.POST), "{\"message\":\"Added 1 nodes to the provisioned state\"}"); + String msg = "Actual disk space (2TB) differs from spec (3TB)"; assertResponse(new Request("http://localhost:8080/nodes/v2/node/host12.yahoo.com", - Utf8.toBytes("{\"hardwareFailureDescription\": \"memory_mcelog\"}"), + Utf8.toBytes("{\"reports\":{\"diskSpace\":{\"createdMillis\":2,\"description\":\"" + msg + "\",\"type\": \"HARD_FAIL\"}}}"), Request.Method.PATCH), "{\"message\":\"Updated host12.yahoo.com\"}"); - assertResponse(new Request("http://localhost:8080/nodes/v2/state/failed/host12.yahoo.com", - new byte[0], Request.Method.PUT), - "{\"message\":\"Moved host12.yahoo.com to failed\"}"); - assertResponse(new Request("http://localhost:8080/nodes/v2/state/dirty/host12.yahoo.com", - new byte[0], Request.Method.PUT), 400, - "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not deallocate host12.yahoo.com: It has a hardware failure\"}"); + assertResponse(new Request("http://localhost:8080/nodes/v2/state/ready/host12.yahoo.com", new byte[0], Request.Method.PUT), + 400, + "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Node host12.yahoo.com cannot be readied because it has " + + "hard failures: [diskSpace reported 1970-01-01T00:00:00.002Z: " + msg + "]\"}"); } @Test @@ -501,7 +494,6 @@ public class RestApiTest { "\"currentRebootGeneration\": 3," + "\"flavor\": \"medium-disk\"," + "\"currentVespaVersion\": \"5.104.142\"," + - "\"hardwareFailureDescription\": \"memory_mcelog\"," + "\"failCount\": 0," + "\"parentHostname\": \"parent.yahoo.com\"" + "}" @@ -521,28 +513,6 @@ public class RestApiTest { } @Test - public void test_hardware_patching_of_docker_host() throws Exception { - assertHardwareFailure(new Request("http://localhost:8080/nodes/v2/node/host5.yahoo.com"), false); - assertHardwareFailure(new Request("http://localhost:8080/nodes/v2/node/dockerhost2.yahoo.com"), false); - - assertResponse(new Request("http://localhost:8080/nodes/v2/node/dockerhost2.yahoo.com", - Utf8.toBytes("{\"hardwareFailureDescription\": \"memory_mcelog\"}"), - Request.Method.PATCH), - "{\"message\":\"Updated dockerhost2.yahoo.com\"}"); - - assertHardwareFailure(new Request("http://localhost:8080/nodes/v2/node/host5.yahoo.com"), true); - assertHardwareFailure(new Request("http://localhost:8080/nodes/v2/node/dockerhost2.yahoo.com"), true); - - assertResponse(new Request("http://localhost:8080/nodes/v2/node/dockerhost2.yahoo.com", - Utf8.toBytes("{\"hardwareFailureDescription\": \"null\"}"), - Request.Method.PATCH), - "{\"message\":\"Updated dockerhost2.yahoo.com\"}"); - - assertHardwareFailure(new Request("http://localhost:8080/nodes/v2/node/host5.yahoo.com"), false); - assertHardwareFailure(new Request("http://localhost:8080/nodes/v2/node/dockerhost2.yahoo.com"), false); - } - - @Test public void test_node_patch_to_remove_docker_ready_fields() throws Exception { assertResponse(new Request("http://localhost:8080/nodes/v2/node/host5.yahoo.com", Utf8.toBytes("{" + @@ -557,37 +527,6 @@ public class RestApiTest { } @Test - public void test_hardware_divergence_patching() throws Exception { - // Add report - assertResponse(new Request("http://localhost:8080/nodes/v2/node/host6.yahoo.com", - Utf8.toBytes("{\"hardwareDivergence\": \"{\\\"actualCpuCores\\\":2}\"}"), - Request.Method.PATCH), - "{\"message\":\"Updated host6.yahoo.com\"}"); - assertFile(new Request("http://localhost:8080/nodes/v2/node/host6.yahoo.com"), "node6-after-changes.json"); - - // Empty report is rejected - assertResponse(new Request("http://localhost:8080/nodes/v2/node/host6.yahoo.com", - Utf8.toBytes("{\"hardwareDivergence\": \"\"}"), - Request.Method.PATCH), - 400, - "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not set field 'hardwareDivergence': Hardware divergence must be non-empty, but was ''\"}"); - - // Clear report - assertResponse(new Request("http://localhost:8080/nodes/v2/node/host6.yahoo.com", - Utf8.toBytes("{\"hardwareDivergence\": null}"), - Request.Method.PATCH), - "{\"message\":\"Updated host6.yahoo.com\"}"); - assertFile(new Request("http://localhost:8080/nodes/v2/node/host6.yahoo.com"), "node6.json"); - - // Clear on quoted "null" report - assertResponse(new Request("http://localhost:8080/nodes/v2/node/host6.yahoo.com", - Utf8.toBytes("{\"hardwareDivergence\": \"null\"}"), - Request.Method.PATCH), - "{\"message\":\"Updated host6.yahoo.com\"}"); - assertFile(new Request("http://localhost:8080/nodes/v2/node/host6.yahoo.com"), "node6.json"); - } - - @Test public void test_reports_patching() throws IOException { // Add report assertResponse(new Request("http://localhost:8080/nodes/v2/node/host6.yahoo.com", @@ -992,23 +931,6 @@ public class RestApiTest { "],"; } - private static boolean getHardwareFailure(String json) { - Slime slime = SlimeUtils.jsonToSlime(json.getBytes()); - Cursor hardwareFailure = slime.get().field("hardwareFailure"); - if (!hardwareFailure.valid()) - throw new IllegalStateException("hardwareFailure is invalid"); - - return hardwareFailure.asBool(); - } - - private void assertHardwareFailure(Request request, boolean expectedHardwareFailure) throws CharacterCodingException { - Response response = container.handleRequest(request); - String json = response.getBodyAsString(); - boolean actualHardwareFailure = getHardwareFailure(json); - assertEquals(expectedHardwareFailure, actualHardwareFailure); - assertEquals(200, response.getStatus()); - } - /** Asserts a particular response and 200 as response status */ private void assertResponse(Request request, String responseMessage) throws IOException { assertResponse(request, 200, responseMessage); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg1.json index 58e65e65486..ba9467edb19 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg1.json @@ -16,7 +16,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg2.json index e5935753bce..aff38ae5403 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/cfg2.json @@ -16,7 +16,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/controller1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/controller1.json index ea2dbe960ae..511853d980c 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/controller1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/controller1.json @@ -16,7 +16,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-container1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-container1.json index 79ea6dffeb4..3fd38118e91 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-container1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-container1.json @@ -34,7 +34,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade-complete.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade-complete.json index 61a78305a74..f5068924084 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade-complete.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade-complete.json @@ -35,7 +35,6 @@ "currentOsVersion": "7.5.2", "wantedOsVersion": "7.5.2", "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade.json index 61a78305a74..f5068924084 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1-os-upgrade.json @@ -35,7 +35,6 @@ "currentOsVersion": "7.5.2", "wantedOsVersion": "7.5.2", "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1.json index a0fd9be9525..8aeb3f844ef 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node1.json @@ -33,7 +33,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node2.json index 2aa8a7fac8c..a7e9292396c 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node2.json @@ -33,7 +33,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node3.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node3.json index 295346c0645..60825d0925f 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node3.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node3.json @@ -33,7 +33,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node4.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node4.json index d664fd51981..b669bad3704 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node4.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node4.json @@ -33,7 +33,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node5.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node5.json index aea430bf33e..ba6f02efb21 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node5.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/docker-node5.json @@ -33,7 +33,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/dockerhost1-with-firmware-data.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/dockerhost1-with-firmware-data.json index 7343899a854..53982c78042 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/dockerhost1-with-firmware-data.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/dockerhost1-with-firmware-data.json @@ -35,7 +35,6 @@ "currentFirmwareCheck": 100, "wantedFirmwareCheck": 123, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json index d4edbe26f92..a291c10e540 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json @@ -33,7 +33,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json index 97f41d75272..1f60631296d 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json @@ -36,7 +36,6 @@ "vespaVersion": "5.104.142", "currentDockerImage": "docker-registry.domain.tld:8080/dist/vespa:5.104.142", "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node11.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node11.json index 35023156696..e665da9ade7 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node11.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node11.json @@ -17,7 +17,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json index 6a2679bbafe..7cf66c97603 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json @@ -33,7 +33,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json index 7d31a2cd505..4235ad5ad03 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json @@ -33,7 +33,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json index 3502621e9dd..0bd3df05449 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json @@ -33,7 +33,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json index 82f3c6b6f79..351432510e0 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json @@ -16,7 +16,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4-after-changes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4-after-changes.json index c1009b0e223..fe0484e31ba 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4-after-changes.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4-after-changes.json @@ -36,8 +36,6 @@ "vespaVersion": "6.43.0", "currentDockerImage": "docker-registry.domain.tld:8080/dist/vespa:6.45.0", "failCount": 1, - "hardwareFailure": true, - "hardwareFailureDescription": "memory_mcelog", "wantToRetire": true, "wantToDeprovision": true, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4.json index d32149cdac1..ca5b3218bc7 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node4.json @@ -36,7 +36,6 @@ "vespaVersion": "6.41.0", "currentDockerImage": "docker-registry.domain.tld:8080/dist/vespa:6.41.0", "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5-after-changes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5-after-changes.json index 3f1781f7c36..498af3af3fd 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5-after-changes.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5-after-changes.json @@ -17,7 +17,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 1, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5.json index 62ca45dc540..c3c36e01dff 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node5.json @@ -19,7 +19,6 @@ "vespaVersion": "1.2.3", "currentDockerImage": "docker-registry.domain.tld:8080/dist/vespa:1.2.3", "failCount": 1, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json index a290a9ca927..c3b72737ef5 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json @@ -16,7 +16,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": true, "wantToDeprovision": true, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json index 086dde32236..6fa1ccdb6fc 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json @@ -33,7 +33,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ @@ -62,6 +61,5 @@ "127.0.6.1", "::6:1" ], - "additionalIpAddresses": [], - "hardwareDivergence": "{\"actualCpuCores\":2}" + "additionalIpAddresses": [] } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json index 8beb9a73a74..788efb86d6b 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json @@ -33,7 +33,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json index cf998111ef8..26de9d1efd6 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json @@ -33,7 +33,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json index ae38bf20f5b..03db738cd2e 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json @@ -33,7 +33,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json index ce6b8968bf5..6fa1ccdb6fc 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json @@ -33,7 +33,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json index 6fa9e7f1ee0..ef42c5a7960 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json @@ -16,7 +16,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node8.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node8.json index 171a80e6dfc..a6e1ced6c2f 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node8.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node8.json @@ -16,7 +16,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node9.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node9.json index 1660e8c696c..c23f89050bb 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node9.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node9.json @@ -16,7 +16,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent1.json index 88e1bf73227..941062a832e 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent1.json @@ -16,7 +16,6 @@ "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent2.json index 9f33b1bdf40..ae4663edb7c 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent2.json @@ -16,7 +16,6 @@ "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, - "hardwareFailure": false, "wantToRetire": false, "wantToDeprovision": false, "history": [ diff --git a/vespaclient/src/perl/lib/Yahoo/Vespa/Http.pm b/vespaclient/src/perl/lib/Yahoo/Vespa/Http.pm index f48d25906b4..2dbf475f2a7 100644 --- a/vespaclient/src/perl/lib/Yahoo/Vespa/Http.pm +++ b/vespaclient/src/perl/lib/Yahoo/Vespa/Http.pm @@ -100,7 +100,7 @@ sub initialize { # () my $tls_enabled = $ENV{'VESPA_TLS_ENABLED'}; if (defined $tls_enabled and $tls_enabled eq '1') { $BROWSER->ssl_opts( SSL_version => 'TLSv12'); - $BROWSER->ssl_opts( SSL_verifycn_scheme => 'none'); + $BROWSER->ssl_opts( verify_hostname => 0); $BROWSER->ssl_opts( SSL_cipher_list => 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-CHACHA20-POLY1305:TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256' ); } if (defined $ENV{'VESPA_TLS_CA_CERT'}) { |