diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-01-27 16:53:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-27 16:53:18 +0100 |
commit | e7b9f3f381973e911b04be221f1f23b4f74d09eb (patch) | |
tree | 1b0fec9ed2c8bd4dc307582e925147aad279f9e9 | |
parent | a53c978fb4aca9e27f680102109d0b67b5dbfec2 (diff) | |
parent | 73742398cfffbe679de7e2e58b14f7c1ff3f2205 (diff) |
Merge pull request #1641 from yahoo/balder/propagate-degraded-reason-through-fdispatch
Balder/propagate degraded reason through fdispatch
9 files changed, 24 insertions, 49 deletions
diff --git a/searchcore/src/vespa/searchcore/fdispatch/common/timestat.h b/searchcore/src/vespa/searchcore/fdispatch/common/timestat.h index 66cab230589..ab22fd18e61 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/common/timestat.h +++ b/searchcore/src/vespa/searchcore/fdispatch/common/timestat.h @@ -1,9 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS + #pragma once +#include <cstdint> class FastS_TimeStatTotals { diff --git a/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.cpp b/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.cpp index 317e357d96a..94f9240e83f 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/program/searchadapter.cpp @@ -1,12 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".fdispatch.searchadapter"); #include "searchadapter.h" -#include <vespa/searchlib/common/packets.h> -#include <vespa/searchlib/fef/queryproperties.h> -#include <vespa/searchlib/parsequery/simplequerystack.h> #include <vespa/searchcore/fdispatch/search/datasetcollection.h> #include <vespa/searchcore/fdispatch/search/dataset_base.h> #include <vespa/searchcore/fdispatch/search/nodemanager.h> @@ -60,6 +54,8 @@ SearchAdapter::createReply() } r.coverage = SearchReply::Coverage(_searchInfo->_activeDocs, _searchInfo->_coverageDocs); + r.coverage.setSoonActive(_searchInfo->_soonActiveDocs); + r.coverage.setDegradeReason(_searchInfo->_degradeReason); FastS_hitresult *hitbuf = _queryResult->_hitbuf; r.hits.resize(hitcnt); diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp index 4bc535a3f29..34c8e75c5c0 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp @@ -1,21 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS - -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP(".search.dataset_base"); -#include <vespa/searchlib/common/fslimits.h> -#include <vespa/searchcore/util/log.h> -#include <vespa/searchcore/fdispatch/search/configdesc.h> -#include <vespa/searchcore/fdispatch/common/search.h> -#include <vespa/vespalib/util/atomic.h> -#include <vespa/searchcore/fdispatch/common/queryperf.h> - -#include <vespa/searchcore/fdispatch/search/datasetcollection.h> -#include <vespa/searchcore/fdispatch/search/engine_base.h> -#include <vespa/searchcore/fdispatch/search/dataset_base.h> -#include <vespa/searchcore/fdispatch/search/nodemanager.h> + +#include "dataset_base.h" +#include "configdesc.h" +#include "datasetcollection.h" +#include "engine_base.h" +#include "nodemanager.h" //-------------------------------------------------------------------------- diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h index 425712cf1c7..13201210b79 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h +++ b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h @@ -8,6 +8,8 @@ #include <vespa/searchcore/fdispatch/common/timestat.h> #include <vespa/searchcore/util/log.h> #include <atomic> +#include <vespa/fastos/time.h> +#include <vespa/fastos/cond.h> class FastS_TimeKeeper; diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp index baa324bae0b..af296cadf1c 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp @@ -1,20 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -#include <vespa/fnet/fnet.h> -#include <vespa/fastlib/io/bufferedfile.h> - -#include <vespa/searchcore/util/log.h> -#include <vespa/searchlib/common/fslimits.h> +#include "datasetcollection.h" +#include "fnet_dataset.h" #include <vespa/searchcore/fdispatch/common/search.h> -#include <vespa/searchlib/parsequery/simplequerystack.h> -#include <vespa/searchcore/fdispatch/search/fnet_dataset.h> -#include <vespa/searchcore/fdispatch/search/datasetcollection.h> - +#include <vespa/fnet/fnet.h> +#include <vespa/log/log.h> LOG_SETUP(".search.datasetcollection"); FastS_DataSetBase * diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/engine_base.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/engine_base.cpp index 718d270ccd4..8332b42b1df 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/engine_base.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/search/engine_base.cpp @@ -1,17 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 1998-2003 Fast Search & Transfer ASA -// Copyright (C) 2003 Overture Services Norway AS -#include <vespa/fastos/fastos.h> +#include "engine_base.h" +#include "configdesc.h" +#include "plain_dataset.h" + #include <vespa/log/log.h> LOG_SETUP(".search.engine_base"); -#include <vespa/searchcore/util/log.h> -#include <vespa/vespalib/util/atomic.h> - -#include <vespa/searchcore/fdispatch/search/configdesc.h> -#include <vespa/searchcore/fdispatch/search/plain_dataset.h> -#include <vespa/searchcore/fdispatch/search/engine_base.h> -#include <vespa/searchcore/fdispatch/common/appcontext.h> //--------------------------------------------------------------------------- diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/poss_count.h b/searchcore/src/vespa/searchcore/fdispatch/search/poss_count.h index 0ba99117d4f..d7b0b565ebd 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/poss_count.h +++ b/searchcore/src/vespa/searchcore/fdispatch/search/poss_count.h @@ -2,6 +2,7 @@ #pragma once +#include <cstdint> struct PossCount { bool valid; diff --git a/searchlib/src/tests/engine/transportserver/transportserver_test.cpp b/searchlib/src/tests/engine/transportserver/transportserver_test.cpp index 8daf6fd6f98..9a5e4f85d88 100644 --- a/searchlib/src/tests/engine/transportserver/transportserver_test.cpp +++ b/searchlib/src/tests/engine/transportserver/transportserver_test.cpp @@ -210,6 +210,7 @@ TEST("test SearchReply::Coverage set and get") { EXPECT_EQUAL(7u, c.setActive(7).getActive()); EXPECT_EQUAL(9u, c.setSoonActive(9).getSoonActive()); EXPECT_EQUAL(19u, c.setCovered(19).getCovered()); + EXPECT_EQUAL(5u, c.setDegradeReason(5).getDegradeReason()); EXPECT_EQUAL(1u, SearchReply::Coverage().degradeMatchPhase().getDegradeReason()); EXPECT_EQUAL(2u, SearchReply::Coverage().degradeTimeout().getDegradeReason()); EXPECT_EQUAL(4u, SearchReply::Coverage().degradeAdaptiveTimeout().getDegradeReason()); diff --git a/searchlib/src/vespa/searchlib/engine/searchreply.h b/searchlib/src/vespa/searchlib/engine/searchreply.h index d01e677d218..b10fde5c9da 100644 --- a/searchlib/src/vespa/searchlib/engine/searchreply.h +++ b/searchlib/src/vespa/searchlib/engine/searchreply.h @@ -38,10 +38,11 @@ public: uint64_t getCovered() const { return _covered; } uint64_t getActive() const { return _active; } uint64_t getSoonActive() const { return _soonActive; } - uint64_t getDegradeReason() const { return _degradeReason; } + uint32_t getDegradeReason() const { return _degradeReason; } Coverage & setCovered(uint64_t v) { _covered = v; return *this; } Coverage & setActive(uint64_t v) { _active = v; return *this; } Coverage & setSoonActive(uint64_t v) { _soonActive = v; return *this; } + Coverage & setDegradeReason(uint32_t v) { _degradeReason = v; return *this; } Coverage & degradeMatchPhase() { _degradeReason |= MATCH_PHASE; return *this; } Coverage & degradeTimeout() { _degradeReason |= TIMEOUT; return *this; } Coverage & degradeAdaptiveTimeout() { _degradeReason |= ADAPTIVE_TIMEOUT; return *this; } |