ninsmiracle commented on code in PR #2066:
URL:
https://github.com/apache/incubator-pegasus/pull/2066#discussion_r1689404211
##########
src/meta/duplication/meta_duplication_service.cpp:
##########
@@ -701,6 +702,10 @@ void meta_duplication_service::recover_from_meta_state()
_meta_svc->get_meta_storage()->get_children(
get_duplication_path(*app),
[this, app](bool node_exists, const std::vector<std::string>
&dup_id_list) {
+ dsn::defer([this, app]() {
Review Comment:
> The memory state will be updated [1] after get data from ZK successfully
in line 721, why update it again?
>
> 1.
https://github.com/apache/incubator-pegasus/blob/master/src/meta/duplication/meta_duplication_service.cpp#L787
Because in function `recover_from_meta_state`, the vector `dup_id_list` may
be empty.
Here is the detail of our online condition:
1. Delete the existing hot standby first
A. Delete the corresponding dup from zk
B. Set duplicating in meta_server memory to 0 (not saved in zk),
duplicating in zk is still 1
2. meta_server restarts
Read dup and app_info data from zk to memory. At this time, dup is empty,
but duplicating in zk is still 1 (because dup is empty, it is impossible to
delete the hot standby to make duplicating 0).
3. Meta passes the hot standby status to the replica through `on_config_sync`
4. Replica GC checks that the dup map is empty (`min_confirmed_decree =
invalid_decree`), but `_is_duplication_master = true`, so GC is not performed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]