summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2018-11-16 16:07:16 +0100
committerGitHub <noreply@github.com>2018-11-16 16:07:16 +0100
commit2ae6038eae0b7f9af5dcdb28a0813d0ccbd8a44b (patch)
tree0167e278b4d7221b2efb44b91a6cbc15325c6cff
parentcae7456c12e1bd3d22c0900772f9e53d1c14b2d5 (diff)
parent106e612a3f720e65325a8b66348c2248013c92a5 (diff)
Merge pull request #7682 from vespa-engine/geirst/update-attribute-status-before-exclusive-read-access
Ensure attribute status is updated before giving exclusive read access.
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp
index d1d5b1c9af7..7a31580fb16 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp
@@ -37,8 +37,9 @@ ExclusiveAttributeReadAccessor(const AttributeVector::SP &attribute,
namespace {
void
-attributeWriteBlockingTask(GateSP entranceGate, GateSP exitGate)
+attributeWriteBlockingTask(AttributeVector::SP attribute, GateSP entranceGate, GateSP exitGate)
{
+ attribute->commit(true);
entranceGate->countDown();
exitGate->await();
}
@@ -51,7 +52,7 @@ ExclusiveAttributeReadAccessor::takeGuard()
GateSP entranceGate = std::make_shared<Gate>();
GateSP exitGate = std::make_shared<Gate>();
_attributeFieldWriter.execute(_attributeFieldWriter.getExecutorId(_attribute->getNamePrefix()),
- [entranceGate, exitGate]() { attributeWriteBlockingTask(entranceGate, exitGate); });
+ [this, entranceGate, exitGate]() { attributeWriteBlockingTask(_attribute, entranceGate, exitGate); });
entranceGate->await();
return std::make_unique<Guard>(*_attribute, exitGate);
}