aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@gmail.com>2019-01-07 21:24:20 +0100
committerGitHub <noreply@github.com>2019-01-07 21:24:20 +0100
commit0d69f9fa258df33f00b708f1ee9af58a8f33917c (patch)
treeabfc76398a10cebc8ba584c98a073a25e83eafab
parent8191ade44977f2874d60fc6811bbb9427a60510d (diff)
Revert "Compact lid space on source selector."
-rw-r--r--searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp16
-rw-r--r--searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp26
-rw-r--r--searchcore/src/tests/proton/index/indexmanager_test.cpp20
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/i_index_writer.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/index_writer.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/index_writer.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/indexmanager.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp12
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/mock_index_manager.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/mock_index_writer.h1
-rw-r--r--searchcorespi/src/tests/plugin/plugin.cpp1
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h8
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp10
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h1
-rw-r--r--searchlib/src/tests/attribute/sourceselector/sourceselector_test.cpp35
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributevector.h11
-rw-r--r--searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/attribute/fixedsourceselector.h3
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/isourceselector.h7
21 files changed, 16 insertions, 163 deletions
diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
index 0f9df1fc594..c11bea14863 100644
--- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
@@ -140,14 +140,12 @@ struct MyIndexWriter : public test::MockIndexWriter
MyLidVector _removes;
int _heartBeatCount;
uint32_t _commitCount;
- uint32_t _wantedLidLimit;
MyTracer &_tracer;
MyIndexWriter(MyTracer &tracer)
: test::MockIndexWriter(IIndexManager::SP(new test::MockIndexManager())),
_removes(),
_heartBeatCount(0),
_commitCount(0),
- _wantedLidLimit(0),
_tracer(tracer)
{}
virtual void put(SerialNum serialNum, const document::Document &doc,
@@ -166,9 +164,6 @@ struct MyIndexWriter : public test::MockIndexWriter
_tracer.traceCommit(indexAdapterTypeName, serialNum);
}
virtual void heartBeat(SerialNum) override { ++_heartBeatCount; }
- void compactLidSpace(SerialNum, uint32_t lidLimit) override {
- _wantedLidLimit = lidLimit;
- }
};
struct MyGidToLidChangeHandler : public MockGidToLidChangeHandler
@@ -1149,7 +1144,7 @@ TEST_F("require that compactLidSpace() propagates to document meta store and doc
f.compactLidSpaceAndWait(2);
// performIndexForceCommit in index thread, then completion callback
// in master thread.
- EXPECT_TRUE(assertThreadObserver(7, 5, 3, f.writeServiceObserver()));
+ EXPECT_TRUE(assertThreadObserver(7, 4, 3, f.writeServiceObserver()));
EXPECT_EQUAL(2u, f.metaStoreObserver()._compactLidSpaceLidLimit);
EXPECT_EQUAL(2u, f.getDocumentStore()._compactLidSpaceLidLimit);
EXPECT_EQUAL(1u, f.metaStoreObserver()._holdUnblockShrinkLidSpaceCnt);
@@ -1167,7 +1162,7 @@ TEST_F("require that compactLidSpace() doesn't propagate to "
op.setSerialNum(0);
f.runInMaster([&] () { f.fv.handleCompactLidSpace(op); });
// Delayed holdUnblockShrinkLidSpace() in index thread, then master thread
- EXPECT_TRUE(assertThreadObserver(6, 4, 3, f.writeServiceObserver()));
+ EXPECT_TRUE(assertThreadObserver(6, 3, 3, f.writeServiceObserver()));
EXPECT_EQUAL(0u, f.metaStoreObserver()._compactLidSpaceLidLimit);
EXPECT_EQUAL(0u, f.getDocumentStore()._compactLidSpaceLidLimit);
EXPECT_EQUAL(0u, f.metaStoreObserver()._holdUnblockShrinkLidSpaceCnt);
@@ -1181,13 +1176,6 @@ TEST_F("require that compactLidSpace() propagates to attributeadapter",
EXPECT_EQUAL(2u, f.maw._wantedLidLimit);
}
-TEST_F("require that compactLidSpace() propagates to index writer",
- SearchableFeedViewFixture)
-{
- f.populateBeforeCompactLidSpace();
- f.compactLidSpaceAndWait(2);
- EXPECT_EQUAL(2u, f.miw._wantedLidLimit);
-}
TEST_F("require that commit is called if visibility delay is 0",
SearchableFeedViewFixture)
diff --git a/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp b/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp
index d92ac0dcdc2..0d9fe42b978 100644
--- a/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp
+++ b/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp
@@ -33,11 +33,8 @@ struct MyIndexManager : public test::MockIndexManager
SerialNum current;
SerialNum flushed;
SerialNum commitSerial;
- uint32_t wantedLidLimit;
- SerialNum compactSerial;
MyIndexManager() : puts(), removes(), current(0), flushed(0),
- commitSerial(0),
- wantedLidLimit(0), compactSerial(0)
+ commitSerial(0)
{
}
std::string getPut(uint32_t lid) {
@@ -65,10 +62,6 @@ struct MyIndexManager : public test::MockIndexManager
virtual SerialNum getFlushedSerialNum() const override {
return flushed;
}
- void compactLidSpace(uint32_t lidLimit, SerialNum serialNum) override {
- wantedLidLimit = lidLimit;
- compactSerial = serialNum;
- }
};
struct Fixture
@@ -102,7 +95,7 @@ struct Fixture
}
};
-TEST_F("require that index writer ignores old operations", Fixture)
+TEST_F("require that index adapter ignores old operations", Fixture)
{
f.mim.flushed = 10;
f.put(8, 1);
@@ -117,21 +110,6 @@ TEST_F("require that commit is forwarded to index manager", Fixture)
EXPECT_EQUAL(10u, f.mim.commitSerial);
}
-TEST_F("require that compactLidSpace is forwarded to index manager", Fixture)
-{
- f.iw.compactLidSpace(4, 2);
- EXPECT_EQUAL(2u, f.mim.wantedLidLimit);
- EXPECT_EQUAL(4u, f.mim.compactSerial);
-}
-
-TEST_F("require that old compactLidSpace is not forwarded to index manager", Fixture)
-{
- f.mim.flushed = 10;
- f.iw.compactLidSpace(4, 2);
- EXPECT_EQUAL(0u, f.mim.wantedLidLimit);
- EXPECT_EQUAL(0u, f.mim.compactSerial);
-}
-
TEST_MAIN()
{
TEST_RUN_ALL();
diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp
index d9f0a256faf..c025bd257a2 100644
--- a/searchcore/src/tests/proton/index/indexmanager_test.cpp
+++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp
@@ -145,14 +145,6 @@ struct Fixture {
});
_writeService.indexFieldWriter().sync();
}
- void removeDocument(uint32_t docId) {
- SerialNum serialNum = ++_serial_num;
- removeDocument(docId, serialNum);
- }
- void compactLidSpace(uint32_t lidLimit) {
- SerialNum serialNum = ++_serial_num;
- runAsIndex([&]() { _index_manager->compactLidSpace(lidLimit, serialNum); });
- }
void assertStats(uint32_t expNumDiskIndexes,
uint32_t expNumMemoryIndexes,
SerialNum expLastiskIndexSerialNum,
@@ -723,18 +715,6 @@ TEST_F("require that indexes manager stats can be generated", Fixture)
TEST_DO(f.assertStats(1, 1, 1, 2));
}
-TEST_F("require that compactLidSpace works", Fixture)
-{
- Schema empty_schema;
- f.addDocument(1);
- f.addDocument(2);
- f.removeDocument(2);
- auto fsc = f._index_manager->getMaintainer().getSourceCollection();
- EXPECT_EQUAL(3u, fsc->getSourceSelector().getDocIdLimit());
- f.compactLidSpace(2);
- EXPECT_EQUAL(2u, fsc->getSourceSelector().getDocIdLimit());
-}
-
} // namespace
TEST_MAIN() {
diff --git a/searchcore/src/vespa/searchcore/proton/index/i_index_writer.h b/searchcore/src/vespa/searchcore/proton/index/i_index_writer.h
index 9dc437e6460..e42b8282941 100644
--- a/searchcore/src/vespa/searchcore/proton/index/i_index_writer.h
+++ b/searchcore/src/vespa/searchcore/proton/index/i_index_writer.h
@@ -27,7 +27,6 @@ public:
virtual void remove(search::SerialNum serialNum, const search::DocumentIdT lid) = 0;
virtual void commit(search::SerialNum serialNum, OnWriteDoneType onWriteDone) = 0;
virtual void heartBeat(search::SerialNum serialNum) = 0;
- virtual void compactLidSpace(search::SerialNum serialNum, const search::DocumentIdT lid) = 0;
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/index/index_writer.cpp b/searchcore/src/vespa/searchcore/proton/index/index_writer.cpp
index 557e751b5a6..42480826d2b 100644
--- a/searchcore/src/vespa/searchcore/proton/index/index_writer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/index/index_writer.cpp
@@ -67,13 +67,4 @@ IndexWriter::heartBeat(search::SerialNum serialNum)
_mgr->heartBeat(serialNum);
}
-void
-IndexWriter::compactLidSpace(search::SerialNum serialNum, const search::DocumentIdT lid)
-{
- if (serialNum <= _mgr->getFlushedSerialNum()) {
- return;
- }
- _mgr->compactLidSpace(lid, serialNum);
-}
-
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/index/index_writer.h b/searchcore/src/vespa/searchcore/proton/index/index_writer.h
index c231a43e06e..ca8c120ecb5 100644
--- a/searchcore/src/vespa/searchcore/proton/index/index_writer.h
+++ b/searchcore/src/vespa/searchcore/proton/index/index_writer.h
@@ -31,7 +31,6 @@ public:
virtual void
heartBeat(search::SerialNum serialNum) override;
- void compactLidSpace(search::SerialNum serialNum, const search::DocumentIdT lid) override;
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp b/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp
index 2139e34818f..82e32b0c26b 100644
--- a/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp
@@ -89,11 +89,5 @@ IndexManager::IndexManager(const vespalib::string &baseDir,
IndexManager::~IndexManager() = default;
-void
-IndexManager::compactLidSpace(uint32_t lidLimit, SerialNum serialNum)
-{
- _maintainer.compactLidSpace(lidLimit, serialNum);
-}
-
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/index/indexmanager.h b/searchcore/src/vespa/searchcore/proton/index/indexmanager.h
index 4f2d03c81e6..15872583135 100644
--- a/searchcore/src/vespa/searchcore/proton/index/indexmanager.h
+++ b/searchcore/src/vespa/searchcore/proton/index/indexmanager.h
@@ -98,7 +98,6 @@ public:
void heartBeat(SerialNum serialNum) override {
_maintainer.heartBeat(serialNum);
}
- void compactLidSpace(uint32_t lidLimit, SerialNum serialNum) override;
SerialNum getCurrentSerialNum() const override {
return _maintainer.getCurrentSerialNum();
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp b/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp
index eab118c1188..28b1c407429 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp
@@ -6,7 +6,6 @@
#include "removedonecontext.h"
#include <vespa/searchcore/proton/common/feedtoken.h>
#include <vespa/searchcore/proton/documentmetastore/ilidreusedelayer.h>
-#include <vespa/searchcore/proton/feedoperation/compact_lid_space_operation.h>
#include <vespa/searchlib/common/isequencedtaskexecutor.h>
#include <vespa/vespalib/text/stringtokenizer.h>
#include <vespa/vespalib/util/closuretask.h>
@@ -205,17 +204,6 @@ SearchableFeedView::performIndexForceCommit(SerialNum serialNum, OnForceCommitDo
}
void
-SearchableFeedView::handleCompactLidSpace(const CompactLidSpaceOperation &op)
-{
- Parent::handleCompactLidSpace(op);
- _writeService.index().execute(
- makeLambdaTask([this, &op]() {
- _indexWriter->compactLidSpace(op.getSerialNum(), op.getLidLimit());
- }));
- _writeService.index().sync();
-}
-
-void
SearchableFeedView::forceCommit(SerialNum serialNum, OnForceCommitDoneType onCommitDone)
{
Parent::forceCommit(serialNum, onCommitDone);
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.h b/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.h
index 84de5d8c853..ed3ba6740b1 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.h
+++ b/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.h
@@ -76,7 +76,6 @@ public:
~SearchableFeedView() override;
const IIndexWriter::SP &getIndexWriter() const { return _indexWriter; }
- void handleCompactLidSpace(const CompactLidSpaceOperation &op) override;
void sync() override;
};
diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_index_manager.h b/searchcore/src/vespa/searchcore/proton/test/mock_index_manager.h
index 6395ec05671..9e105ef8a7f 100644
--- a/searchcore/src/vespa/searchcore/proton/test/mock_index_manager.h
+++ b/searchcore/src/vespa/searchcore/proton/test/mock_index_manager.h
@@ -28,7 +28,6 @@ struct MockIndexManager : public searchcorespi::IIndexManager
}
virtual void setSchema(const Schema &, SerialNum) override {}
virtual void heartBeat(SerialNum) override {}
- void compactLidSpace(uint32_t, SerialNum) override {}
virtual void setMaxFlushed(uint32_t) override { }
};
diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_index_writer.h b/searchcore/src/vespa/searchcore/proton/test/mock_index_writer.h
index 8fe180533dc..6e2df177dd7 100644
--- a/searchcore/src/vespa/searchcore/proton/test/mock_index_writer.h
+++ b/searchcore/src/vespa/searchcore/proton/test/mock_index_writer.h
@@ -20,7 +20,6 @@ struct MockIndexWriter : public IIndexWriter
virtual void remove(search::SerialNum, const search::DocumentIdT) override {}
virtual void commit(search::SerialNum, OnWriteDoneType) override {}
virtual void heartBeat(search::SerialNum) override {}
- void compactLidSpace(search::SerialNum, const search::DocumentIdT) override {}
};
} // namespace test
diff --git a/searchcorespi/src/tests/plugin/plugin.cpp b/searchcorespi/src/tests/plugin/plugin.cpp
index d32b02f45fd..5614ea1da3a 100644
--- a/searchcorespi/src/tests/plugin/plugin.cpp
+++ b/searchcorespi/src/tests/plugin/plugin.cpp
@@ -20,7 +20,6 @@ public:
virtual void removeDocument(uint32_t, SerialNum) override { }
virtual void commit(SerialNum, OnWriteDoneType) override { }
virtual void heartBeat(SerialNum ) override {}
- void compactLidSpace(uint32_t, SerialNum) override {}
virtual SerialNum getCurrentSerialNum() const override { return 0; }
virtual SerialNum getFlushedSerialNum() const override { return 0; }
virtual IndexSearchable::SP getSearchable() const override {
diff --git a/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h b/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h
index cc07a940ef1..be439d499dd 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/iindexmanager.h
@@ -108,14 +108,6 @@ public:
virtual void heartBeat(SerialNum serialNum) = 0;
/**
- * This method is called when lid space is compacted.
- *
- * @param lidLimit The new lid limit.
- * @param serialNum The serial number of the lid space compaction operation.
- */
- virtual void compactLidSpace(uint32_t lidLimit, SerialNum serialNum) = 0;
-
- /**
* Returns the current serial number of the index.
* This should also reflect any heart beats.
*
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
index 6a7f4a14f2a..1e63741084d 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
@@ -1173,16 +1173,6 @@ IndexMaintainer::heartBeat(SerialNum serialNum)
_current_serial_num = serialNum;
}
-void
-IndexMaintainer::compactLidSpace(uint32_t lidLimit, SerialNum serialNum)
-{
- assert(_ctx.getThreadingService().index().isCurrentThread());
- LOG(info, "compactLidSpace(%u, %lu)", lidLimit, serialNum);
- LockGuard lock(_index_update_lock);
- _current_serial_num = serialNum;
- _selector->compactLidSpace(lidLimit);
-}
-
IFlushTarget::List
IndexMaintainer::getFlushTargets(void)
{
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h
index 06f02c5b9ef..fb0bc2e5e78 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.h
@@ -357,7 +357,6 @@ public:
void removeDocument(uint32_t lid, SerialNum serialNum) override;
void commit(SerialNum serialNum, OnWriteDoneType onWriteDone) override;
void heartBeat(search::SerialNum serialNum) override;
- void compactLidSpace(uint32_t lidLimit, SerialNum serialNum) override;
SerialNum getCurrentSerialNum() const override {
return _current_serial_num;
diff --git a/searchlib/src/tests/attribute/sourceselector/sourceselector_test.cpp b/searchlib/src/tests/attribute/sourceselector/sourceselector_test.cpp
index 75a0ccf6ab9..a223b87a73f 100644
--- a/searchlib/src/tests/attribute/sourceselector/sourceselector_test.cpp
+++ b/searchlib/src/tests/attribute/sourceselector/sourceselector_test.cpp
@@ -41,7 +41,7 @@ private:
void requireThatSelectorCanCloneAndSubtract();
void requireThatSelectorCanCloneAndSubtract();
template <typename SelectorType>
- void requireThatSelectorCanSaveAndLoad(bool compactLidSpace);
+ void requireThatSelectorCanSaveAndLoad();
void requireThatSelectorCanSaveAndLoad();
template <typename SelectorType>
void requireThatCompleteSourceRangeIsHandled();
@@ -49,7 +49,6 @@ private:
template <typename SelectorType>
void requireThatSourcesAreCountedCorrectly();
void requireThatSourcesAreCountedCorrectly();
- void requireThatDocIdLimitIsCorrect();
};
int
@@ -65,7 +64,6 @@ Test::Main()
TEST_DO(requireThatSelectorCanSaveAndLoad());
TEST_DO(requireThatCompleteSourceRangeIsHandled());
TEST_DO(requireThatSourcesAreCountedCorrectly());
- TEST_DO(requireThatDocIdLimitIsCorrect());
TEST_DONE();
}
@@ -142,15 +140,12 @@ Test::requireThatSelectorCanCloneAndSubtract()
template <typename SelectorType>
void
-Test::requireThatSelectorCanSaveAndLoad(bool compactLidSpace)
+Test::requireThatSelectorCanSaveAndLoad()
{
SelectorType selector(default_source, base_file_name2);
setSources(selector);
selector.setBaseId(base_id);
selector.setSource(maxDocId + 1, default_source);
- if (compactLidSpace) {
- selector.compactLidSpace(maxDocId - 4);
- }
FastOS_FileInterface::EmptyAndRemoveDirectory(index_dir.c_str());
FastOS_FileInterface::MakeDirIfNotPresentOrExit(index_dir.c_str());
@@ -160,13 +155,9 @@ Test::requireThatSelectorCanSaveAndLoad(bool compactLidSpace)
save_info->save(TuneFileAttributes(), DummyFileHeaderContext());
typename SelectorType::UP
selector2(SelectorType::load(base_file_name));
- testSourceSelector(docs, arraysize(docs) - compactLidSpace, default_source, *selector2);
+ testSourceSelector(docs, arraysize(docs), default_source, *selector2);
EXPECT_EQUAL(base_id, selector2->getBaseId());
- if (compactLidSpace) {
- EXPECT_EQUAL(maxDocId - 4, selector2->getDocIdLimit());
- } else {
- EXPECT_EQUAL(maxDocId + 2, selector2->getDocIdLimit());
- }
+ EXPECT_EQUAL(maxDocId + 2, selector2->getDocIdLimit());
FastOS_FileInterface::EmptyAndRemoveDirectory(index_dir.c_str());
}
@@ -174,8 +165,7 @@ Test::requireThatSelectorCanSaveAndLoad(bool compactLidSpace)
void
Test::requireThatSelectorCanSaveAndLoad()
{
- requireThatSelectorCanSaveAndLoad<FixedSourceSelector>(false);
- requireThatSelectorCanSaveAndLoad<FixedSourceSelector>(true);
+ requireThatSelectorCanSaveAndLoad<FixedSourceSelector>();
}
template <typename SelectorType>
@@ -221,21 +211,6 @@ Test::requireThatSourcesAreCountedCorrectly()
requireThatSourcesAreCountedCorrectly<FixedSourceSelector>();
}
-void
-Test::requireThatDocIdLimitIsCorrect()
-{
- FixedSourceSelector selector(default_source, base_file_name);
- EXPECT_EQUAL(0u, selector.getDocIdLimit());
- selector.setSource(8, 10);
- EXPECT_EQUAL(9u, selector.getDocIdLimit());
- selector.compactLidSpace(4);
- EXPECT_EQUAL(4u, selector.getDocIdLimit());
- selector.setSource(6, 10);
- EXPECT_EQUAL(7u, selector.getDocIdLimit());
- auto selector2 = selector.cloneAndSubtract(base_file_name2, 3);
- EXPECT_EQUAL(7u, selector2->getDocIdLimit());
-}
-
} // namespace
TEST_APPHOOK(Test);
diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h
index 1e8dfd6658a..ab590f807bf 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributevector.h
+++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h
@@ -256,6 +256,12 @@ protected:
EnumModifier getEnumModifier();
ValueModifier getValueModifier() { return ValueModifier(*this); }
+ void updateUncommittedDocIdLimit(DocId doc) {
+ if (_uncommittedDocIdLimit <= doc) {
+ _uncommittedDocIdLimit = doc + 1;
+ }
+ }
+
void updateCommittedDocIdLimit() {
if (_uncommittedDocIdLimit != 0) {
if (_uncommittedDocIdLimit > _committedDocIdLimit) {
@@ -407,11 +413,6 @@ public:
void setCommittedDocIdLimit(uint32_t committedDocIdLimit) {
_committedDocIdLimit = committedDocIdLimit;
}
- void updateUncommittedDocIdLimit(DocId doc) {
- if (_uncommittedDocIdLimit <= doc) {
- _uncommittedDocIdLimit = doc + 1;
- }
- }
const Status & getStatus() const { return _status; }
Status & getStatus() { return _status; }
diff --git a/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp b/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp
index 2ee35e3403f..ae2f0234e60 100644
--- a/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.cpp
@@ -45,7 +45,6 @@ FixedSourceSelector::cloneAndSubtract(const vespalib::string & attrBaseFileName,
}
selector->_source.commit();
selector->setBaseId(getBaseId() + diff);
- selector->_source.setCommittedDocIdLimit(_source.getCommittedDocIdLimit());
return selector;
}
@@ -86,14 +85,7 @@ FixedSourceSelector::setSource(uint32_t docId, queryeval::Source source)
**/
reserve(docId+1);
_source.update(docId, source);
- _source.updateUncommittedDocIdLimit(docId + 1);
_source.commit();
}
-void
-FixedSourceSelector::compactLidSpace(uint32_t lidLimit)
-{
- _source.compactLidSpace(lidLimit + 1);
-}
-
} // namespace search
diff --git a/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.h b/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.h
index f92bb1e0eb2..4dbfc22c270 100644
--- a/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.h
+++ b/searchlib/src/vespa/searchlib/attribute/fixedsourceselector.h
@@ -38,9 +38,8 @@ public:
// Inherit doc from ISourceSelector
void setSource(uint32_t docId, queryeval::Source source) final override;
uint32_t getDocIdLimit() const final override {
- return _source.getCommittedDocIdLimit() - 1;
+ return _source.getNumDocs() - 1;
}
- void compactLidSpace(uint32_t lidLimit) override;
std::unique_ptr<IIterator> createIterator() const final override {
return std::make_unique<Iterator>(*this);
}
diff --git a/searchlib/src/vespa/searchlib/queryeval/isourceselector.h b/searchlib/src/vespa/searchlib/queryeval/isourceselector.h
index 7151a785c26..88a3cb57a8a 100644
--- a/searchlib/src/vespa/searchlib/queryeval/isourceselector.h
+++ b/searchlib/src/vespa/searchlib/queryeval/isourceselector.h
@@ -73,13 +73,6 @@ public:
virtual uint32_t getDocIdLimit() const = 0;
/**
- * Sets the lid limit in this selector.
- *
- * @param lidLimit the new lid limit (one above highest valid doc id).
- */
- virtual void compactLidSpace(uint32_t lidLimit) = 0;
-
- /**
* Create a new iterator over the data held by this source
* selector.
*