diff options
author | Geir Storli <geirst@yahooinc.com> | 2023-10-31 11:30:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-31 11:30:01 +0100 |
commit | 7c150cdc0bab88d5913de557fd24c31cd3bf18b4 (patch) | |
tree | be04beb2800f9efd5bcd903118eedda139d3b737 /searchcore/src | |
parent | ca64a43230a7142abce630dfabdaa06ebdf0ce15 (diff) | |
parent | a0e0deb766b9265af206e6865dbf648d53827251 (diff) |
Merge pull request #29156 from vespa-engine/balder/test-document-refusing-to-move
Test that a document that refuses to move is not moved.
Diffstat (limited to 'searchcore/src')
3 files changed, 19 insertions, 6 deletions
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp index e4335740343..984af9870a6 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_compaction_test.cpp @@ -56,6 +56,22 @@ TEST_F(JobTest, job_returns_false_when_multiple_move_operations_or_compaction_ar assertJobContext(4, 7, 3, 7, 1); } +TEST_F(JobTest, job_document_is_not_moved_if_meta_has_changed) +{ + setupThreeDocumentsToCompact(); + EXPECT_FALSE(run()); + assertJobContext(2, 9, 1, 0, 0); + auto orig_ts = _handler->_docs[8].first.timestamp; + _handler->_docs[8].first.timestamp = 0; + EXPECT_FALSE(run()); + assertJobContext(2, 9, 1, 0, 0); + _handler->_docs[8].first.timestamp = orig_ts; + EXPECT_FALSE(run()); + assertJobContext(3, 7, 2, 0, 0); + endScan().compact(); + assertJobContext(3, 7, 2, 8, 1); +} + TEST_F(JobTest, job_can_restart_documents_scan_if_lid_bloat_is_still_to_large) { init(ALLOWED_LID_BLOAT, ALLOWED_LID_BLOAT_FACTOR); diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp index a3e1fad46aa..d4d2a6dc377 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp @@ -122,11 +122,8 @@ JobTestBase::notifyNodeRetired(bool nodeRetired) { } void -JobTestBase::assertJobContext(uint32_t moveToLid, - uint32_t moveFromLid, - uint32_t handleMoveCnt, - uint32_t wantedLidLimit, - uint32_t compactStoreCnt) const +JobTestBase::assertJobContext(uint32_t moveToLid, uint32_t moveFromLid, uint32_t handleMoveCnt, + uint32_t wantedLidLimit, uint32_t compactStoreCnt) const { sync(); EXPECT_EQ(moveToLid, _handler->_moveToLid); 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 7345a07cd27..de583c0b36d 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 @@ -233,7 +233,7 @@ CompactionJob::run() if (shouldRestartScanDocuments(stats)) { _scanItr = _handler->getIterator(); } else { - _scanItr = IDocumentScanIterator::UP(); + _scanItr.reset(); _shouldCompactLidSpace = true; return false; } |