diff options
17 files changed, 102 insertions, 84 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 052745f6f2f..42ebb9b573c 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -4,12 +4,12 @@ set(GODIR ${CMAKE_CURRENT_SOURCE_DIR}/go) file(GLOB_RECURSE GOSRCFILES ${GODIR}/*.go) -add_custom_command(OUTPUT ${GODIR}/bin/vespa-logfmt ${GODIR}/bin/vespa-deploy +add_custom_command(OUTPUT ${GODIR}/bin/vespa ${GODIR}/bin/script-utils COMMAND make DEPENDS ${GODIR}/Makefile ${GOSRCFILES} WORKING_DIRECTORY ${GODIR}) -add_custom_target(vespalog_logfmt ALL DEPENDS ${GODIR}/bin/vespa-logfmt) +add_custom_target(client_go_binaries ALL DEPENDS ${GODIR}/bin/vespa ${GODIR}/bin/script-utils) install(PROGRAMS ${GODIR}/bin/script-utils DESTINATION libexec/vespa) install_symlink(libexec/vespa/script-utils bin/vespa-logfmt) diff --git a/client/go/Makefile b/client/go/Makefile index 8a07f880c24..8779c1bfe25 100644 --- a/client/go/Makefile +++ b/client/go/Makefile @@ -127,7 +127,7 @@ manpages: install clean: rm -rf $(DIST) - rm -f $(BIN)/vespa $(SHARE)/man/man1/vespa.1 $(SHARE)/man/man1/vespa-*.1 + rm -f $(BIN)/vespa $(BIN)/script-utils $(SHARE)/man/man1/vespa.1 $(SHARE)/man/man1/vespa-*.1 rmdir -p $(BIN) $(SHARE)/man/man1 > /dev/null 2>&1 || true test: ci diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java index 9e15d43d92d..f01e7799e13 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/monitoring/VespaMetricSet.java @@ -608,6 +608,7 @@ public class VespaMetricSet { // TODO: For the purpose of this file and likely elsewhere, all but the last aggregate specifier, // TODO: such as 'average' and 'sum' in the metric names below are just confusing and can be mentally // TODO: disregarded when considering metric names. Consider cleaning up for Vespa 9. + metrics.add(new Metric("vds.datastored.alldisks.buckets.average")); metrics.add(new Metric("vds.datastored.alldisks.docs.average")); metrics.add(new Metric("vds.datastored.alldisks.bytes.average")); metrics.add(new Metric("vds.visitor.allthreads.averagevisitorlifetime.max")); diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/AthenzRoleFilter.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/AthenzRoleFilter.java index e06c2c3ccbd..a93741fd8fb 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/AthenzRoleFilter.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/AthenzRoleFilter.java @@ -2,6 +2,8 @@ package com.yahoo.vespa.hosted.controller.restapi.filter; import com.auth0.jwt.JWT; +import com.auth0.jwt.interfaces.DecodedJWT; +import com.auth0.jwt.interfaces.Payload; import com.yahoo.component.annotation.Inject; import com.yahoo.config.provision.ApplicationName; import com.yahoo.config.provision.SystemName; @@ -79,14 +81,17 @@ public class AthenzRoleFilter extends JsonSecurityRequestFilterBase { try { Principal principal = request.getUserPrincipal(); if (principal instanceof AthenzPrincipal) { - Instant issuedAt = request.getClientCertificateChain().stream().findFirst() - .map(X509Certificate::getNotBefore) - .or(() -> Optional.ofNullable((String) request.getAttribute("okta.access-token")).map(iat -> JWT.decode(iat).getIssuedAt())) - .map(Date::toInstant) - .orElse(Instant.EPOCH); + Optional<DecodedJWT> oktaAt = Optional.ofNullable((String) request.getAttribute("okta.access-token")).map(JWT::decode); + Optional<X509Certificate> cert = request.getClientCertificateChain().stream().findFirst(); + Instant issuedAt = cert.map(X509Certificate::getNotBefore) + .or(() -> oktaAt.map(Payload::getIssuedAt)) + .map(Date::toInstant).orElse(Instant.EPOCH); + Instant expireAt = cert.map(X509Certificate::getNotAfter) + .or(() -> oktaAt.map(Payload::getExpiresAt)) + .map(Date::toInstant).orElse(Instant.MAX); request.setAttribute(SecurityContext.ATTRIBUTE_NAME, new SecurityContext(principal, roles((AthenzPrincipal) principal, request.getUri()), - issuedAt)); + issuedAt, expireAt)); } } catch (Exception e) { diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java index 90fead986ec..088268d781b 100644 --- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java +++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java @@ -410,7 +410,7 @@ public class Flags { ZONE_ID, APPLICATION_ID); public static final UnboundBooleanFlag ENABLE_BIT_VECTORS = defineFeatureFlag( - "enable-bit-vectors", false, + "enable-bit-vectors", true, List.of("baldersheim"), "2022-05-03", "2022-12-31", "Enables bit vector by default for fast-search attributes", "Takes effect at redeployment", @@ -542,6 +542,13 @@ public class Flags { "Takes effect at next tick", APPLICATION_ID); + public static final UnboundBooleanFlag CONSOLE_CSRF = defineFeatureFlag( + "console-csrf", false, + List.of("bjorncs", "tokle"), "2022-09-26", "2023-06-01", + "Enable CSRF token in console", + "Takes effect immediately", + CONSOLE_USER_EMAIL); + /** WARNING: public for testing: All flags should be defined in {@link Flags}. */ public static UnboundBooleanFlag defineFeatureFlag(String flagId, boolean defaultValue, List<String> owners, String createdAt, String expiresAt, String description, diff --git a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp index c03ed371c4b..107f85f12d1 100644 --- a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp +++ b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp @@ -168,6 +168,8 @@ MatchEngine::performSearch(search::engine::SearchRequest::Source req) ret->setDistributionKey(_distributionKey); if ((ret->request->trace().getLevel() > 0) && ret->request->trace().hasTrace()) { ret->request->trace().getRoot().setLong("distribution-key", _distributionKey); + DocTypeName doc_type(*ret->request); + ret->request->trace().getRoot().setString("document-type", doc_type.getName()); ret->request->trace().done(); search::fef::Properties & trace = ret->propertiesMap.lookupCreate("trace"); vespalib::SmartBuffer output(4_Ki); diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp index c1a46649d23..3ef675c6b98 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp @@ -116,6 +116,9 @@ private: class AttributeFieldBlueprint : public SimpleLeafBlueprint { private: + // Must take a copy of the query term for visitMembers() + // as only a few ISearchContext implementations exposes the query term. + vespalib::string _query_term; ISearchContext::UP _search_context; enum Type {INT, FLOAT, OTHER}; Type _type; @@ -123,6 +126,7 @@ private: AttributeFieldBlueprint(const FieldSpec &field, const IAttributeVector &attribute, QueryTermSimple::UP term, const attribute::SearchContextParams ¶ms) : SimpleLeafBlueprint(field), + _query_term(term->getTermString()), _search_context(attribute.createSearchContext(std::move(term), params)), _type(OTHER) { @@ -196,6 +200,7 @@ AttributeFieldBlueprint::visitMembers(vespalib::ObjectVisitor &visitor) const { LeafBlueprint::visitMembers(visitor); visit(visitor, "attribute", _search_context->attributeName()); + visit(visitor, "query_term", _query_term); } //----------------------------------------------------------------------------- diff --git a/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp b/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp index aa3859c7fbf..7e8ad4d2f0b 100644 --- a/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp @@ -388,7 +388,7 @@ public: const DiskIndex::LookupResult & lookupRes = _cache.lookup(termStr, _fieldId); if (lookupRes.valid()) { bool useBitVector = _field.isFilter(); - setResult(std::make_unique<DiskTermBlueprint>(_field, _diskIndex, std::make_unique<DiskIndex::LookupResult>(lookupRes), useBitVector)); + setResult(std::make_unique<DiskTermBlueprint>(_field, _diskIndex, termStr, std::make_unique<DiskIndex::LookupResult>(lookupRes), useBitVector)); } else { setResult(std::make_unique<EmptyBlueprint>(_field)); } diff --git a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp index c9d25fb8469..6331f0890f6 100644 --- a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp @@ -3,8 +3,9 @@ #include "disktermblueprint.h" #include <vespa/searchlib/common/bitvectoriterator.h> #include <vespa/searchlib/queryeval/booleanmatchiteratorwrapper.h> -#include <vespa/searchlib/queryeval/intermediate_blueprints.h> #include <vespa/searchlib/queryeval/filter_wrapper.h> +#include <vespa/searchlib/queryeval/intermediate_blueprints.h> +#include <vespa/vespalib/objects/visit.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/log/log.h> @@ -14,7 +15,7 @@ using search::BitVectorIterator; using search::fef::TermFieldMatchDataArray; using search::index::Schema; using search::queryeval::BooleanMatchIteratorWrapper; -using search::queryeval::FieldSpecBase; +using search::queryeval::FieldSpec; using search::queryeval::FieldSpecBaseList; using search::queryeval::SearchIterator; using search::queryeval::LeafBlueprint; @@ -32,13 +33,15 @@ getName(uint32_t indexId) } -DiskTermBlueprint::DiskTermBlueprint(const FieldSpecBase & field, +DiskTermBlueprint::DiskTermBlueprint(const FieldSpec & field, const DiskIndex & diskIndex, + const vespalib::string& query_term, DiskIndex::LookupResult::UP lookupRes, bool useBitVector) : SimpleLeafBlueprint(field), _field(field), _diskIndex(diskIndex), + _query_term(query_term), _lookupRes(std::move(lookupRes)), _useBitVector(useBitVector), _fetchPostingsDone(false), @@ -94,4 +97,12 @@ DiskTermBlueprint::createFilterSearch(bool strict, FilterConstraint) const return wrapper; } +void +DiskTermBlueprint::visitMembers(vespalib::ObjectVisitor& visitor) const +{ + SimpleLeafBlueprint::visitMembers(visitor); + visit(visitor, "field_name", _field.getName()); + visit(visitor, "query_term", _query_term); +} + } // namespace diff --git a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h index 27e9f548cdf..1ed99962bcc 100644 --- a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h +++ b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h @@ -13,8 +13,9 @@ namespace search::diskindex { class DiskTermBlueprint : public queryeval::SimpleLeafBlueprint { private: - queryeval::FieldSpecBase _field; + queryeval::FieldSpec _field; const DiskIndex & _diskIndex; + vespalib::string _query_term; DiskIndex::LookupResult::UP _lookupRes; bool _useBitVector; bool _fetchPostingsDone; @@ -30,8 +31,9 @@ public: * @param lookupRes the result after disk dictionary lookup. * @param useBitVector whether or not we should use bit vector. **/ - DiskTermBlueprint(const queryeval::FieldSpecBase & field, + DiskTermBlueprint(const queryeval::FieldSpec & field, const DiskIndex & diskIndex, + const vespalib::string& query_term, DiskIndex::LookupResult::UP lookupRes, bool useBitVector); @@ -42,6 +44,8 @@ public: void fetchPostings(const queryeval::ExecuteInfo &execInfo) override; std::unique_ptr<queryeval::SearchIterator> createFilterSearch(bool strict, FilterConstraint) const override; + + void visitMembers(vespalib::ObjectVisitor& visitor) const override; }; } diff --git a/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp b/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp index ddf58d7b9f1..d731be7fe22 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp @@ -5,8 +5,8 @@ #include "posting_iterator.h" #include <vespa/searchlib/bitcompression/posocccompression.h> #include <vespa/searchlib/queryeval/booleanmatchiteratorwrapper.h> -#include <vespa/searchlib/queryeval/searchiterator.h> #include <vespa/searchlib/queryeval/filter_wrapper.h> +#include <vespa/searchlib/queryeval/searchiterator.h> #include <vespa/vespalib/btree/btree.hpp> #include <vespa/vespalib/btree/btreeiterator.hpp> #include <vespa/vespalib/btree/btreenode.hpp> @@ -14,10 +14,9 @@ #include <vespa/vespalib/btree/btreenodestore.hpp> #include <vespa/vespalib/btree/btreeroot.hpp> #include <vespa/vespalib/btree/btreestore.hpp> -#include <vespa/vespalib/util/array.hpp> #include <vespa/vespalib/datastore/buffer_type.hpp> -#include <vespa/vespalib/util/exceptions.h> -#include <vespa/vespalib/util/stringfmt.h> +#include <vespa/vespalib/objects/visit.h> +#include <vespa/vespalib/util/array.hpp> #include <vespa/log/log.h> LOG_SETUP(".searchlib.memoryindex.field_index"); @@ -229,23 +228,28 @@ private: using FieldIndexType = FieldIndex<interleaved_features>; using PostingListIteratorType = typename FieldIndexType::PostingList::ConstIterator; GenerationHandler::Guard _guard; + const queryeval::FieldSpec _field; PostingListIteratorType _posting_itr; const FeatureStore& _feature_store; const uint32_t _field_id; + const vespalib::string _query_term; const bool _use_bit_vector; public: MemoryTermBlueprint(GenerationHandler::Guard&& guard, PostingListIteratorType posting_itr, const FeatureStore& feature_store, - const FieldSpecBase& field, + const queryeval::FieldSpec& field, uint32_t field_id, + const vespalib::string& query_term, bool use_bit_vector) : SimpleLeafBlueprint(field), _guard(), + _field(field), _posting_itr(posting_itr), _feature_store(feature_store), _field_id(field_id), + _query_term(query_term), _use_bit_vector(use_bit_vector) { _guard = std::move(guard); @@ -271,6 +275,12 @@ public: wrapper->wrap(make_search_iterator<interleaved_features>(_posting_itr, _feature_store, _field_id, tfmda)); return wrapper; } + + void visitMembers(vespalib::ObjectVisitor& visitor) const override { + SimpleLeafBlueprint::visitMembers(visitor); + visit(visitor, "field_name", _field.getName()); + visit(visitor, "query_term", _query_term); + } }; } @@ -278,14 +288,14 @@ public: template <bool interleaved_features> std::unique_ptr<queryeval::SimpleLeafBlueprint> FieldIndex<interleaved_features>::make_term_blueprint(const vespalib::string& term, - const queryeval::FieldSpecBase& field, + const queryeval::FieldSpec& field, uint32_t field_id) { auto guard = takeGenerationGuard(); auto posting_itr = findFrozen(term); bool use_bit_vector = field.isFilter(); return std::make_unique<MemoryTermBlueprint<interleaved_features>> - (std::move(guard), posting_itr, getFeatureStore(), field, field_id, use_bit_vector); + (std::move(guard), posting_itr, getFeatureStore(), field, field_id, term, use_bit_vector); } template class FieldIndex<false>; diff --git a/searchlib/src/vespa/searchlib/memoryindex/field_index.h b/searchlib/src/vespa/searchlib/memoryindex/field_index.h index 9f9f4124100..fb02ed880b4 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/field_index.h +++ b/searchlib/src/vespa/searchlib/memoryindex/field_index.h @@ -103,7 +103,7 @@ public: fef::TermFieldMatchDataArray match_data) const; std::unique_ptr<queryeval::SimpleLeafBlueprint> make_term_blueprint(const vespalib::string& term, - const queryeval::FieldSpecBase& field, + const queryeval::FieldSpec& field, uint32_t field_id) override; }; diff --git a/searchlib/src/vespa/searchlib/memoryindex/i_field_index.h b/searchlib/src/vespa/searchlib/memoryindex/i_field_index.h index 5a3d2f6160d..b250c18625d 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/i_field_index.h +++ b/searchlib/src/vespa/searchlib/memoryindex/i_field_index.h @@ -36,7 +36,7 @@ public: virtual void dump(search::index::IndexBuilder& indexBuilder) = 0; virtual std::unique_ptr<queryeval::SimpleLeafBlueprint> make_term_blueprint(const vespalib::string& term, - const queryeval::FieldSpecBase& field, + const queryeval::FieldSpec& field, uint32_t field_id) = 0; // Should only be directly used by unit tests diff --git a/storage/src/tests/storageserver/statemanagertest.cpp b/storage/src/tests/storageserver/statemanagertest.cpp index 729976d2dce..5a43f04072d 100644 --- a/storage/src/tests/storageserver/statemanagertest.cpp +++ b/storage/src/tests/storageserver/statemanagertest.cpp @@ -176,9 +176,9 @@ TEST_F(StateManagerTest, reported_node_state) { // Add a state listener to check that we get events. MyStateListener stateListener(*_manager); _manager->addStateListener(stateListener); - // Test that initial state is initializing + // Test that initial state is Down auto nodeState = _manager->getReportedNodeState(); - EXPECT_EQ("s:i b:58 i:0 t:1", nodeState->toString(false)); + EXPECT_EQ("s:d b:58 t:1", nodeState->toString(false)); // Test that it works to update the state { auto lock = _manager->grabStateChangeLock(); @@ -236,7 +236,7 @@ TEST_F(StateManagerTest, reported_node_state) { _manager->setReportedNodeState(ns); } std::string expectedEvents = - "s:i b:58 i:0 t:1 -> s:u b:58 t:1\n" + "s:d b:58 t:1 -> s:u b:58 t:1\n" "s:u b:58 t:1 -> s:s b:58 t:1 m:Stopping\\x20node\n"; EXPECT_EQ(expectedEvents, stateListener.ost.str()); } diff --git a/storage/src/vespa/storage/storageserver/statemanager.cpp b/storage/src/vespa/storage/storageserver/statemanager.cpp index b1ea000e9bc..b75400e1308 100644 --- a/storage/src/vespa/storage/storageserver/statemanager.cpp +++ b/storage/src/vespa/storage/storageserver/statemanager.cpp @@ -35,7 +35,7 @@ StateManager::StateManager(StorageComponentRegister& compReg, _stateLock(), _stateCond(), _listenerLock(), - _nodeState(std::make_shared<lib::NodeState>(_component.getNodeType(), lib::State::INITIALIZING)), + _nodeState(std::make_shared<lib::NodeState>(_component.getNodeType(), lib::State::DOWN)), _nextNodeState(), _systemState(std::make_shared<const ClusterStateBundle>(lib::ClusterState())), _nextSystemState(), @@ -43,8 +43,6 @@ StateManager::StateManager(StorageComponentRegister& compReg, _stateListeners(), _queuedStateRequests(), _threadLock(), - _lastProgressUpdateCausingSend(0), - _progressLastInitStateSend(-1), _systemStateHistory(), _systemStateHistorySize(50), _hostInfo(std::move(hostInfo)), @@ -238,31 +236,8 @@ StateManager::notifyStateListeners() break; // No change } if (_nextNodeState) { - assert(!(_nodeState->getState() == State::UP - && _nextNodeState->getState() == State::INITIALIZING)); - - if (_nodeState->getState() == State::INITIALIZING - && _nextNodeState->getState() == State::INITIALIZING - && ((_component.getClock().getTimeInMillis() - _lastProgressUpdateCausingSend) - < framework::MilliSecTime(1000)) - && _nextNodeState->getInitProgress() < 1 - && (_nextNodeState->getInitProgress() - _progressLastInitStateSend) < 0.01) - { - // For this special case, where we only have gotten a little - // initialization progress and we have reported recently, - // don't trigger sending get node state reply yet. - } else { - newState = _nextNodeState; - if (!_queuedStateRequests.empty() - && _nextNodeState->getState() == State::INITIALIZING) - { - _lastProgressUpdateCausingSend = _component.getClock().getTimeInMillis(); - _progressLastInitStateSend = newState->getInitProgress(); - } else { - _lastProgressUpdateCausingSend = framework::MilliSecTime(0); - _progressLastInitStateSend = -1; - } - } + assert(_nextNodeState->getState() != State::INITIALIZING); + newState = _nextNodeState; _nodeState = _nextNodeState; _nextNodeState.reset(); } @@ -414,14 +389,14 @@ StateManager::onGetNodeState(const api::GetNodeStateCommand::SP& cmd) "%" PRId64 " milliseconds unless a node state change " "happens before that time.", msTimeout, msTimeout * 800 / 1000); - TimeStatePair pair( + TimeStateCmdPair pair( _component.getClock().getTimeInMillis() + framework::MilliSecTime(msTimeout * 800 / 1000), cmd); _queuedStateRequests.emplace_back(std::move(pair)); } else { LOG(debug, "Answered get node state request right away since it " - "thought we were in nodestate %s, while our actual " + "thought we were in node state %s, while our actual " "node state is currently %s and we didn't just reply to " "existing request.", cmd->getExpectedState() == nullptr ? "unknown" diff --git a/storage/src/vespa/storage/storageserver/statemanager.h b/storage/src/vespa/storage/storageserver/statemanager.h index 194991723f4..0df07d048eb 100644 --- a/storage/src/vespa/storage/storageserver/statemanager.h +++ b/storage/src/vespa/storage/storageserver/statemanager.h @@ -41,36 +41,35 @@ class StateManager : public NodeStateUpdater, private framework::Runnable, private vespalib::JsonStreamTypes { - StorageComponent _component; - metrics::MetricManager& _metricManager; - mutable std::mutex _stateLock; - std::condition_variable _stateCond; - std::mutex _listenerLock; - std::shared_ptr<lib::NodeState> _nodeState; - std::shared_ptr<lib::NodeState> _nextNodeState; using ClusterStateBundle = lib::ClusterStateBundle; + using TimeStateCmdPair = std::pair<framework::MilliSecTime, api::GetNodeStateCommand::SP>; + using TimeSysStatePair = std::pair<framework::MilliSecTime, std::shared_ptr<const ClusterStateBundle>>; + + StorageComponent _component; + metrics::MetricManager& _metricManager; + mutable std::mutex _stateLock; + std::condition_variable _stateCond; + std::mutex _listenerLock; + std::shared_ptr<lib::NodeState> _nodeState; + std::shared_ptr<lib::NodeState> _nextNodeState; std::shared_ptr<const ClusterStateBundle> _systemState; std::shared_ptr<const ClusterStateBundle> _nextSystemState; - uint32_t _reported_host_info_cluster_state_version; - std::list<StateListener*> _stateListeners; - typedef std::pair<framework::MilliSecTime, api::GetNodeStateCommand::SP> TimeStatePair; - std::list<TimeStatePair> _queuedStateRequests; - mutable std::mutex _threadLock; - std::condition_variable _threadCond; - framework::MilliSecTime _lastProgressUpdateCausingSend; - vespalib::Double _progressLastInitStateSend; - using TimeSysStatePair = std::pair<framework::MilliSecTime, std::shared_ptr<const ClusterStateBundle>>; - std::deque<TimeSysStatePair> _systemStateHistory; - uint32_t _systemStateHistorySize; - std::unique_ptr<HostInfo> _hostInfo; - framework::Thread::UP _thread; + uint32_t _reported_host_info_cluster_state_version; + std::list<StateListener*> _stateListeners; + std::list<TimeStateCmdPair> _queuedStateRequests; + mutable std::mutex _threadLock; + std::condition_variable _threadCond; + std::deque<TimeSysStatePair> _systemStateHistory; + uint32_t _systemStateHistorySize; + std::unique_ptr<HostInfo> _hostInfo; + framework::Thread::UP _thread; // Controllers that have observed a GetNodeState response sent _after_ // immediately_send_get_node_state_replies() has been invoked. - std::unordered_set<uint16_t> _controllers_observed_explicit_node_state; - bool _noThreadTestMode; - bool _grabbedExternalLock; - std::atomic<bool> _notifyingListeners; - std::atomic<bool> _requested_almost_immediate_node_state_replies; + std::unordered_set<uint16_t> _controllers_observed_explicit_node_state; + bool _noThreadTestMode; + bool _grabbedExternalLock; + std::atomic<bool> _notifyingListeners; + std::atomic<bool> _requested_almost_immediate_node_state_replies; public: explicit StateManager(StorageComponentRegister&, metrics::MetricManager&, diff --git a/vespalib/src/vespa/vespalib/btree/btreerootbase.cpp b/vespalib/src/vespa/vespalib/btree/btreerootbase.cpp index d991985370b..70ee650218a 100644 --- a/vespalib/src/vespa/vespalib/btree/btreerootbase.cpp +++ b/vespalib/src/vespa/vespalib/btree/btreerootbase.cpp @@ -1,6 +1,5 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include "btreerootbase.h" #include "btreerootbase.hpp" namespace vespalib::btree { |