Closed enjoy-binbin closed 1 day ago
Attention: Patch coverage is 50.00000%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 70.69%. Comparing base (
4986310
) to head (f3ffeaa
). Report is 1 commits behind head on unstable.
Files with missing lines | Patch % | Lines |
---|---|---|
src/replication.c | 50.00% | 3 Missing :warning: |
🚨 Try these New Features:
a test log example:
67697:S 21 Nov 2024 16:01:03.309 * Loading RDB produced by Valkey version 255.255.255
67697:S 21 Nov 2024 16:01:03.309 * RDB age 0 seconds
67697:S 21 Nov 2024 16:01:03.309 * RDB memory usage when created 1.23 Mb
67697:S 21 Nov 2024 16:01:03.309 # binbintest load error
67697:S 21 Nov 2024 16:01:03.309 # Failed trying to load the PRIMARY synchronization DB from disk, check server logs.
67697:S 21 Nov 2024 16:01:03.310 * Reconnecting to PRIMARY 127.0.0.1:6379 after failure
67697:S 21 Nov 2024 16:01:03.310 * PRIMARY <-> REPLICA sync started
67697:S 21 Nov 2024 16:01:03.310 * PRIMARY <-> REPLICA sync: Discarding the half-loaded data
the reconnecting and sync started should be after discarding one.
cancelReplicationHandshake is a no-op in some cases where we just did return before, right?
no, cancelReplicationHandshake is not a no-op, and we are not just did return before, we did cancelReplicationHandshake and return together before, this commit just like, adjust the code location (or order).
cancelReplicationHandshake is a no-op in some cases where we just did return before, right?
no, cancelReplicationHandshake is not a no-op, and we are not just did return before, we did cancelReplicationHandshake and return together before, this commit just like, adjust the code location (or order).
Ah, I see now. Every goto error
replaces cancelReplicationHandshake + return.
The goto error label is the same as the error return, use goto to reduce the references.
Also this can make the log printing more continuous under the error, that is, we print the error log first, and then print the reconnecting log at the last (in cancelReplicationHandshake).