diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-14 17:01:58 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-14 17:01:58 +0000 |
commit | 66e66d08e509a4eabf394442bcd7e733e228fb25 (patch) | |
tree | e9aa07ff8e2debfc93c5e430377848779b315cd5 /searchcore/src/tests/proton/documentdb/lid_space_compaction | |
parent | 76b1a42ae483ae66a2d1e43ef749f41661754e1c (diff) |
When making callbacks like notifying about new bucket show the gurad that is held.
Then this guard can used instead of possibly making a deadlock if trying to take it yourself.
Diffstat (limited to 'searchcore/src/tests/proton/documentdb/lid_space_compaction')
3 files changed, 5 insertions, 4 deletions
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp index b9bb6a7c801..5a68e46c57e 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp @@ -213,7 +213,7 @@ MyDocumentRetriever::parseSelect(const vespalib::string&) const { abort(); } -MySubDb::MySubDb(std::shared_ptr<BucketDBOwner> bucket_db, const MyDocumentStore& store, const std::shared_ptr<const DocumentTypeRepo> & repo) +MySubDb::MySubDb(std::shared_ptr<bucketdb::BucketDBOwner> bucket_db, const MyDocumentStore& store, const std::shared_ptr<const DocumentTypeRepo> & repo) : sub_db(std::move(bucket_db), SUBDB_ID), maintenance_sub_db(sub_db.getName(), sub_db.getSubDbId(), sub_db.getDocumentMetaStoreContext().getSP(), std::make_shared<MyDocumentRetriever>(repo, store), diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h index ec34c0fd5a7..9ef96762e2d 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h @@ -140,6 +140,6 @@ struct MySubDb { test::DummyDocumentSubDb sub_db; MaintenanceDocumentSubDB maintenance_sub_db; PendingLidTracker _pendingLidsForCommit; - MySubDb(std::shared_ptr<BucketDBOwner> bucket_db, const MyDocumentStore& store, const std::shared_ptr<const DocumentTypeRepo> & repo); + MySubDb(std::shared_ptr<bucketdb::BucketDBOwner> bucket_db, const MyDocumentStore& store, const std::shared_ptr<const DocumentTypeRepo> & repo); ~MySubDb(); }; diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp index 993cb9226c5..2ca1101ac3a 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp @@ -1,11 +1,12 @@ // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "lid_space_common.h" +#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h> #include <vespa/vespalib/gtest/gtest.h> struct HandlerTest : public ::testing::Test { DocBuilder _docBuilder; - std::shared_ptr<BucketDBOwner> _bucketDB; + std::shared_ptr<bucketdb::BucketDBOwner> _bucketDB; MyDocumentStore _docStore; MySubDb _subDb; LidSpaceCompactionHandler _handler; @@ -15,7 +16,7 @@ struct HandlerTest : public ::testing::Test { HandlerTest::HandlerTest() : _docBuilder(Schema()), - _bucketDB(std::make_shared<BucketDBOwner>()), + _bucketDB(std::make_shared<bucketdb::BucketDBOwner>()), _docStore(), _subDb(_bucketDB, _docStore, _docBuilder.getDocumentTypeRepo()), _handler(_subDb.maintenance_sub_db, "test") |