-
Notifications
You must be signed in to change notification settings - Fork 21
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 raft repl dev ut #543
fix raft repl dev ut #543
Conversation
// last_data_committed_lsn to notify leader to transfer new data to follower. | ||
// actually, leader will transfer all the data in one shot, so this is will not trigger any error, but we should | ||
// make the logic correct. | ||
snp_data->offset = last_data_committed_lsn + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggesting snapshot_write_to_lsn
instead of last_data_committed_lsn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is will be updated in on_commit
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #543 +/- ##
===========================================
+ Coverage 56.51% 67.92% +11.41%
===========================================
Files 108 109 +1
Lines 10300 10432 +132
Branches 1402 1400 -2
===========================================
+ Hits 5821 7086 +1265
+ Misses 3894 2679 -1215
- Partials 585 667 +82 ☔ View full report in Codecov by Sentry. |
4a89c18
to
9b74bf7
Compare
7ed350b
to
074161d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run with -num_io=5000/10000
@@ -269,7 +269,10 @@ class TestReplicatedDB : public homestore::ReplDevListener { | |||
"[Replica={}] Save logical snapshot callback obj_id={} term={} idx={} is_last={} num_items={}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Move log one line after updating the snp_data->offset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this log wants to print out what we receive from leader , so I think we should keep it as this
@sanebay I have run it with 5000 and it works |
before install snapshot completes, raft_server()->get_committed_log_idx() will be the same if write_snapshot_data is called several times, so that snp_data->offset can not be updated to new cursor. this PR use a separate last_data_committed_lsn to maintain the last committed lsn for writing data, which is use for updating snp_data->offset in write_snapshot_data
before install snapshot completes,
raft_server()->get_committed_log_idx()
will be the same ifwrite_snapshot_data
is called several times, so thatsnp_data->offset
can not be updated to new cursor.this PR use a separate last_data_committed_lsn to maintain the last committed lsn for writing data, which is use for updating
snp_data->offset
inwrite_snapshot_data