Skip to content

Commit 2e63ecf

Browse files
koujlxiaoxichen
authored andcommitted
Fix v1_ShardInfo mem layout
v1_ShardInfo should have the same byte alignment as ShardInfo struct.
1 parent 8c8fccf commit 2e63ecf

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class HomeObjectConan(ConanFile):
1212
name = "homeobject"
13-
version = "4.0.7"
13+
version = "4.0.8"
1414

1515
homepage = "https://github.com/eBay/HomeObject"
1616
description = "Blob Store built on HomeStore"

src/lib/homestore_backend/hs_homeobject.hpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,21 @@ class HSHomeObject : public HomeObjectImpl {
9595
std::vector< shard_id_t > shards_to_migrate_;
9696

9797
public:
98+
// Old version shard_info_superblk (v0.01) - for backward compatibility testing and migration
99+
// v1 ShardInfo did not have the meta field
100+
struct v1_ShardInfo {
101+
shard_id_t id;
102+
pg_id_t placement_group;
103+
ShardInfo::State state;
104+
uint64_t lsn;
105+
uint64_t created_time;
106+
uint64_t last_modified_time;
107+
uint64_t available_capacity_bytes;
108+
uint64_t total_capacity_bytes;
109+
std::optional< peer_id_t > current_leader{std::nullopt};
110+
// Note: meta field was added in v2
111+
};
112+
98113
#pragma pack(1)
99114
struct pg_members {
100115
peer_id_t id;
@@ -193,21 +208,6 @@ class HSHomeObject : public HomeObjectImpl {
193208
bool valid() const { return DataHeader::valid() && sb_version <= shard_sb_version; }
194209
};
195210

196-
// Old version shard_info_superblk (v0.01) - for backward compatibility testing and migration
197-
// v1 ShardInfo did not have the meta field
198-
struct v1_ShardInfo {
199-
shard_id_t id;
200-
pg_id_t placement_group;
201-
ShardInfo::State state;
202-
uint64_t lsn;
203-
uint64_t created_time;
204-
uint64_t last_modified_time;
205-
uint64_t available_capacity_bytes;
206-
uint64_t total_capacity_bytes;
207-
std::optional< peer_id_t > current_leader{std::nullopt};
208-
// Note: meta field was added in v2
209-
};
210-
211211
struct v1_shard_info_superblk : DataHeader {
212212
v1_ShardInfo info;
213213
homestore::chunk_num_t p_chunk_id{0};

0 commit comments

Comments
 (0)