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

fix repl service #284

Merged
merged 4 commits into from
Feb 1, 2024
Merged

Conversation

JacksonYao287
Copy link
Contributor

GenericReplService is created in HomeStore::start and will get the uuid through get_my_repl_id() of ReplApplication .

when it is first-time-boot, ReplApplication does not get its real uuid in HomeStore::start. in HO case, it will get the uuid by discover_svcid after HomeStore::start returns and before HomeStore::format_and_start. so , if we build GenericReplService in HomeStore::start for first-time-boot , incorrect uuid(default value) will be got.

this PR move the construction of GenericReplService to HomeStore::do_start, so that no matter it is the first time boot, we can make sure GenericReplService will get a correct uuid from ReplApplication.

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.

We cannot explain why in @JacksonYao287 's environment the initial value of boost::uuid is not nil value..

I do think we need to have an assert in HO our_uuid() to gate the !_our_id.is_nil() access to uuid before its properly initialized but based on what we see above for unknown reason it seems the default value can pass...

    peer_id_t our_uuid() const final { return _our_id; }

===================

    peer_id_t test1;
    LOGI("Initializing HomeObject test1 uuid {}", to_string(test1));
    auto instance = std::make_shared< HSHomeObject >(std::move(application));
    LOGI("Initializing HomeObject uuid {}", to_string(instance->our_uuid()));
    peer_id_t test2;
    LOGI("Initializing HomeObject test2 uuid {}", to_string(test2));

log

[01/23/24 03:34:59.229] [storage_mgr] [info] [2815253] [hs_homeobject.cpp:35:init_homeobject] Initializing HomeObject test1 uuid d011982f-0100-0000-9c23-832f60550000
[01/23/24 03:34:59.229] [storage_mgr] [info] [2815253] [homeobject_impl.cpp:26:HomeObjectImpl] initialized with [executor=immediate]
[01/23/24 03:34:59.229] [storage_mgr] [info] [2815253] [hs_homeobject.cpp:37:init_homeobject] Initializing HomeObject uuid 6275672c-2062-6c6f-626d-67723d646562
[01/23/24 03:34:59.229] [storage_mgr] [info] [2815253] [hs_homeobject.cpp:40:init_homeobject] Initializing HomeObject test2 uuid 6275672c-2062-6c6f-626d-67723d646562

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (42cdddb) 58.95% compared to head (a0886b2) 58.88%.

Files Patch % Lines
src/lib/replication/service/raft_repl_service.cpp 0.00% 3 Missing ⚠️
src/include/homestore/replication/repl_dev.h 0.00% 2 Missing ⚠️
src/lib/replication/service/generic_repl_svc.cpp 0.00% 2 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #284      +/-   ##
==========================================
- Coverage   58.95%   58.88%   -0.08%     
==========================================
  Files         110      110              
  Lines        9246     9247       +1     
  Branches     1188     1188              
==========================================
- Hits         5451     5445       -6     
  Misses       3267     3267              
- Partials      528      535       +7     

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

@JacksonYao287 JacksonYao287 force-pushed the fix-repl-service branch 2 times, most recently from a1a605a to d9855e4 Compare January 31, 2024 05:40
xiaoxichen
xiaoxichen previously approved these changes Jan 31, 2024
xiaoxichen
xiaoxichen previously approved these changes Jan 31, 2024
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

xiaoxichen
xiaoxichen previously approved these changes Feb 1, 2024
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.

removed the virtual for now as no use case.

@JacksonYao287 JacksonYao287 merged commit 4da2de4 into eBay:master Feb 1, 2024
20 checks passed
@JacksonYao287 JacksonYao287 deleted the fix-repl-service branch February 1, 2024 02:28
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