-
Notifications
You must be signed in to change notification settings - Fork 702
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
Refactor syncWithPrimary and replicaTryPartialResynchronization #1476
base: unstable
Are you sure you want to change the base?
Conversation
Signed-off-by: Nitai Caro <[email protected]>
Signed-off-by: Nitai Caro <[email protected]>
…case Signed-off-by: Nitai Caro <[email protected]>
Signed-off-by: Nitai Caro <[email protected]>
…and and replicaProcessPsyncReply Signed-off-by: Nitai Caro <[email protected]>
…ions Signed-off-by: Nitai Caro <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1476 +/- ##
============================================
+ Coverage 70.81% 70.97% +0.16%
============================================
Files 121 121
Lines 65132 65173 +41
============================================
+ Hits 46121 46258 +137
+ Misses 19011 18915 -96
|
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 kind of refactoring is really valuable for the long-term health of Valkey. It makes the codebase easier to understand, maintain, and improve, which ultimately helps us deliver better features faster. Thanks @nitaicaro and @naglera!
My main focus in this review is on the high level code structure, which looks great to me. That said, the use of goto in syncWithPrimary
stands out. Let's aim to eliminate all goto statements from that function. I'll take another look and provide more detailed feedback once that's addressed.
Signed-off-by: Nitai Caro <[email protected]>
Signed-off-by: Nitai Caro <[email protected]>
In continuation to #945
syncWithPrimary:
syncWithPrimaryHandleNoResponseError
replicaTryPartialResynchronization:
This function was performing two different jobs based on the value of the read_reply argument -
This change simplifies the logic by clearly separating the writing and reading stages of the PSYNC process.
The PR was split into individual commits for easy review.