Skip to content

Conversation

@JacksonYao287
Copy link
Contributor

@JacksonYao287 JacksonYao287 commented Nov 19, 2024

in nuobject, when a member is moved out of a raft group, we should clear the pg related resource in the member , which will be done in the config change handler. this PR aims to add this interface, which is also helpful for other use case to reclaim their application layer resource

@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 54.28571% with 16 lines in your changes missing coverage. Please review.

Project coverage is 66.60%. Comparing base (1a0cef8) to head (73bd8c2).
Report is 94 commits behind head on master.

Files with missing lines Patch % Lines
src/lib/blkalloc/append_blk_allocator.cpp 0.00% 5 Missing ⚠️
src/lib/replication/repl_dev/raft_repl_dev.cpp 60.00% 4 Missing ⚠️
src/include/homestore/replication/repl_dev.h 0.00% 1 Missing ⚠️
src/lib/blkalloc/bitmap_blk_allocator.h 0.00% 1 Missing ⚠️
src/lib/blkalloc/fixed_blk_allocator.h 0.00% 1 Missing ⚠️
src/lib/blkalloc/varsize_blk_allocator.h 0.00% 1 Missing ⚠️
src/lib/device/vchunk.cpp 0.00% 1 Missing ⚠️
...rc/lib/replication/repl_dev/raft_state_machine.cpp 91.66% 0 Missing and 1 partial ⚠️
src/lib/replication/repl_dev/solo_repl_dev.h 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #594       +/-   ##
===========================================
+ Coverage   56.51%   66.60%   +10.09%     
===========================================
  Files         108      109        +1     
  Lines       10300    10772      +472     
  Branches     1402     1472       +70     
===========================================
+ Hits         5821     7175     +1354     
+ Misses       3894     2893     -1001     
- Partials      585      704      +119     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Collaborator

@xiaoxichen xiaoxichen left a comment

Choose a reason for hiding this comment

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

I think we need more evidence to expose the "raft implementation details" to HO.
As the raft_cluster_config_ptr_t is a ptr to nuraft::cluster_config which is very much implementation related structure.

I think the interpretation should be in HS and call back to listener with specific callback, like on_joining_cluster, on_leaving_cluster, etc.

@JacksonYao287
Copy link
Contributor Author

JacksonYao287 commented Nov 21, 2024

like on_joining_cluster, on_leaving_cluster

this is a good suggestion, will make this change

@xiaoxichen
Copy link
Collaborator

@JacksonYao287
Copy link
Contributor Author

JacksonYao287 commented Nov 21, 2024

more callback type can be consumed from handle_raft_event

1 in this PR , I only want to handle the leave cluster case. we can create another PR for join cluster case

2 RemovedFromCluster callback will be called before the new configuration is applied , IMO, it is better to call it after the new configuration is applied, where we can guarantee the config changed is completed and the node is definitely removed from the cluster configuration

// 2 well , leave_cluster will propose a config change log, when this log is committed, this node will be removed
// from the cluster configuration. so, this callback will only be called on the removed node, which is no longer in
// the cluster configuration
virtual void on_leave_cluster(const group_id_t& group_id){
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason we can't bump conan version to 6.6 and make this pure virtual function, and when make HomeObject PR, consume 6.6 homestore to consume this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the only concern is that before homeobject implements this function, all other PR of homeobject will get a build failure in CI build.

@JacksonYao287 JacksonYao287 changed the title handle config change event in statemachine handle leave cluster event Nov 25, 2024
@xiaoxichen
Copy link
Collaborator

xiaoxichen commented Nov 25, 2024

I hope the commits and commit message can be cleanup , there are two parts in this PR:

  1. consume nuraft::cb_func::Type::RemovedFromCluster callback
  2. add reset function to allocator/vchunk as a preparation for implementing m_listener->on_destroy()

The pr title/commit messages are a bit confusing.

@JacksonYao287
Copy link
Contributor Author

The pr title/commit messages are a bit confusing.

sure, will refine this commit message

1 consume nuraft::cb_func::Type::RemovedFromCluster callback
2 add reset function to allocator/vchunk as a preparation for implementing m_listener->on_destroy()
Copy link
Collaborator

@xiaoxichen xiaoxichen left a comment

Choose a reason for hiding this comment

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

lgtm

@JacksonYao287 JacksonYao287 merged commit 1a87f71 into eBay:master Nov 25, 2024
@JacksonYao287 JacksonYao287 deleted the handle-config-change branch November 25, 2024 08:00
hkadayam pushed a commit to hkadayam/HomeStore that referenced this pull request Aug 7, 2025
1 consume nuraft::cb_func::Type::RemovedFromCluster callback
2 add reset function to allocator/vchunk as a preparation for implementing m_listener->on_destroy()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants