Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatbuffer for baseline resync #170

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

class HomeObjectConan(ConanFile):
name = "homeobject"
version = "2.0.1"
version = "3.1.1"

homepage = "https://github.com/eBay/HomeObject"
description = "Blob Store built on HomeReplication"
topics = ("ebay")
Expand Down Expand Up @@ -40,7 +41,7 @@ def build_requirements(self):
self.build_requires("gtest/1.14.0")

def requirements(self):
self.requires("homestore/[~6.2, include_prerelease=True]@oss/master")
self.requires("homestore/[~6.3, include_prerelease=True]@oss/master")
self.requires("sisl/[~12.1, include_prerelease=True]@oss/master")
self.requires("lz4/1.9.4", override=True)

Expand Down
2 changes: 2 additions & 0 deletions src/lib/homestore_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ settings_gen_cpp(
${CMAKE_CURRENT_BINARY_DIR}/generated/
"${PROJECT_NAME}_homestore"
hs_backend_config.fbs
resync_pg_shard.fbs
resync_blob_data.fbs
)

if(BUILD_TESTING)
Expand Down
7 changes: 7 additions & 0 deletions src/lib/homestore_backend/replication_state_machine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ class ReplicationStateMachine : public homestore::ReplDevListener {
/// @brief Called when the replica set is being stopped
void on_replica_stop() override;

/// @brief Called when the snapshot is being created.
/// @param snapshot - The snapshot object which contains the lsn and term;
homestore::AsyncReplResult<> create_snapshot(homestore::repl_snapshot&) override {
// To be implemented;
return folly::makeSemiFuture< homestore::ReplResult< folly::Unit > >(folly::Unit{});
}

private:
HSHomeObject* home_object_{nullptr};
};
Expand Down
16 changes: 16 additions & 0 deletions src/lib/homestore_backend/resync_blob_data.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace homeobject;

table BlobData {
shard_id : uint64;
yamingk marked this conversation as resolved.
Show resolved Hide resolved
blob_id : uint64;
user_key_size : uint32;
data_size : uint32;
user_key : [ubyte];
data : [ubyte];
yamingk marked this conversation as resolved.
Show resolved Hide resolved
}

table ResyncBlobDataBatch {
data_array : [BlobData];
}

root_type ResyncBlobDataBatch;
29 changes: 29 additions & 0 deletions src/lib/homestore_backend/resync_pg_shard.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace homeobject;

table Member {
uuid : [ubyte];
name : [ubyte];
}
yamingk marked this conversation as resolved.
Show resolved Hide resolved

table PGInfoEntry {
yamingk marked this conversation as resolved.
Show resolved Hide resolved
pg_id : uint32; // only low 16 bit is used for pg_id;
priority : int32; // pg priority;
replica_set_uuid : [ubyte]; // uuid of replica set
members : [Member]; // peers;
yamingk marked this conversation as resolved.
Show resolved Hide resolved
}

table ShardInfoEntry {
state : ubyte; // shard state;
pg_id : uint32; // pg id which this shard belongs to;
yamingk marked this conversation as resolved.
Show resolved Hide resolved
shard_id : uint64; // shard id to be created with;
shard_size : uint64; // shard size;
created_time : uint64; // shard creation time
last_modified_time : uint64; // shard last modify time
}

table ResyncPGShardInfo {
pg : PGInfoEntry;
shards : [ShardInfoEntry];
}

root_type ResyncPGShardInfo;