summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2021-11-16 15:32:12 +0100
committerTor Egge <Tor.Egge@online.no>2021-11-16 15:32:12 +0100
commit3c45d95db5243a9103e216d2722815b59e2007f2 (patch)
treee0205956409f4cfed7877acd755a33ec1ee896c2 /searchcore
parent4b155495f7d05176364ccfb86b12f2a7ac1f37cf (diff)
Prepare for rewrite of feed view drop.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.cpp27
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.h1
2 files changed, 7 insertions, 21 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
index ccfdb3b9b36..109571296ec 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
@@ -186,7 +186,6 @@ DocumentDB::DocumentDB(const vespalib::string &baseDir,
_metricsHook(std::make_unique<MetricsUpdateHook>(*this)),
_feedView(),
_refCount(),
- _syncFeedViewEnabled(false),
_owner(owner),
_bucketExecutor(bucketExecutor),
_state(),
@@ -313,9 +312,9 @@ void
DocumentDB::initFinish(DocumentDBConfig::SP configSnapshot)
{
// Called by executor thread
+ assert(_writeService.master().isCurrentThread());
_bucketHandler.setReadyBucketHandler(_subDBs.getReadySubDB()->getDocumentMetaStoreContext().get());
_subDBs.initViews(*configSnapshot, _sessionManager);
- _syncFeedViewEnabled = true;
syncFeedView();
// Check that feed view has been activated.
assert(_feedView.get());
@@ -510,20 +509,11 @@ DocumentDB::applyConfig(DocumentDBConfig::SP configSnapshot, SerialNum serialNum
}
-namespace {
-void
-doNothing(IFeedView::SP)
-{
- // Called by index executor, delays when feed view is dropped.
-}
-} // namespace
-
void
DocumentDB::performDropFeedView(IFeedView::SP feedView)
{
- // Called by executor task, delays when feed view is dropped.
- // Also called by DocumentDB::receive() method to keep feed view alive
-
+ // Delays when feed view is dropped.
+ assert(_writeService.master().isCurrentThread());
_writeService.attributeFieldWriter().sync_all();
_writeService.summary().sync();
@@ -534,11 +524,11 @@ DocumentDB::performDropFeedView(IFeedView::SP feedView)
void
DocumentDB::performDropFeedView2(IFeedView::SP feedView) {
- // Called by executor task, delays when feed view is dropped.
- // Also called by DocumentDB::receive() method to keep feed view alive
+ // Delays when feed view is dropped.
+ assert(_writeService.index().isCurrentThread());
_writeService.indexFieldInverter().sync_all();
_writeService.indexFieldWriter().sync_all();
- masterExecute([feedView]() { doNothing(feedView); });
+ masterExecute([feedView]() { (void) feedView; });
}
@@ -912,10 +902,7 @@ DocumentDB::getActiveGeneration() const {
void
DocumentDB::syncFeedView()
{
- // Called by executor or while in rendezvous with executor
-
- if (!_syncFeedViewEnabled)
- return;
+ assert(_writeService.master().isCurrentThread());
IFeedView::SP oldFeedView(_feedView.get());
IFeedView::SP newFeedView(_subDBs.getFeedView());
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.h b/searchcore/src/vespa/searchcore/proton/server/documentdb.h
index 014bba11f83..6b855cd40a8 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.h
@@ -112,7 +112,6 @@ private:
std::unique_ptr<metrics::UpdateHook> _metricsHook;
vespalib::VarHolder<IFeedView::SP> _feedView;
vespalib::MonitoredRefCount _refCount;
- bool _syncFeedViewEnabled;
IDocumentDBOwner &_owner;
storage::spi::BucketExecutor &_bucketExecutor;
DDBState _state;