From 2ba31a2ded7c2931c4efd529815f348082a29c5b Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 8 Nov 2016 10:02:28 +0000 Subject: If a possibility for lidmovement, actually verify that it has not moved. --- .../src/vespa/searchcore/proton/server/searchview.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'searchcore') diff --git a/searchcore/src/vespa/searchcore/proton/server/searchview.cpp b/searchcore/src/vespa/searchcore/proton/server/searchview.cpp index 103de39eaf7..4a08c44f395 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchview.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchview.cpp @@ -60,6 +60,21 @@ requestHasLidAbove(const DocsumRequest & request, uint32_t docIdLimit) return false; } +bool +hasAnyLidsMoved(const DocsumRequest & request, + const search::IDocumentMetaStore &metaStore) +{ + for (const DocsumRequest::Hit & h : request.hits) { + uint32_t lid = 0; + if (h.docid != search::endDocId) { + if (!metaStore.getLid(h.gid, lid) || (lid != h.docid)) { + return true; + } + } + } + return false; +} + /** * Maps the lids in the reply to gids using the original request. **/ @@ -136,7 +151,9 @@ SearchView::getDocsumsInternal(const DocsumRequest & req) uint64_t endGeneration = readGuard->get().getCurrentGeneration(); if (startGeneration != endGeneration) { if (requestHasLidAbove(req, metaStore.getNumUsedLids())) { - reply.second = false; + if (hasAnyLidsMoved(req, metaStore)) { + reply.second = false; + } } } return reply; -- cgit v1.2.3