aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-01-23 22:00:01 +0100
committerGitHub <noreply@github.com>2021-01-23 22:00:01 +0100
commitfa4ba96f1ebb4d2e544ff0a8e5d9cc6c3a693f78 (patch)
tree2b3a1e84d51a35b529982ffec9699d663fb8b298 /searchcore/src/tests
parent0d43351fa8c26eb7d319c0da6a7867d431f0c50e (diff)
Revert "Revert "Wire in the BucketExecutor.""
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp5
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdb_test.cpp22
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp10
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h2
-rw-r--r--searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp12
5 files changed, 29 insertions, 22 deletions
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index e84cf338bcd..38e5e08ec02 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -25,6 +25,7 @@
#include <vespa/searchcore/proton/server/searchview.h>
#include <vespa/searchcore/proton/server/summaryadapter.h>
#include <vespa/searchcore/proton/matching/querylimiter.h>
+#include <vespa/persistence/dummyimpl/dummy_bucket_executor.h>
#include <vespa/vespalib/util/destructor_callbacks.h>
#include <vespa/searchlib/engine/docsumapi.h>
#include <vespa/searchlib/index/docbuilder.h>
@@ -173,6 +174,7 @@ public:
DummyFileHeaderContext _fileHeaderContext;
TransLogServer _tls;
vespalib::ThreadStackExecutor _summaryExecutor;
+ storage::spi::dummy::DummyBucketExecutor _bucketExecutor;
bool _mkdirOk;
matching::QueryLimiter _queryLimiter;
vespalib::Clock _clock;
@@ -192,6 +194,7 @@ public:
_fileHeaderContext(),
_tls("tmp", 9013, ".", _fileHeaderContext),
_summaryExecutor(8, 128*1024),
+ _bucketExecutor(2),
_mkdirOk(FastOS_File::MakeDirectory("tmpdb")),
_queryLimiter(),
_clock(),
@@ -219,7 +222,7 @@ public:
}
_ddb = std::make_unique<DocumentDB>("tmpdb", _configMgr.getConfig(), "tcp/localhost:9013", _queryLimiter, _clock,
DocTypeName(docTypeName), makeBucketSpace(), *b->getProtonConfigSP(), *this,
- _summaryExecutor, _summaryExecutor, _tls, _dummy, _fileHeaderContext,
+ _summaryExecutor, _summaryExecutor, _bucketExecutor, _tls, _dummy, _fileHeaderContext,
std::make_unique<MemoryConfigStore>(),
std::make_shared<vespalib::ThreadStackExecutor>(16, 128 * 1024), _hwInfo),
_ddb->start();
diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
index 4064fc24105..91046fbb567 100644
--- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
@@ -19,6 +19,7 @@
#include <vespa/searchcore/proton/server/document_db_explorer.h>
#include <vespa/searchcore/proton/server/documentdbconfigmanager.h>
#include <vespa/searchcore/proton/server/memoryconfigstore.h>
+#include <vespa/persistence/dummyimpl/dummy_bucket_executor.h>
#include <vespa/searchcorespi/index/indexflushtarget.h>
#include <vespa/searchlib/attribute/attribute_read_guard.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
@@ -69,6 +70,7 @@ struct Fixture {
MyDBOwner _myDBOwner;
vespalib::ThreadStackExecutor _summaryExecutor;
HwInfo _hwInfo;
+ storage::spi::dummy::DummyBucketExecutor _bucketExecutor;
DocumentDB::SP _db;
DummyFileHeaderContext _fileHeaderContext;
TransLogServer _tls;
@@ -84,31 +86,31 @@ Fixture::Fixture()
_myDBOwner(),
_summaryExecutor(8, 128*1024),
_hwInfo(),
+ _bucketExecutor(2),
_db(),
_fileHeaderContext(),
_tls("tmp", 9014, ".", _fileHeaderContext),
_queryLimiter(),
_clock()
{
- DocumentDBConfig::DocumenttypesConfigSP documenttypesConfig(new DocumenttypesConfig());
+ auto documenttypesConfig = std::make_shared<DocumenttypesConfig>();
DocumentType docType("typea", 0);
- std::shared_ptr<const DocumentTypeRepo> repo(new DocumentTypeRepo(docType));
- TuneFileDocumentDB::SP tuneFileDocumentDB(new TuneFileDocumentDB);
+ auto repo = std::make_shared<DocumentTypeRepo>(docType);
+ auto tuneFileDocumentDB = std::make_shared<TuneFileDocumentDB>();
config::DirSpec spec(TEST_PATH("cfg"));
DocumentDBConfigHelper mgr(spec, "typea");
- BootstrapConfig::SP
- b(new BootstrapConfig(1, documenttypesConfig, repo,
+ auto b = std::make_shared<BootstrapConfig>(1, documenttypesConfig, repo,
std::make_shared<ProtonConfig>(),
std::make_shared<FiledistributorrpcConfig>(),
std::make_shared<BucketspacesConfig>(),
- tuneFileDocumentDB, HwInfo()));
+ tuneFileDocumentDB, HwInfo());
mgr.forwardConfig(b);
mgr.nextGeneration(0ms);
- _db.reset(new DocumentDB(".", mgr.getConfig(), "tcp/localhost:9014", _queryLimiter, _clock, DocTypeName("typea"),
+ _db = std::make_shared<DocumentDB>(".", mgr.getConfig(), "tcp/localhost:9014", _queryLimiter, _clock, DocTypeName("typea"),
makeBucketSpace(),
- *b->getProtonConfigSP(), _myDBOwner, _summaryExecutor, _summaryExecutor, _tls, _dummy,
- _fileHeaderContext, ConfigStore::UP(new MemoryConfigStore),
- std::make_shared<vespalib::ThreadStackExecutor>(16, 128 * 1024), _hwInfo));
+ *b->getProtonConfigSP(), _myDBOwner, _summaryExecutor, _summaryExecutor, _bucketExecutor, _tls, _dummy,
+ _fileHeaderContext, std::make_unique<MemoryConfigStore>(),
+ std::make_shared<vespalib::ThreadStackExecutor>(16, 128 * 1024), _hwInfo);
_db->start();
_db->waitForOnlineState();
}
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 926530c228e..af8086941fd 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
@@ -46,23 +46,27 @@ JobTestBase::init(uint32_t allowedLidBloat,
{
_handler = std::make_unique<MyHandler>(maxOutstandingMoveOps != MAX_OUTSTANDING_MOVE_OPS, useBucketDB());
DocumentDBLidSpaceCompactionConfig compactCfg(interval, allowedLidBloat, allowedLidBloatFactor,
- REMOVE_BATCH_BLOCK_RATE, REMOVE_BLOCK_RATE, false);
+ REMOVE_BATCH_BLOCK_RATE, REMOVE_BLOCK_RATE, false, useBucketDB());
BlockableMaintenanceJobConfig blockableCfg(resourceLimitFactor, maxOutstandingMoveOps);
if (useBucketDB()) {
+ _singleExecutor = std::make_unique<vespalib::ThreadStackExecutor>(1, 0x10000);
+ _master = std::make_unique<proton::ExecutorThreadService> (*_singleExecutor);
_bucketExecutor = std::make_unique<storage::spi::dummy::DummyBucketExecutor>(4);
- _job = std::make_unique<lidspace::CompactionJob>(compactCfg, *_handler, _storer, *_bucketExecutor, _diskMemUsageNotifier,
- blockableCfg, _clusterStateHandler, nodeRetired,
+ _job = std::make_unique<lidspace::CompactionJob>(compactCfg, *_handler, _storer, *_master, *_bucketExecutor,
+ _diskMemUsageNotifier, blockableCfg, _clusterStateHandler, nodeRetired,
document::BucketSpace::placeHolder());
} else {
_job = std::make_unique<LidSpaceCompactionJob>(compactCfg, *_handler, _storer, _frozenHandler, _diskMemUsageNotifier,
blockableCfg, _clusterStateHandler, nodeRetired);
}
}
+
void
JobTestBase::sync() const {
if (_bucketExecutor) {
_bucketExecutor->sync();
+ _master->sync();
}
}
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h
index 637314e2879..c81f8c8d387 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h
+++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h
@@ -7,6 +7,8 @@
struct JobTestBase : public ::testing::TestWithParam<bool> {
std::unique_ptr<storage::spi::BucketExecutor> _bucketExecutor;
+ std::unique_ptr<vespalib::SyncableThreadExecutor> _singleExecutor;
+ std::unique_ptr<searchcorespi::index::IThreadService> _master;
std::unique_ptr<MyHandler> _handler;
MyStorer _storer;
MyFrozenBucketHandler _frozenHandler;
diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
index d6fddf16659..ab447d5d38f 100644
--- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
@@ -862,14 +862,10 @@ void
MaintenanceControllerFixture::injectMaintenanceJobs()
{
if (_injectDefaultJobs) {
- MaintenanceJobsInjector::injectJobs(_mc, *_mcCfg, _fh, _gsp,
- _lscHandlers, _fh, _mc, _bucketCreateNotifier, _docTypeName.getName(), makeBucketSpace(),
- _fh, _fh, _bmc, _clusterStateHandler, _bucketHandler,
- _calc,
- _diskMemUsageNotifier,
- _jobTrackers,
- _readyAttributeManager,
- _notReadyAttributeManager,
+ MaintenanceJobsInjector::injectJobs(_mc, *_mcCfg, _bucketExecutor, _fh, _gsp, _lscHandlers, _fh, _mc,
+ _bucketCreateNotifier, _docTypeName.getName(), makeBucketSpace(), _fh, _fh,
+ _bmc, _clusterStateHandler, _bucketHandler, _calc, _diskMemUsageNotifier,
+ _jobTrackers, _readyAttributeManager, _notReadyAttributeManager,
std::make_unique<const AttributeConfigInspector>(AttributesConfigBuilder()),
std::make_shared<TransientMemoryUsageProvider>(),
_attributeUsageFilter);