summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2017-09-15 13:37:11 +0000
committerTor Egge <Tor.Egge@oath.com>2017-09-15 13:37:11 +0000
commit7456ccb8d5eb033081933a9d3b6d802f5484eb40 (patch)
tree24e6ed6e6ab94da4295d1f88e14448ef0ebab7de
parentbafce1ce01a7043a3017f9f3917fb266e70a253a (diff)
Keep RemoveDoneContext and RemoveBatchDoneDontext live until summary write
has completed.
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
index 489c3fc2591..a853db7427d 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
@@ -392,10 +392,11 @@ void StoreOnlyFeedView::putSummary(SerialNum serialNum, Lid lid, Document::SP do
}));
#pragma GCC diagnostic pop
}
-void StoreOnlyFeedView::removeSummary(SerialNum serialNum, Lid lid) {
+void StoreOnlyFeedView::removeSummary(SerialNum serialNum, Lid lid, OnWriteDoneType onDone) {
_pendingLidTracker.produce(lid);
summaryExecutor().execute(
- makeLambdaTask([serialNum, lid, this] {
+ makeLambdaTask([serialNum, lid, onDone, this] {
+ (void) onDone;
_summaryAdapter->remove(serialNum, lid);
_pendingLidTracker.consume(lid);
}));
@@ -598,11 +599,11 @@ void
StoreOnlyFeedView::internalRemove(FeedToken::UP token, SerialNum serialNum, PendingNotifyRemoveDone &&pendingNotifyRemoveDone, Lid lid,
FeedOperation::Type opType, IDestructorCallback::SP moveDoneCtx)
{
- removeSummary(serialNum, lid);
bool explicitReuseLid = _lidReuseDelayer.delayReuse(lid);
std::shared_ptr<RemoveDoneContext> onWriteDone;
onWriteDone = createRemoveDoneContext(std::move(token), opType, _params._metrics, _writeService.master(),
_metaStore, std::move(pendingNotifyRemoveDone), (explicitReuseLid ? lid : 0u), moveDoneCtx);
+ removeSummary(serialNum, lid, onWriteDone);
bool immediateCommit = _commitTimeTracker.needCommit();
removeAttributes(serialNum, lid, immediateCommit, onWriteDone);
removeIndexedFields(serialNum, lid, immediateCommit, onWriteDone);
@@ -679,7 +680,7 @@ StoreOnlyFeedView::removeDocuments(const RemoveDocumentsOperation &op, bool remo
}
if (useDocumentStore(serialNum + 1)) {
for (const auto &lid : lidsToRemove) {
- removeSummary(serialNum, lid);
+ removeSummary(serialNum, lid, onWriteDone);
}
}
return lidsToRemove.size();
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h
index edb36350ed9..fbc8888ac79 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.h
@@ -158,7 +158,7 @@ private:
}
void putSummary(SerialNum serialNum, Lid lid, FutureStream doc, OnOperationDoneType onDone);
void putSummary(SerialNum serialNum, Lid lid, Document::SP doc, OnOperationDoneType onDone);
- void removeSummary(SerialNum serialNum, Lid lid);
+ void removeSummary(SerialNum serialNum, Lid lid, OnWriteDoneType onDone);
void heartBeatSummary(SerialNum serialNum);