diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-05-13 16:50:12 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-05-13 17:09:20 +0000 |
commit | c60ec78fe9f47937a937d625000239d426ec8521 (patch) | |
tree | 1d2bf4c2d187c5b70c072e49a85893807d2d6cfb | |
parent | 7fffceef88a8391e6bfb9bd016cf5a4d80447051 (diff) |
Do not follow nullptr until node is ready for it.
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/proton.cpp | 2 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 2f952f0957c..f39d9d8620c 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -674,7 +674,7 @@ Proton::ping(MonitorRequest::UP request, MonitorClient & client) ret.partid = protonConfig.partition; ret.distribution_key = protonConfig.distributionkey; ret.timestamp = (_matchEngine->isOnline()) ? 42 : 0; - ret.activeDocs = getNumActiveDocs(); + ret.activeDocs = (_matchEngine->isOnline()) ? getNumActiveDocs() : 0; ret.activeDocsRequested = request->reportActiveDocs; return reply; } diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp index 7a46e0769cf..dc200502917 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp @@ -305,7 +305,8 @@ SearchableDocSubDB::setIndexSchema(const Schema::SP &schema, SerialNum serialNum size_t SearchableDocSubDB::getNumActiveDocs() const { - return _metaStoreCtx->getReadGuard()->get().getNumActiveLids(); + IDocumentMetaStoreContext::SP metaStoreCtx = _metaStoreCtx; + return (metaStoreCtx) ? metaStoreCtx->getReadGuard()->get().getNumActiveLids() : 0; } search::SearchableStats |