diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-05-11 05:13:15 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-05-11 11:30:33 +0000 |
commit | 5bb97577080289df480c69701511366641b02ec7 (patch) | |
tree | d777b63f2f4d3a242acda5b35cc737b8c3f70d3a | |
parent | 4f0fc6d74b24fbc7af2606afc1306cac95bc3704 (diff) |
No longer any need for commit and wait retrieverbalder/no-longer-need-commit-and-wait
20 files changed, 17 insertions, 270 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 7ee811e66bf..7c2b59b4c78 100644 --- a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp +++ b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp @@ -11,7 +11,6 @@ #include <vespa/searchcore/proton/common/attribute_updater.h> #include <vespa/searchcore/proton/common/pendinglidtracker.h> #include <vespa/searchcore/proton/persistenceengine/document_iterator.h> -#include <vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.h> #include <vespa/searchlib/attribute/attributecontext.h> #include <vespa/searchlib/attribute/attributefactory.h> #include <vespa/searchlib/test/mock_attribute_manager.h> @@ -488,62 +487,6 @@ TEST("require that iterator ignoring maxbytes stops at the end, and does not aut TEST_DO(verifyIterateIgnoringStopSignal(itr)); } -void verifyReadConsistency(DocumentIterator & itr, ILidCommitState & lidCommitState) { - IDocumentRetriever::SP retriever = doc("id:ns:document::1", Timestamp(2), bucket(5)); - auto commitAndWaitRetriever = std::make_shared<CommitAndWaitDocumentRetriever>(retriever, lidCommitState); - itr.add(commitAndWaitRetriever); - - IterateResult res = itr.iterate(largeNum); - EXPECT_TRUE(res.isCompleted()); - EXPECT_EQUAL(1u, res.getEntries().size()); - TEST_DO(checkEntry(res, 0, Document(*DataType::DOCUMENT, DocumentId("id:ns:document::1")), Timestamp(2))); -} - -class ILidCommitStateProxy : public ILidCommitState { -public: - explicit ILidCommitStateProxy(ILidCommitState & lidState) - : _waitCompleteCount(0), - _lidState(lidState) - {} -private: - State waitState(State state, uint32_t lid) const override { - assert(state == State::COMPLETED); - _lidState.waitComplete(lid); - _waitCompleteCount++; - return state; - } - - State waitState(State state, const LidList &lids) const override { - assert(state == State::COMPLETED); - _lidState.waitComplete(lids); - _waitCompleteCount++; - return state; - } - -public: - mutable size_t _waitCompleteCount; -private: - ILidCommitState & _lidState; -}; - -void verifyStrongReadConsistency(DocumentIterator & itr) { - PendingLidTracker lidTracker; - - ILidCommitStateProxy lidCommitState(lidTracker); - TEST_DO(verifyReadConsistency(itr, lidCommitState)); - EXPECT_EQUAL(1u, lidCommitState._waitCompleteCount); -} - -TEST("require that default readconsistency does commit") { - DocumentIterator itr(bucket(5), std::make_shared<document::AllFields>(), selectAll(), newestV(), -1, false); - TEST_DO(verifyStrongReadConsistency(itr)); -} - -TEST("require that readconsistency::strong does commit") { - DocumentIterator itr(bucket(5), std::make_shared<document::AllFields>(), selectAll(), newestV(), -1, false, storage::spi::ReadConsistency::STRONG); - TEST_DO(verifyStrongReadConsistency(itr)); -} - TEST("require that docid limit is honoured") { IDocumentRetriever::SP retriever = doc("id:ns:document::1", Timestamp(2), bucket(5)); auto & udr = dynamic_cast<UnitDR &>(*retriever); diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp index 714d519cab3..4310d054f15 100644 --- a/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp +++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/bucketmover_common.cpp @@ -45,7 +45,7 @@ MySubDb::MySubDb(const std::shared_ptr<const DocumentTypeRepo> &repo, std::share _metaStore(*_metaStoreSP), _realRetriever(std::make_shared<MyDocumentRetriever>(repo)), _retriever(_realRetriever), - _subDb("my_sub_db", subDbId, _metaStoreSP, _retriever, IFeedView::SP(), nullptr), + _subDb("my_sub_db", subDbId, _metaStoreSP, _retriever, IFeedView::SP()), _docs(), _bucketDBHandler(*bucketDB) { diff --git a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp index 143d8f290c6..812cca754d1 100644 --- a/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentbucketmover/documentmover_test.cpp @@ -40,7 +40,6 @@ struct DocumentMoverTest : ::testing::Test MySubDbTwoBuckets _source; bucketdb::BucketDBOwner _bucketDb; MyMoveHandler _handler; - PendingLidTracker _pendingLidsForCommit; DocumentMoverTest() : _builder(), _bucketDB(std::make_shared<bucketdb::BucketDBOwner>()), @@ -58,8 +57,7 @@ struct DocumentMoverTest : ::testing::Test sourceSubDbId, _source._subDb.meta_store(), _source._subDb.retriever(), - _source._subDb.feed_view(), - &_pendingLidsForCommit); + _source._subDb.feed_view()); _mover.setupForBucket(bucket, &_source._subDb, targetSubDbId, _handler); } bool moveDocuments(size_t maxDocsToMove) { @@ -90,23 +88,6 @@ TEST_F(DocumentMoverTest, require_that_we_can_move_all_documents) } } -TEST_F(DocumentMoverTest, require_that_move_is_stalled_if_document_is_pending_commit) -{ - setupForBucket(_source.bucket(1), 6, 9); - { - IPendingLidTracker::Token token = _pendingLidsForCommit.produce(1); - EXPECT_FALSE(moveDocuments(5)); - EXPECT_FALSE(_mover.bucketDone()); - } - EXPECT_TRUE(moveDocuments(5)); - EXPECT_TRUE(_mover.bucketDone()); - EXPECT_EQ(5u, _handler._moves.size()); - EXPECT_EQ(5u, _limiter.beginOpCount); - for (size_t i = 0; i < 5u; ++i) { - assertEqual(_source.bucket(1), _source.docs(1)[0], 6, 9, _handler._moves[0]); - } -} - TEST_F(DocumentMoverTest, require_that_bucket_is_cached_when_IDocumentMoveHandler_handles_move_operation) { setupForBucket(_source.bucket(1), 6, 9); diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp index 4b9d893eca5..1f26e864ce8 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp @@ -212,8 +212,7 @@ MySubDb::MySubDb(std::shared_ptr<bucketdb::BucketDBOwner> bucket_db, const MyDoc : sub_db(std::make_unique<DummyDocumentSubDb>(std::move(bucket_db), SUBDB_ID)), maintenance_sub_db(sub_db->getName(), sub_db->getSubDbId(), sub_db->getDocumentMetaStoreContext().getSP(), std::make_shared<MyDocumentRetriever>(repo, store), - std::make_shared<MyFeedView>(repo), - &_pendingLidsForCommit) + std::make_shared<MyFeedView>(repo)) { } diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h index 348499d937f..8a55d6ff02b 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h @@ -132,7 +132,6 @@ struct MyDocumentRetriever : public DocumentRetrieverBaseForTest { struct MySubDb { std::unique_ptr<proton::test::DummyDocumentSubDb> sub_db; MaintenanceDocumentSubDB maintenance_sub_db; - PendingLidTracker _pendingLidsForCommit; MySubDb(std::shared_ptr<bucketdb::BucketDBOwner> bucket_db, const MyDocumentStore& store, const std::shared_ptr<const DocumentTypeRepo> & repo); ~MySubDb(); }; diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp index 2ca1101ac3a..e2e03c0e558 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp @@ -38,14 +38,6 @@ TEST_F(HandlerTest, createMoveOperation_works_as_expected) const BucketId bucketId(100); const Timestamp timestamp(200); DocumentMetaData document(moveFromLid, timestamp, bucketId, GlobalId()); - { - EXPECT_FALSE(_subDb.maintenance_sub_db.lidNeedsCommit(moveFromLid)); - IPendingLidTracker::Token token = _subDb._pendingLidsForCommit.produce(moveFromLid); - EXPECT_TRUE(_subDb.maintenance_sub_db.lidNeedsCommit(moveFromLid)); - MoveOperation::UP op = _handler.createMoveOperation(document, moveToLid); - ASSERT_FALSE(op); - } - EXPECT_FALSE(_subDb.maintenance_sub_db.lidNeedsCommit(moveFromLid)); MoveOperation::UP op = _handler.createMoveOperation(document, moveToLid); ASSERT_TRUE(op); EXPECT_EQ(10u, _docStore._readLid); diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp index 67a7ceeae34..c3b0d937d35 100644 --- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp +++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp @@ -461,10 +461,7 @@ MyDocumentSubDB::getSubDB() { auto retriever = std::make_shared<MyDocumentRetriever>(*this); - return MaintenanceDocumentSubDB("my_sub_db", _subDBId, - _metaStoreSP, - retriever, - IFeedView::SP(), nullptr); + return MaintenanceDocumentSubDB("my_sub_db", _subDBId, _metaStoreSP, retriever, IFeedView::SP()); } diff --git a/searchcore/src/vespa/searchcore/proton/persistenceengine/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/persistenceengine/CMakeLists.txt index 6441212f247..7a1eff532d7 100644 --- a/searchcore/src/vespa/searchcore/proton/persistenceengine/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/proton/persistenceengine/CMakeLists.txt @@ -2,7 +2,6 @@ vespa_add_library(searchcore_persistenceengine STATIC SOURCES document_iterator.cpp - commit_and_wait_document_retriever.cpp i_document_retriever.cpp persistenceengine.cpp persistence_handler_map.cpp 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 deleted file mode 100644 index aa20627600f..00000000000 --- a/searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "commit_and_wait_document_retriever.h" -#include <vespa/document/fieldvalue/document.h> - -namespace proton { - -CommitAndWaitDocumentRetriever::CommitAndWaitDocumentRetriever(IDocumentRetriever::SP retriever, - ILidCommitState & unCommittedLidTracker) - : _retriever(std::move(retriever)), - _uncommittedLidsTracker(unCommittedLidTracker) -{ } - -CommitAndWaitDocumentRetriever::~CommitAndWaitDocumentRetriever() = default; - -const document::DocumentTypeRepo & -CommitAndWaitDocumentRetriever::getDocumentTypeRepo() const { - return _retriever->getDocumentTypeRepo(); -} - -void -CommitAndWaitDocumentRetriever::getBucketMetaData(const Bucket &bucket, search::DocumentMetaData::Vector &result) const { - return _retriever->getBucketMetaData(bucket, result); -} - -search::DocumentMetaData -CommitAndWaitDocumentRetriever::getDocumentMetaData(const document::DocumentId &id) const { - return _retriever->getDocumentMetaData(id); -} - -document::Document::UP -CommitAndWaitDocumentRetriever::getFullDocument(search::DocumentIdT lid) const { - // Ensure that attribute vectors are committed - _uncommittedLidsTracker.waitComplete(lid); - return _retriever->getFullDocument(lid); -} - -document::Document::UP -CommitAndWaitDocumentRetriever::getPartialDocument(search::DocumentIdT lid, const document::DocumentId & docId, - const document::FieldSet & fieldSet) const -{ - _uncommittedLidsTracker.waitComplete(lid); - return _retriever->getPartialDocument(lid, docId, fieldSet); -} - -void -CommitAndWaitDocumentRetriever::visitDocuments(const LidVector &lids, search::IDocumentVisitor &visitor, - ReadConsistency readConsistency) const -{ - _uncommittedLidsTracker.waitComplete(lids); - _retriever->visitDocuments(lids, visitor, readConsistency); -} - -CachedSelect::SP -CommitAndWaitDocumentRetriever::parseSelect(const vespalib::string &selection) const { - return _retriever->parseSelect(selection); -} - -IDocumentRetriever::ReadGuard -CommitAndWaitDocumentRetriever::getReadGuard() const { - return _retriever->getReadGuard(); -} - -uint32_t -CommitAndWaitDocumentRetriever::getDocIdLimit() const { - return _retriever->getDocIdLimit(); -} - -} // namespace proton 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 deleted file mode 100644 index 68f34c65362..00000000000 --- a/searchcore/src/vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#pragma once - -#include "i_document_retriever.h" -#include <vespa/searchcore/proton/common/ipendinglidtracker.h> - -namespace proton { - -/* - * Wrapper class for document retriever that performs commit and waits for - * it to complete before retrieving document. This is used to ensure that - * attribute vectors are committed before we read from them. - */ -class CommitAndWaitDocumentRetriever : public IDocumentRetriever -{ - IDocumentRetriever::SP _retriever; - ILidCommitState &_uncommittedLidsTracker; - using Bucket = storage::spi::Bucket; -public: - CommitAndWaitDocumentRetriever(IDocumentRetriever::SP retriever, ILidCommitState & unCommittedLidTracker); - ~CommitAndWaitDocumentRetriever() override; - - const document::DocumentTypeRepo &getDocumentTypeRepo() const override; - void getBucketMetaData(const Bucket &bucket, search::DocumentMetaData::Vector &result) const override; - search::DocumentMetaData getDocumentMetaData(const document::DocumentId &id) const override; - DocumentUP getFullDocument(search::DocumentIdT lid) const override; - DocumentUP getPartialDocument(search::DocumentIdT lid, const document::DocumentId & docId, const document::FieldSet & fieldSet) const override; - void visitDocuments(const LidVector &lids, search::IDocumentVisitor &visitor, ReadConsistency readConsistency) const override; - CachedSelect::SP parseSelect(const vespalib::string &selection) const override; - ReadGuard getReadGuard() const override; - uint32_t getDocIdLimit() const override; -}; - -} // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/documentbucketmover.cpp b/searchcore/src/vespa/searchcore/proton/server/documentbucketmover.cpp index d0581a5b13f..7454d1f3c2a 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentbucketmover.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentbucketmover.cpp @@ -22,8 +22,6 @@ typedef IDocumentMetaStore::Iterator Iterator; MoveOperation::UP BucketMover::createMoveOperation(const MoveKey &key) { - if (_source->lidNeedsCommit(key._lid)) return {}; - const RawDocumentMetaData &metaNow = _source->meta_store()->getRawMetaData(key._lid); if (metaNow.getGid() != key._gid) return {}; if (metaNow.getTimestamp() != key._timestamp) return {}; diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp index aa633536419..81f554fd07a 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp @@ -26,7 +26,6 @@ #include <vespa/searchcore/proton/initializer/task_runner.h> #include <vespa/searchcore/proton/metrics/executor_threading_service_stats.h> #include <vespa/searchcore/proton/metrics/metricswireservice.h> -#include <vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.h> #include <vespa/searchcore/proton/reference/document_db_reference_resolver.h> #include <vespa/searchcore/proton/reference/i_document_db_reference_registry.h> #include <vespa/searchlib/attribute/attributefactory.h> diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp index 09790fd84b9..6c3b2102198 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp @@ -6,7 +6,6 @@ #include "i_document_subdb_owner.h" #include "maintenancecontroller.h" #include "searchabledocsubdb.h" -#include <vespa/searchcore/proton/persistenceengine/commit_and_wait_document_retriever.h> #include <vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h> #include <vespa/vespalib/util/lambdatask.h> #include <vespa/vespalib/util/threadstackexecutor.h> @@ -120,34 +119,9 @@ DocumentSubDBCollection::createRetrievers() _retrievers.set(retrievers); } -namespace { - -std::shared_ptr<CommitAndWaitDocumentRetriever> -wrapRetriever(IDocumentRetriever::SP retriever, ILidCommitState & unCommittedLidsTracker) -{ - return std::make_shared<CommitAndWaitDocumentRetriever>(std::move(retriever), unCommittedLidsTracker); -} - -} - DocumentSubDBCollection::RetrieversSP -DocumentSubDBCollection::getRetrievers(IDocumentRetriever::ReadConsistency consistency) { - RetrieversSP list = _retrievers.get(); - - if (consistency == IDocumentRetriever::ReadConsistency::STRONG) { - auto wrappedList = std::make_shared<std::vector<IDocumentRetriever::SP>>(); - wrappedList->reserve(list->size()); - assert(list->size() == 3); - wrappedList->push_back(wrapRetriever((*list)[_readySubDbId], - getReadySubDB()->getUncommittedLidsTracker())); - wrappedList->push_back(wrapRetriever((*list)[_remSubDbId], - getRemSubDB()->getUncommittedLidsTracker())); - wrappedList->push_back(wrapRetriever((*list)[_notReadySubDbId], - getNotReadySubDB()->getUncommittedLidsTracker())); - return wrappedList; - } else { - return list; - } +DocumentSubDBCollection::getRetrievers(IDocumentRetriever::ReadConsistency) { + return _retrievers.get(); } void DocumentSubDBCollection::maintenanceSync(MaintenanceController &mc) { @@ -155,23 +129,18 @@ void DocumentSubDBCollection::maintenanceSync(MaintenanceController &mc) { MaintenanceDocumentSubDB readySubDB(getReadySubDB()->getName(), _readySubDbId, getReadySubDB()->getDocumentMetaStoreContext().getSP(), - wrapRetriever((*retrievers)[_readySubDbId], - getReadySubDB()->getUncommittedLidsTracker()), - getReadySubDB()->getFeedView(), - &getReadySubDB()->getUncommittedLidsTracker()); + (*retrievers)[_readySubDbId], + getReadySubDB()->getFeedView()); MaintenanceDocumentSubDB remSubDB(getRemSubDB()->getName(), _remSubDbId, getRemSubDB()->getDocumentMetaStoreContext().getSP(), - wrapRetriever((*retrievers)[_remSubDbId], getRemSubDB()->getUncommittedLidsTracker()), - getRemSubDB()->getFeedView(), - &getRemSubDB()->getUncommittedLidsTracker()); + (*retrievers)[_remSubDbId], + getRemSubDB()->getFeedView()); MaintenanceDocumentSubDB notReadySubDB(getNotReadySubDB()->getName(), _notReadySubDbId, getNotReadySubDB()->getDocumentMetaStoreContext().getSP(), - wrapRetriever((*retrievers)[_notReadySubDbId], - getNotReadySubDB()->getUncommittedLidsTracker()), - getNotReadySubDB()->getFeedView(), - &getNotReadySubDB()->getUncommittedLidsTracker()); + (*retrievers)[_notReadySubDbId], + getNotReadySubDB()->getFeedView()); mc.syncSubDBs(readySubDB, remSubDB, notReadySubDB); } diff --git a/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h b/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h index c19f38b738f..4967477881c 100644 --- a/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/idocumentsubdb.h @@ -120,7 +120,6 @@ public: virtual std::shared_ptr<IDocumentDBReference> getDocumentDBReference() = 0; virtual void tearDownReferences(IDocumentDBReferenceResolver &resolver) = 0; virtual void validateDocStore(FeedHandler &op, SerialNum serialNum) const = 0; - virtual PendingLidTrackerBase & getUncommittedLidsTracker() = 0; }; } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_handler.cpp b/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_handler.cpp index 1e1e15eee59..ef77869f879 100644 --- a/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_handler.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_handler.cpp @@ -71,9 +71,6 @@ MoveOperation::UP LidSpaceCompactionHandler::createMoveOperation(const search::DocumentMetaData &document, uint32_t moveToLid) const { const uint32_t moveFromLid = document.lid; - if (_subDb.lidNeedsCommit(moveFromLid)) { - return MoveOperation::UP(); - } auto doc = _subDb.retriever()->getFullDocument(moveFromLid); auto op = std::make_unique<MoveOperation>(document.bucketId, document.timestamp, std::move(doc), diff --git a/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp b/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp index 059408f4a5e..4daf70594b6 100644 --- a/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/lid_space_compaction_job.cpp @@ -88,7 +88,7 @@ void CompactionJob::moveDocument(std::shared_ptr<CompactionJob> job, const search::DocumentMetaData & metaThen, std::shared_ptr<IDestructorCallback> context) { - if (job->stopped()) return; //TODO Remove once lidtracker is no longer in use. + if (job->stopped()) return; // The real lid must be sampled in the master thread. //TODO remove target lid from createMoveOperation interface auto op = job->_handler->createMoveOperation(metaThen, 0); diff --git a/searchcore/src/vespa/searchcore/proton/server/maintenancedocumentsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/maintenancedocumentsubdb.cpp index ffbf42304d2..9472d87231e 100644 --- a/searchcore/src/vespa/searchcore/proton/server/maintenancedocumentsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/maintenancedocumentsubdb.cpp @@ -20,14 +20,12 @@ MaintenanceDocumentSubDB::MaintenanceDocumentSubDB(const vespalib::string& name, uint32_t sub_db_id, IDocumentMetaStore::SP meta_store, IDocumentRetriever::SP retriever, - IFeedView::SP feed_view, - const ILidCommitState * pendingLidsForCommit) + IFeedView::SP feed_view) : _name(name), _sub_db_id(sub_db_id), _meta_store(std::move(meta_store)), _retriever(std::move(retriever)), - _feed_view(std::move(feed_view)), - _pendingLidsForCommit(pendingLidsForCommit) + _feed_view(std::move(feed_view)) { } @@ -39,13 +37,6 @@ MaintenanceDocumentSubDB::clear() _meta_store.reset(); _retriever.reset(); _feed_view.reset(); - _pendingLidsForCommit = nullptr; -} - -bool -MaintenanceDocumentSubDB::lidNeedsCommit(search::DocumentIdT lid) const { - return ((_pendingLidsForCommit != nullptr) && - (_pendingLidsForCommit->getState(lid) != ILidCommitState::State::COMPLETED)); } } diff --git a/searchcore/src/vespa/searchcore/proton/server/maintenancedocumentsubdb.h b/searchcore/src/vespa/searchcore/proton/server/maintenancedocumentsubdb.h index 5710e893503..df82ddf1584 100644 --- a/searchcore/src/vespa/searchcore/proton/server/maintenancedocumentsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/maintenancedocumentsubdb.h @@ -8,8 +8,6 @@ namespace proton { -class ILidCommitState; - /** * The view of a document sub db as seen from the maintenance controller * and various maintenance jobs. @@ -22,7 +20,6 @@ private: IDocumentMetaStore::SP _meta_store; IDocumentRetriever::SP _retriever; IFeedView::SP _feed_view; - const ILidCommitState *_pendingLidsForCommit; public: MaintenanceDocumentSubDB(); @@ -32,8 +29,7 @@ public: uint32_t sub_db_id, IDocumentMetaStore::SP meta_store, IDocumentRetriever::SP retriever, - IFeedView::SP feed_view, - const ILidCommitState *); + IFeedView::SP feed_view); const vespalib::string& name() const { return _name; } uint32_t sub_db_id() const { return _sub_db_id; } @@ -42,8 +38,6 @@ public: const IFeedView::SP& feed_view() const { return _feed_view; } bool valid() const { return _meta_store.get() != nullptr; } - bool lidNeedsCommit(search::DocumentIdT lid) const; - void clear(); }; diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h index eb0821d4535..5a2a9dd45d7 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.h @@ -47,7 +47,7 @@ public: _tlSyncer(tlSyncer) { } - virtual ~DocSubDB() { } + ~DocSubDB() override { } void close() override { } }; @@ -232,7 +232,6 @@ public: void close() override; std::shared_ptr<IDocumentDBReference> getDocumentDBReference() override; void tearDownReferences(IDocumentDBReferenceResolver &resolver) override; - PendingLidTrackerBase & getUncommittedLidsTracker() override { return *_pendingLidsForCommit; } }; } diff --git a/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h b/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h index c95a938539c..42c3ddb6134 100644 --- a/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h +++ b/searchcore/src/vespa/searchcore/proton/test/dummy_document_sub_db.h @@ -29,7 +29,6 @@ struct DummyDocumentSubDb : public IDocumentSubDB IIndexWriter::SP _indexWriter; vespalib::ThreadStackExecutor _sharedExecutor; std::unique_ptr<ExecutorThreadingService> _writeService; - PendingLidTracker _pendingLidTracker; DummyDocumentSubDb(std::shared_ptr<bucketdb::BucketDBOwner> bucketDB, uint32_t subDbId) : _subDbId(subDbId), @@ -99,10 +98,6 @@ struct DummyDocumentSubDb : public IDocumentSubDB return std::shared_ptr<IDocumentDBReference>(); } - PendingLidTrackerBase &getUncommittedLidsTracker() override { - return _pendingLidTracker; - } - void tearDownReferences(IDocumentDBReferenceResolver &) override { } }; |