You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor syncWithPrimary and replicaTryPartialResynchronization (#1476)
In continuation to #945
**syncWithPrimary:**
- Refactored all error handling to function `syncWithPrimaryHandleError`
- Refactored repl_state state machine from if-else format to switch-case
format
- Besides changing the repl_state, all state machine logic moved to
helper functions
**replicaTryPartialResynchronization:**
This function was performing two different jobs based on the value of
the read_reply argument -
- read_reply == 0: Sends the PSYNC command to the primary server.
- read_reply == 1: Reads and processes the reply to the PSYNC command.
This change simplifies the logic by clearly separating the writing and
reading stages of the PSYNC process.
Signed-off-by: Nitai Caro <caronita@amazon.com>
Co-authored-by: Nitai Caro <caronita@amazon.com>
0 commit comments