summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-11-08 10:02:28 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-11-14 17:36:18 +0000
commit2ba31a2ded7c2931c4efd529815f348082a29c5b (patch)
tree001d3e996017a003c2bae3d8481000a173ee01a5 /searchcore
parentacabe48155746477213d2ad0139445279cd0a72e (diff)
If a possibility for lidmovement, actually verify that it has not moved.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchview.cpp19
1 files changed, 18 insertions, 1 deletions
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;