aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-08-22 16:35:07 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-08-22 16:35:07 +0000
commitae0edb00cf0f11f5d2b07cf29a90c2f1f7d136f4 (patch)
tree415bfd665a8e628a29e2de31f5a50fe7da3239cd /searchcore
parent81e7965cf9d52869a6d524cc6ebf4ae3f7687906 (diff)
Wire in interfaces for lid based wait.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp9
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp6
-rw-r--r--searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp6
-rw-r--r--searchcore/src/tests/proton/server/visibility_handler/visibility_handler_test.cpp15
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/icommitable.h5
-rw-r--r--searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.cpp12
-rw-r--r--searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp16
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/ifeedview.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp15
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp20
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/visibilityhandler.h5
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.h1
17 files changed, 102 insertions, 30 deletions
diff --git a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
index 44ce55edfbd..d8da0b5eb4c 100644
--- a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
+++ b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
@@ -280,6 +280,12 @@ struct Committer : public ICommitable {
Committer() : _commitCount(0), _commitAndWaitCount(0) { }
void commit() override { _commitCount++; }
void commitAndWait() override { _commitAndWaitCount++; }
+ void commitAndWait(PendingLidTracker & , uint32_t ) override {
+ commitAndWait();
+ }
+ void commitAndWait(PendingLidTracker & , const std::vector<uint32_t> & ) override {
+ commitAndWait();
+ }
};
size_t getSize() {
@@ -497,8 +503,9 @@ TEST("require that iterator ignoring maxbytes stops at the end, and does not aut
}
void verifyReadConsistency(DocumentIterator & itr, Committer & committer) {
+ PendingLidTracker lidTracker;
IDocumentRetriever::SP retriever = doc("id:ns:document::1", Timestamp(2), bucket(5));
- auto commitAndWaitRetriever = std::make_shared<CommitAndWaitDocumentRetriever>(retriever, committer);
+ auto commitAndWaitRetriever = std::make_shared<CommitAndWaitDocumentRetriever>(retriever, committer, lidTracker);
itr.add(commitAndWaitRetriever);
IterateResult res = itr.iterate(largeNum);
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index 61d6b409175..1d6e0074ae5 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -268,6 +268,12 @@ struct Committer : public ICommitable {
Committer() : _commitCount(0), _commitAndWaitCount(0) { }
void commit() override { _commitCount++; }
void commitAndWait() override { _commitAndWaitCount++; }
+ void commitAndWait(PendingLidTracker & , uint32_t ) override {
+ commitAndWait();
+ }
+ void commitAndWait(PendingLidTracker & , const std::vector<uint32_t> & ) override {
+ commitAndWait();
+ }
};
struct MyConfigSnapshot
diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
index a88b36ea489..2f35a0c04b5 100644
--- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
@@ -387,6 +387,12 @@ public:
void syncSubDBs();
void commit() override { }
void commitAndWait() override { }
+ void commitAndWait(PendingLidTracker & , uint32_t ) override {
+ commitAndWait();
+ }
+ void commitAndWait(PendingLidTracker & , const std::vector<uint32_t> & ) override {
+ commitAndWait();
+ }
void performSyncSubDBs();
void notifyClusterStateChanged();
void performNotifyClusterStateChanged();
diff --git a/searchcore/src/tests/proton/server/visibility_handler/visibility_handler_test.cpp b/searchcore/src/tests/proton/server/visibility_handler/visibility_handler_test.cpp
index 468b3b5b29c..56d82ed8695 100644
--- a/searchcore/src/tests/proton/server/visibility_handler/visibility_handler_test.cpp
+++ b/searchcore/src/tests/proton/server/visibility_handler/visibility_handler_test.cpp
@@ -39,14 +39,14 @@ class MyFeedView : public DummyFeedView
{
uint32_t _forceCommitCount;
SerialNum _committedSerialNum;
+public:
+ proton::PendingLidTracker _tracker;
-public:
MyFeedView()
: _forceCommitCount(0u),
_committedSerialNum(0u)
- {
- }
+ {}
void forceCommit(SerialNum serialNum) override
{
@@ -130,13 +130,18 @@ public:
{
_getSerialNum.setSerialNum(currSerialNum);
_visibilityHandler.setVisibilityDelay(visibilityDelay);
+ constexpr uint32_t MY_LID=13;
+ if (currSerialNum != 0) {
+ _feedViewReal->_tracker.produce(MY_LID);
+ }
+ proton::PendingLidTracker * lidTracker = & _feedViewReal->_tracker;
if (internal) {
VisibilityHandler *visibilityHandler = &_visibilityHandler;
- auto task = makeLambdaTask([=]() { visibilityHandler->commitAndWait(); });
+ auto task = makeLambdaTask([=]() { visibilityHandler->commitAndWait(*lidTracker, MY_LID); });
_writeService.master().execute(std::move(task));
_writeService.master().sync();
} else {
- _visibilityHandler.commitAndWait();
+ _visibilityHandler.commitAndWait(*lidTracker, MY_LID);
}
checkCommitPostCondition(expForceCommitCount,
expCommittedSerialNum,
diff --git a/searchcore/src/vespa/searchcore/proton/common/icommitable.h b/searchcore/src/vespa/searchcore/proton/common/icommitable.h
index a9d7f5e85ab..8fcaafb548f 100644
--- a/searchcore/src/vespa/searchcore/proton/common/icommitable.h
+++ b/searchcore/src/vespa/searchcore/proton/common/icommitable.h
@@ -2,8 +2,11 @@
#pragma once
+#include <vector>
namespace proton {
+class PendingLidTracker;
+
/**
* Interface for anyone that needs to commit.
**/
@@ -11,6 +14,8 @@ class ICommitable {
public:
virtual void commit() = 0;
virtual void commitAndWait() = 0;
+ virtual void commitAndWait(PendingLidTracker & uncommittedLidTracker, uint32_t lid) = 0;
+ virtual void commitAndWait(PendingLidTracker & uncommittedLidTracker, const std::vector<uint32_t> & lid) = 0;
protected:
virtual ~ICommitable() = default;
};
diff --git a/searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.cpp b/searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.cpp
index bf0faab1cff..cf76f098dc9 100644
--- a/searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.cpp
+++ b/searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.cpp
@@ -5,9 +5,11 @@
namespace proton {
-CommitAndWaitDocumentRetriever::CommitAndWaitDocumentRetriever(IDocumentRetriever::SP retriever, ICommitable &commit)
+CommitAndWaitDocumentRetriever::CommitAndWaitDocumentRetriever(IDocumentRetriever::SP retriever, ICommitable &commit,
+ PendingLidTracker & unCommittedLidTracker)
: _retriever(std::move(retriever)),
- _commit(commit)
+ _commit(commit),
+ _uncommittedLidsTracker(unCommittedLidTracker)
{ }
CommitAndWaitDocumentRetriever::~CommitAndWaitDocumentRetriever() = default;
@@ -30,7 +32,7 @@ CommitAndWaitDocumentRetriever::getDocumentMetaData(const document::DocumentId &
document::Document::UP
CommitAndWaitDocumentRetriever::getFullDocument(search::DocumentIdT lid) const {
// Ensure that attribute vectors are committed
- _commit.commitAndWait();
+ _commit.commitAndWait(_uncommittedLidsTracker, lid);
return _retriever->getFullDocument(lid);
}
@@ -38,7 +40,7 @@ document::Document::UP
CommitAndWaitDocumentRetriever::getPartialDocument(search::DocumentIdT lid, const document::DocumentId & docId,
const document::FieldSet & fieldSet) const
{
- _commit.commitAndWait();
+ _commit.commitAndWait(_uncommittedLidsTracker, lid);
return _retriever->getPartialDocument(lid, docId, fieldSet);
}
@@ -46,7 +48,7 @@ void
CommitAndWaitDocumentRetriever::visitDocuments(const LidVector &lids, search::IDocumentVisitor &visitor,
ReadConsistency readConsistency) const
{
- _commit.commitAndWait();
+ _commit.commitAndWait(_uncommittedLidsTracker, lids);
_retriever->visitDocuments(lids, visitor, readConsistency);
}
diff --git a/searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.h b/searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.h
index c03330164c0..93778c56126 100644
--- a/searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.h
+++ b/searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.h
@@ -3,6 +3,7 @@
#pragma once
#include "i_document_retriever.h"
+#include <vespa/searchcore/proton/common/pendinglidtracker.h>
#include <vespa/searchcore/proton/common/icommitable.h>
namespace proton {
@@ -16,9 +17,10 @@ class CommitAndWaitDocumentRetriever : public IDocumentRetriever
{
IDocumentRetriever::SP _retriever;
ICommitable &_commit;
+ PendingLidTracker &_uncommittedLidsTracker;
using Bucket = storage::spi::Bucket;
public:
- CommitAndWaitDocumentRetriever(IDocumentRetriever::SP retriever, ICommitable &commit);
+ CommitAndWaitDocumentRetriever(IDocumentRetriever::SP retriever, ICommitable &commit, PendingLidTracker & unCommittedLidTracker);
~CommitAndWaitDocumentRetriever() override;
const document::DocumentTypeRepo &getDocumentTypeRepo() const override;
diff --git a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
index 2c3f9988fa3..3a7597659ae 100644
--- a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
@@ -233,6 +233,11 @@ CombiningFeedView::forceCommit(search::SerialNum serialNum)
}
}
+PendingLidTracker &
+CombiningFeedView::getUncommittedLidsTracker() {
+ LOG_ABORT("CombiningFeedView::getUncommittedLidsTracker should never be called.");
+}
+
void
CombiningFeedView::
handlePruneRemovedDocuments(const PruneRemovedDocumentsOperation &pruneOp)
diff --git a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h
index 3546fdbea71..9d6686867b0 100644
--- a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h
+++ b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.h
@@ -77,6 +77,7 @@ public:
void sync() override;
void handlePruneRemovedDocuments(const PruneRemovedDocumentsOperation &pruneOp) override;
void handleCompactLidSpace(const CompactLidSpaceOperation &op) override;
+ PendingLidTracker & getUncommittedLidsTracker() override;
// Called by document db executor
void setCalculator(const IBucketStateCalculator::SP &newCalc);
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
index dbff8e632bb..db53c5812c2 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
@@ -130,9 +130,9 @@ DocumentSubDBCollection::createRetrievers()
namespace {
IDocumentRetriever::SP
-wrapRetriever(IDocumentRetriever::SP retriever, ICommitable &commit)
+wrapRetriever(IDocumentRetriever::SP retriever, ICommitable &commit, PendingLidTracker & unCommitedLidsTracker)
{
- return std::make_shared<CommitAndWaitDocumentRetriever>(std::move(retriever), commit);
+ return std::make_shared<CommitAndWaitDocumentRetriever>(std::move(retriever), commit, unCommitedLidsTracker);
}
}
@@ -145,9 +145,11 @@ DocumentSubDBCollection::getRetrievers(IDocumentRetriever::ReadConsistency consi
auto wrappedList = std::make_shared<std::vector<IDocumentRetriever::SP>>();
wrappedList->reserve(list->size());
assert(list->size() == 3);
- wrappedList->push_back(wrapRetriever((*list)[_readySubDbId], visibilityHandler));
+ wrappedList->push_back(wrapRetriever((*list)[_readySubDbId], visibilityHandler,
+ getReadySubDB()->getFeedView()->getUncommittedLidsTracker()));
wrappedList->push_back((*list)[_remSubDbId]);
- wrappedList->push_back(wrapRetriever((*list)[_notReadySubDbId], visibilityHandler));
+ wrappedList->push_back(wrapRetriever((*list)[_notReadySubDbId], visibilityHandler,
+ getNotReadySubDB()->getFeedView()->getUncommittedLidsTracker()));
return wrappedList;
} else {
return list;
@@ -159,7 +161,8 @@ void DocumentSubDBCollection::maintenanceSync(MaintenanceController &mc, ICommit
MaintenanceDocumentSubDB readySubDB(getReadySubDB()->getName(),
_readySubDbId,
getReadySubDB()->getDocumentMetaStoreContext().getSP(),
- wrapRetriever((*retrievers)[_readySubDbId], commit),
+ wrapRetriever((*retrievers)[_readySubDbId], commit,
+ getReadySubDB()->getFeedView()->getUncommittedLidsTracker()),
getReadySubDB()->getFeedView());
MaintenanceDocumentSubDB remSubDB(getRemSubDB()->getName(),
_remSubDbId,
@@ -169,7 +172,8 @@ void DocumentSubDBCollection::maintenanceSync(MaintenanceController &mc, ICommit
MaintenanceDocumentSubDB notReadySubDB(getNotReadySubDB()->getName(),
_notReadySubDbId,
getNotReadySubDB()->getDocumentMetaStoreContext().getSP(),
- wrapRetriever((*retrievers)[_notReadySubDbId], commit),
+ wrapRetriever((*retrievers)[_notReadySubDbId], commit,
+ getNotReadySubDB()->getFeedView()->getUncommittedLidsTracker()),
getNotReadySubDB()->getFeedView());
mc.syncSubDBs(readySubDB, remSubDB, notReadySubDB);
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/ifeedview.h b/searchcore/src/vespa/searchcore/proton/server/ifeedview.h
index 9acb02c9b0f..1413f5aa3e3 100644
--- a/searchcore/src/vespa/searchcore/proton/server/ifeedview.h
+++ b/searchcore/src/vespa/searchcore/proton/server/ifeedview.h
@@ -19,6 +19,7 @@ class PruneRemovedDocumentsOperation;
class PutOperation;
class RemoveOperation;
class UpdateOperation;
+class PendingLidTracker;
/**
* Interface for a feed view as seen from a feed handler.
@@ -61,6 +62,7 @@ public:
virtual void forceCommit(search::SerialNum serialNum) = 0;
virtual void handlePruneRemovedDocuments(const PruneRemovedDocumentsOperation & pruneOp) = 0;
virtual void handleCompactLidSpace(const CompactLidSpaceOperation &op) = 0;
+ virtual PendingLidTracker & getUncommittedLidsTracker() = 0;
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
index 362d328bd71..6d98f99db51 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
@@ -197,7 +197,8 @@ StoreOnlyFeedView::StoreOnlyFeedView(const Context &ctx, const PersistentParams
_repo(ctx._repo),
_docType(nullptr),
_lidReuseDelayer(ctx._writeService, _documentMetaStoreContext->get(), ctx._lidReuseDelayerConfig),
- _pendingLidTracker(),
+ _pendingLidsForDocStore(),
+ _pendingLidsForCommit(),
_schema(ctx._schema),
_writeService(ctx._writeService),
_params(params),
@@ -215,6 +216,10 @@ StoreOnlyFeedView::sync()
_writeService.summary().sync();
}
+PendingLidTracker &
+StoreOnlyFeedView::getUncommittedLidsTracker() {
+ return _pendingLidsForCommit;
+}
void
StoreOnlyFeedView::forceCommit(SerialNum serialNum)
{
@@ -356,7 +361,7 @@ void StoreOnlyFeedView::putSummary(SerialNum serialNum, Lid lid,
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winline" // Avoid spurious inlining warning from GCC related to lambda destructor.
summaryExecutor().execute(
- makeLambdaTask([serialNum, lid, futureStream = std::move(futureStream), trackerToken = _pendingLidTracker.produce(lid), onDone, this] () mutable {
+ makeLambdaTask([serialNum, lid, futureStream = std::move(futureStream), trackerToken = _pendingLidsForDocStore.produce(lid), onDone, this] () mutable {
(void) onDone;
(void) trackerToken;
vespalib::nbostream os = futureStream.get();
@@ -372,7 +377,7 @@ void StoreOnlyFeedView::putSummary(SerialNum serialNum, Lid lid, Document::SP do
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winline" // Avoid spurious inlining warning from GCC related to lambda destructor.
summaryExecutor().execute(
- makeLambdaTask([serialNum, doc = std::move(doc), trackerToken = _pendingLidTracker.produce(lid), onDone, lid, this] {
+ makeLambdaTask([serialNum, doc = std::move(doc), trackerToken = _pendingLidsForDocStore.produce(lid), onDone, lid, this] {
(void) onDone;
(void) trackerToken;
_summaryAdapter->put(serialNum, lid, *doc);
@@ -381,7 +386,7 @@ void StoreOnlyFeedView::putSummary(SerialNum serialNum, Lid lid, Document::SP do
}
void StoreOnlyFeedView::removeSummary(SerialNum serialNum, Lid lid, OnWriteDoneType onDone) {
summaryExecutor().execute(
- makeLambdaTask([serialNum, lid, onDone, trackerToken = _pendingLidTracker.produce(lid), this] {
+ makeLambdaTask([serialNum, lid, onDone, trackerToken = _pendingLidsForDocStore.produce(lid), this] {
(void) onDone;
(void) trackerToken;
_summaryAdapter->remove(serialNum, lid);
@@ -449,7 +454,7 @@ StoreOnlyFeedView::internalUpdate(FeedToken token, const UpdateOperation &updOp)
PromisedDoc promisedDoc;
FutureDoc futureDoc = promisedDoc.get_future().share();
onWriteDone->setDocument(futureDoc);
- _pendingLidTracker.waitForConsumedLid(lid);
+ _pendingLidsForDocStore.waitForConsumedLid(lid);
if (updateScope._indexedFields) {
updateIndexedFields(serialNum, lid, futureDoc, immediateCommit, onWriteDone);
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h
index bb3f7ef28b6..87569d2876f 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h
@@ -143,7 +143,8 @@ private:
const std::shared_ptr<const document::DocumentTypeRepo> _repo;
const document::DocumentType *_docType;
LidReuseDelayer _lidReuseDelayer;
- PendingLidTracker _pendingLidTracker;
+ PendingLidTracker _pendingLidsForDocStore;
+ PendingLidTracker _pendingLidsForCommit;
protected:
const search::index::Schema::SP _schema;
@@ -262,6 +263,7 @@ public:
*/
void handlePruneRemovedDocuments(const PruneRemovedDocumentsOperation &pruneOp) override;
void handleCompactLidSpace(const CompactLidSpaceOperation &op) override;
+ PendingLidTracker & getUncommittedLidsTracker() override;
};
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp b/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp
index 2865d8c0536..d8eb0bc6553 100644
--- a/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp
@@ -23,7 +23,8 @@ VisibilityHandler::VisibilityHandler(const IGetSerialNum & serial,
VisibilityHandler::~VisibilityHandler() = default;
-void VisibilityHandler::commit()
+void
+VisibilityHandler::commit()
{
if (hasVisibilityDelay()) {
if (_writeService.master().isCurrentThread()) {
@@ -35,7 +36,8 @@ void VisibilityHandler::commit()
}
}
-void VisibilityHandler::commitAndWait()
+void
+VisibilityHandler::commitAndWait()
{
if (hasVisibilityDelay()) {
if (_writeService.master().isCurrentThread()) {
@@ -53,7 +55,16 @@ void VisibilityHandler::commitAndWait()
_writeService.summary().sync();
}
-bool VisibilityHandler::startCommit(const std::lock_guard<std::mutex> &unused, bool force)
+void
+VisibilityHandler::commitAndWait(PendingLidTracker & , uint32_t ) {
+ commitAndWait();
+}
+void VisibilityHandler::commitAndWait(PendingLidTracker & , const std::vector<uint32_t> & ) {
+ commitAndWait();
+}
+
+bool
+VisibilityHandler::startCommit(const std::lock_guard<std::mutex> &unused, bool force)
{
(void) unused;
SerialNum current = _serial.getSerialNum();
@@ -65,7 +76,8 @@ bool VisibilityHandler::startCommit(const std::lock_guard<std::mutex> &unused, b
return false;
}
-void VisibilityHandler::performCommit(bool force)
+void
+VisibilityHandler::performCommit(bool force)
{
// Called by master thread
SerialNum current = _serial.getSerialNum();
diff --git a/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.h b/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.h
index 250ef03f846..0bb5870e773 100644
--- a/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.h
+++ b/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.h
@@ -18,8 +18,7 @@ namespace proton {
class VisibilityHandler : public ICommitable
{
using IThreadingService = searchcorespi::index::IThreadingService;
- typedef vespalib::ThreadExecutor ThreadExecutor;
- typedef vespalib::VarHolder<IFeedView::SP> FeedViewHolder;
+ using FeedViewHolder = vespalib::VarHolder<IFeedView::SP>;
public:
typedef search::SerialNum SerialNum;
VisibilityHandler(const IGetSerialNum &serial,
@@ -31,6 +30,8 @@ public:
bool hasVisibilityDelay() const { return _visibilityDelay != vespalib::duration::zero(); }
void commit() override;
void commitAndWait() override;
+ void commitAndWait(PendingLidTracker & , uint32_t ) override;
+ void commitAndWait(PendingLidTracker & , const std::vector<uint32_t> & ) override;
private:
bool startCommit(const std::lock_guard<std::mutex> &unused, bool force);
void performCommit(bool force);
diff --git a/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.cpp b/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.cpp
index 53ca9e68676..beb39c8e574 100644
--- a/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.cpp
+++ b/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.cpp
@@ -1,6 +1,7 @@
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "dummy_feed_view.h"
+#include <cassert>
namespace proton::test {
@@ -16,4 +17,9 @@ DummyFeedView::DummyFeedView(std::shared_ptr<const document::DocumentTypeRepo> d
DummyFeedView::~DummyFeedView() = default;
+PendingLidTracker
+&DummyFeedView::getUncommittedLidsTracker() {
+ assert(false);
+}
+
}
diff --git a/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.h b/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.h
index 63d292a8cfd..0150f57ddef 100644
--- a/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.h
+++ b/searchcore/src/vespa/searchcore/proton/test/dummy_feed_view.h
@@ -33,6 +33,7 @@ struct DummyFeedView : public IFeedView
void handlePruneRemovedDocuments(const PruneRemovedDocumentsOperation &) override {}
void handleCompactLidSpace(const CompactLidSpaceOperation &) override {}
void forceCommit(search::SerialNum) override { }
+ PendingLidTracker &getUncommittedLidsTracker() override;
};
}