diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-03 21:54:01 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-03 21:54:01 +0000 |
commit | e278469ad6d752da7e33228d0a78a6f02b29ffbb (patch) | |
tree | 84f06ed9f5318214f37f4adc5c48a3bd2140bc27 | |
parent | 898e521641f2881136d405d0ceab5530af0f4448 (diff) |
Modify applyCommit to commit without updating synctoken if too early.
3 files changed, 7 insertions, 4 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp index e40e93a7be2..683a6cd1197 100644 --- a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp @@ -81,7 +81,7 @@ struct Fixture _pop(), _ctx() { - _mgr->addAttribute({ "a1", AVConfig(AVBasicType::INT32)}, 0); + _mgr->addAttribute({ "a1", AVConfig(AVBasicType::INT32)}, CREATE_SERIAL_NUM); _pop = std::make_unique<AttributePopulator>(_mgr, 1, "test", CREATE_SERIAL_NUM); } AttributeGuard::UP getAttr() { diff --git a/searchcore/src/tests/proton/attribute/document_field_populator/document_field_populator_test.cpp b/searchcore/src/tests/proton/attribute/document_field_populator/document_field_populator_test.cpp index a684f24f20d..4fd8b4208da 100644 --- a/searchcore/src/tests/proton/attribute/document_field_populator/document_field_populator_test.cpp +++ b/searchcore/src/tests/proton/attribute/document_field_populator/document_field_populator_test.cpp @@ -1,8 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP("document_field_populator_test"); -#include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/testkit/testapp.h> #include <vespa/searchcommon/common/schema.h> #include <vespa/searchcore/proton/attribute/document_field_populator.h> #include <vespa/searchlib/attribute/attributefactory.h> @@ -10,6 +8,9 @@ LOG_SETUP("document_field_populator_test"); #include <vespa/searchlib/index/docbuilder.h> #include <vespa/vespalib/util/stringfmt.h> +#include <vespa/log/log.h> +LOG_SETUP("document_field_populator_test"); + using namespace document; using namespace proton; using namespace search; diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp index 71a4eddbb08..28eeb541a13 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp @@ -214,6 +214,8 @@ applyCommit(SerialNum serialNum, AttributeWriter::OnWriteDoneType , AttributeVec if (attr.getStatus().getLastSyncToken() <= serialNum) { if (serialNum > attr.getCreateSerialNum()) { attr.commit(serialNum, serialNum); + } else { + attr.commit(); } } } |