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

Inlined data #521

Merged
merged 2 commits into from
Aug 24, 2024
Merged

Inlined data #521

merged 2 commits into from
Aug 24, 2024

Conversation

raakella1
Copy link
Contributor

  • Do not allocate blks if data is not inlined
  • Implement a basic version of is_resync_mode where we declare the follower to be in resync mode if the diff between leader_commit_lsn and his own last_log_idx from logstore is greater than a threshold

@codecov-commenter
Copy link

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

Codecov Report

Attention: Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.

Project coverage is 67.43%. Comparing base (1a0cef8) to head (3a73bc0).
Report is 48 commits behind head on master.

Files Patch % Lines
src/lib/replication/repl_dev/raft_repl_dev.cpp 68.42% 5 Missing and 1 partial ⚠️

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

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #521       +/-   ##
===========================================
+ Coverage   56.51%   67.43%   +10.91%     
===========================================
  Files         108      109        +1     
  Lines       10300    10421      +121     
  Branches     1402     1400        -2     
===========================================
+ Hits         5821     7027     +1206     
+ Misses       3894     2713     -1181     
- Partials      585      681       +96     

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

rreq->set_local_blkid(entry_blkid);
uint32_t data_size{0u};

if ((jentry->code == journal_type_t::HS_DATA_LINKED) && (jentry->value_size > 0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should assert if data linked, value_size should > 0

Copy link
Contributor

Choose a reason for hiding this comment

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

it is already asserted in repl_contxt_t::init(), no?

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, we assert in the init

@@ -1188,4 +1198,11 @@ void RaftReplDev::on_log_found(logstore_seq_num_t lsn, log_buffer buf, void* ctx

void RaftReplDev::on_restart() { m_listener->on_restart(); }

bool RaftReplDev::is_resync_mode() {
int64_t const leader_commited_lsn = raft_server()->get_leader_committed_log_idx();
Copy link
Contributor

Choose a reason for hiding this comment

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

is get_leader_committed_log_idx very light-weight operation (just a read) or it take some mutex while doing it? Asking since this is_resync_mode will be accessed quite frequently in I/O path, so would be good to double confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

it should be fine.

@@ -261,6 +261,9 @@ table Consensus {

// Frequency to flush durable commit LSN in millis
flush_durable_commit_interval_ms: uint64 = 500;

// Log difference to determine if the follower is in resync mode
resync_log_idx_threshold: int64 = 100;
Copy link
Contributor

Choose a reason for hiding this comment

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

we might want to tune this number later with E2E env, I am fine with this number for now.

@xiaoxichen xiaoxichen merged commit 0691a36 into eBay:master Aug 24, 2024
21 checks passed
@raakella1 raakella1 deleted the inlined_data branch August 24, 2024 07:51
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.

5 participants