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

disable copy construction for homestore superblock #246

Merged

Conversation

zichanglai
Copy link
Contributor

with copy construction, superblock will be easy to cause duplicated metablk when call write() function if it is not carefully enough. we can avoid this by disable copy construction and only allow move construction.

@zichanglai zichanglai requested review from hkadayam, yamingk and xiaoxichen and removed request for hkadayam and yamingk December 6, 2023 06:26
@zichanglai zichanglai added this to the MileStone3.12 milestone Dec 6, 2023
@zichanglai zichanglai self-assigned this Dec 6, 2023
@zichanglai zichanglai force-pushed the disable_superblock_copy_construction branch from 3d7e079 to 52e7f76 Compare December 6, 2023 07:41
@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2023

Codecov Report

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

Comparison is base (87b40b0) 70.27% compared to head (2daa244) 70.35%.

Files Patch % Lines
src/include/homestore/index_service.hpp 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     #246      +/-   ##
==========================================
+ Coverage   70.27%   70.35%   +0.08%     
==========================================
  Files          97       97              
  Lines        7944     7952       +8     
  Branches     1017     1016       -1     
==========================================
+ Hits         5583     5595      +12     
+ Misses       1870     1869       -1     
+ Partials      491      488       -3     

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

@yamingk
Copy link
Contributor

yamingk commented Dec 6, 2023

Can you bump homstore patch version assuming it compiles successfully with homeobj?

@zichanglai
Copy link
Contributor Author

Can you bump homstore patch version assuming it compiles successfully with homeobj?

yes, I can bump homestore patch version for this. but homeobject need make little changes to build successfully because indextable interface is changed.

@zichanglai zichanglai force-pushed the disable_superblock_copy_construction branch from 52e7f76 to 2daa244 Compare December 7, 2023 03:56
Comment on lines +43 to +44
rhs.m_meta_mgr_cookie = nullptr;
rhs.m_sb = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

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

why this two members is initialized in initialization list and set to nullptr here?
they are already initialized with nullptr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is move construction

Comment on lines +53 to +54
rhs.m_meta_mgr_cookie = nullptr;
rhs.m_sb = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

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

the same as above

@zichanglai zichanglai merged commit b202457 into eBay:master Dec 12, 2023
16 checks passed
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.

Disable homestore superblock copy construction and only allow move construction
4 participants