diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2020-10-14 13:43:08 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2020-10-16 09:58:46 +0000 |
commit | 08e49539165ac2893002102c84395166e70dd727 (patch) | |
tree | 3dd32b258c1ca8ee475ce1b2bd6a41f658a6a15f /storage/src/tests/common | |
parent | adac8d147c27cc80315dd8447a5a3280ab804049 (diff) |
Greatly simplify bucket DB persistence provider bootstrap procedure
The legacy bucket DB initialization logic was designed for the case
where bucket information was spread across potentially millions of
files residing on spinning rust drives. It was therefore async and
running in parallel with client operations, adding much complexity
in order to deal with a myriad of concurrency edge cases.
Replace this with a very simple, synchronous init method that expects the
provider to have the required information readily and cheaply available.
This effectively removes the concept of a node's "initializing" state,
moving directly from reported state Down to Up.
Even though a node still technically starts up in Initializing state,
we never end up reporting this to the Cluster Controller as the DB init
completes before the RPC server stack is set up.
Legacy bucket DB initializer code will be removed in a separate pass.
Also simplify bucket DB interface contract for mutating iteration,
indicating that it is done in an unspecified order.
Diffstat (limited to 'storage/src/tests/common')
-rw-r--r-- | storage/src/tests/common/teststorageapp.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/storage/src/tests/common/teststorageapp.h b/storage/src/tests/common/teststorageapp.h index 54668cac515..ffb16f3646a 100644 --- a/storage/src/tests/common/teststorageapp.h +++ b/storage/src/tests/common/teststorageapp.h @@ -43,7 +43,7 @@ DEFINE_PRIMITIVE_WRAPPER(uint16_t, Redundancy); class TestStorageApp : public framework::defaultimplementation::TestComponentRegister, - private DoneInitializeHandler + public DoneInitializeHandler { StorageComponentRegisterImpl& _compReg; @@ -100,10 +100,11 @@ public: private: // Storage server interface implementation (until we can remove it) - virtual api::Timestamp getUniqueTimestamp() { assert(0); throw; } - virtual StorBucketDatabase& getStorageBucketDatabase() { assert(0); throw; } - virtual BucketDatabase& getBucketDatabase() { assert(0); throw; } - virtual uint16_t getDiskCount() const { assert(0); throw; } + virtual api::Timestamp getUniqueTimestamp() { abort(); } + [[nodiscard]] virtual StorBucketDatabase& content_bucket_db(document::BucketSpace) { abort(); } + virtual StorBucketDatabase& getStorageBucketDatabase() { abort(); } + virtual BucketDatabase& getBucketDatabase() { abort(); } + virtual uint16_t getDiskCount() const { abort(); } }; class TestServiceLayerApp : public TestStorageApp @@ -125,6 +126,10 @@ public: spi::PersistenceProvider& getPersistenceProvider(); + StorBucketDatabase& content_bucket_db(document::BucketSpace space) override { + return _compReg.getBucketSpaceRepo().get(space).bucketDatabase(); + } + StorBucketDatabase& getStorageBucketDatabase() override { return _compReg.getBucketSpaceRepo().get(document::FixedBucketSpaces::default_space()).bucketDatabase(); } |