diff options
3 files changed, 15 insertions, 35 deletions
diff --git a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp index 1c2d903fead..4446d316d23 100644 --- a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp +++ b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp @@ -241,11 +241,6 @@ struct FixtureBase { } template <typename FunctionType> - void runInMasterAndSyncAll(FunctionType func) { - test::runInMaster(writeService, func); - writeService.sync_all_executors(); - } - template <typename FunctionType> void runInMasterAndSync(FunctionType func) { test::runInMasterAndSync(writeService, func); } @@ -288,6 +283,18 @@ struct MoveFixture : public FixtureBase<MoveOperationFeedView> { feedview->clearWriteDoneContexts(); EXPECT_EQUAL(0, outstandingMoveOps); } + + void handleMove(const MoveOperation & op) { + auto ctx = beginMoveOp(); + runInMasterAndSync([&, ctx]() { + feedview->handleMove(op, std::move(ctx)); + }); + while (ctx.use_count() > 2) { + LOG(info, "use_count = %ld", ctx.use_count()); + std::this_thread::sleep_for(1s); + } + ctx.reset(); + } }; TEST_F("require that prepareMove sets target db document id", Fixture) @@ -323,7 +330,7 @@ TEST_F("require that handleMove() adds document to target and removes it from so MoveOperation::UP op = makeMoveOp(DbDocumentId(subdb_id + 1, 1), subdb_id); TEST_DO(f.assertPutCount(0)); f.runInMasterAndSync([&]() { f.feedview->prepareMove(*op); }); - f.runInMasterAndSyncAll([&]() { f.feedview->handleMove(*op, f.beginMoveOp()); }); + f.handleMove(*op); TEST_DO(f.assertPutCount(1)); TEST_DO(f.assertAndClearMoveOp()); lid = op->getDbDocumentId().getLid(); @@ -335,7 +342,7 @@ TEST_F("require that handleMove() adds document to target and removes it from so MoveOperation::UP op = makeMoveOp(DbDocumentId(subdb_id, 1), subdb_id + 1); op->setDbDocumentId(DbDocumentId(subdb_id + 1, 1)); TEST_DO(f.assertRemoveCount(0)); - f.runInMasterAndSyncAll([&]() { f.feedview->handleMove(*op, f.beginMoveOp()); }); + f.handleMove(*op); EXPECT_FALSE(f.metaStore->validLid(lid)); TEST_DO(f.assertRemoveCount(1)); TEST_DO(f.assertAndClearMoveOp()); @@ -363,7 +370,7 @@ TEST_F("require that handleMove() handles move within same subdb and propagates op->setTargetLid(1); TEST_DO(f.assertPutCount(0)); TEST_DO(f.assertRemoveCount(0)); - f.runInMasterAndSyncAll([&]() { f.feedview->handleMove(*op, f.beginMoveOp()); }); + f.handleMove(*op); TEST_DO(f.assertPutCount(1)); TEST_DO(f.assertRemoveCount(1)); TEST_DO(f.assertAndClearMoveOp()); diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp index bca8e89d69e..1e3fd5ee158 100644 --- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp @@ -111,14 +111,6 @@ ExecutorThreadingService::ExecutorThreadingService(vespalib::ThreadExecutor& sha ExecutorThreadingService::~ExecutorThreadingService() = default; void -ExecutorThreadingService::sync_all_executors() { - // We have multiple patterns where task A posts to B which post back to A - for (size_t i = 0; i < 2; i++) { - syncOnce(); - } -} - -void ExecutorThreadingService::blocking_master_execute(vespalib::Executor::Task::UP task) { uint32_t limit = master_task_limit(); @@ -129,22 +121,6 @@ ExecutorThreadingService::blocking_master_execute(vespalib::Executor::Task::UP t } void -ExecutorThreadingService::syncOnce() { - bool isMasterThread = _masterService.isCurrentThread(); - if (!isMasterThread) { - _masterExecutor.sync(); - } - _attribute_field_writer_ptr->sync_all(); - _indexExecutor->sync(); - _summaryExecutor->sync(); - _index_field_inverter_ptr->sync_all(); - _index_field_writer_ptr->sync_all(); - if (!isMasterThread) { - _masterExecutor.sync(); - } -} - -void ExecutorThreadingService::shutdown() { _masterExecutor.shutdown().sync(); diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h index e55e95c6745..8040433dbde 100644 --- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h +++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h @@ -36,7 +36,6 @@ private: vespalib::ISequencedTaskExecutor* _attribute_field_writer_ptr; std::vector<Registration> _invokeRegistrations; - void syncOnce(); public: using OptimizeFor = vespalib::Executor::OptimizeFor; /** @@ -51,8 +50,6 @@ public: uint32_t stackSize = 128 * 1024); ~ExecutorThreadingService() override; - void sync_all_executors(); - void blocking_master_execute(vespalib::Executor::Task::UP task) override; void shutdown(); |