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

Issue: 498 meta service long run fix #523

Merged
merged 4 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomestoreConan(ConanFile):
name = "homestore"
version = "6.4.51"
version = "6.4.52"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
3 changes: 3 additions & 0 deletions src/lib/device/chunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class Chunk {
uint32_t m_vdev_ordinal{0};
shared< BlkAllocator > m_blk_allocator;

public:
static constexpr auto MAX_CHUNK_SIZE = std::numeric_limits< uint32_t >::max();

public:
friend class DeviceManager;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/device/device_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ shared< VirtualDev > DeviceManager::create_vdev(vdev_parameters&& vparam) {
if (vparam.num_chunks != 0) {
auto input_num_chunks = vparam.num_chunks;
// max chunk size is 4GB (uint32_max), capping it by tune up num_chunks
uint32_t min_num_chunks = (vparam.vdev_size - 1) / std::numeric_limits< uint32_t >::max() + 1;
uint32_t min_num_chunks = (vparam.vdev_size - 1) / Chunk::MAX_CHUNK_SIZE + 1;
vparam.num_chunks = std::max(vparam.num_chunks, min_num_chunks);
vparam.num_chunks = std::min(vparam.num_chunks, max_num_chunks);

Expand Down
3 changes: 2 additions & 1 deletion src/lib/device/virtual_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ BlkAllocStatus VirtualDev::commit_blk(BlkId const& blkid) {
HS_LOG(DEBUG, device, "commit_blk: bid {}", blkid.to_string());
auto const recovering = homestore::hs()->is_initializing();
if (!recovering) {
HS_DBG_ASSERT(is_blk_alloced(blkid), "commiting blkid {} is not allocated in non-recovery mode",
// in non-recovery mode, if a blk is committed without allocating, it will cause data corruption
HS_REL_ASSERT(is_blk_alloced(blkid), "commiting blkid {} is not allocated in non-recovery mode",
blkid.to_string());
} else {
chunk->blk_allocator_mutable()->reserve_on_cache(blkid);
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_scripts/log_meta_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def meta_nightly(options, addln_opts):
subprocess.check_call(options.dirpath + "test_meta_blk_mgr " + cmd_opts + addln_opts, stderr=subprocess.STDOUT,
shell=True)

cmd_opts = "--min_write_size=10485760 --max_write_size=104857600 --bitmap=1"
cmd_opts = "--min_write_size=10485760 --max_write_size=80857600 --bitmap=1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 80857600, is it upper limit of total nblks in the portion ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it is a little smaller than the upper limit.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI: it translate to 2.4TB if blk size = 4K when storing bit map:)

But maybe we are looking for 10x of this or even more.

Copy link
Contributor Author

@yamingk yamingk Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @xiaoxichen for bring it up. My thought is to change the chunk-size to uint64_t, and each chunk can have larger size, key thing here is we don't persist the whole data blkstore in one bitmap, we persist per blkallocator instance which is per chunk. So the bitmap size will be mapping to how much the chunk size is.

Another thing is metablkstore has compression feature so the bitmap can be significantly compressed before written.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok if it is per allocator then we are good?

Copy link
Contributor Author

@yamingk yamingk Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we are good as in nublox bitmap. We only update bitmap meta blks when specific chunk is dirtied. Undirtied chunk's bitmap is untouched.

subprocess.check_call(options.dirpath + "test_meta_blk_mgr " + cmd_opts + addln_opts, stderr=subprocess.STDOUT,
shell=True)

Expand Down
Loading