Closed enjoy-binbin closed 1 day ago
Attention: Patch coverage is 80.00000%
with 4 lines
in your changes missing coverage. Please review.
Project coverage is 70.71%. Comparing base (
6038eda
) to head (68ba9c7
). Report is 13 commits behind head on unstable.
Files with missing lines | Patch % | Lines |
---|---|---|
src/replication.c | 55.55% | 4 Missing :warning: |
🚨 Try these New Features:
Why do we have this callback and what is it used for. I think it's only to notify the primary that the replica is still alive when it is doing a slow operation, right?
yes, when doing the flush in a sync way, replica will notify the primary to keep the line online.
emptyDbStructure ignores the callback if the async parameter is set. Why? Because replica doesn't need to send alive messages to the primary in this case?
yes, in the async way, we empty the data in the bio (it also don't have a way to call the callback), there is no slow operation so no need to notify the primary druing the flush.
Yes, i see you mentioned this in the pr description. looks good, thanks. Let's merge.
We have a replicationEmptyDbCallback, it is a callback used by emptyData while flushing away old data. Previously, we did not add this callback logic for function, in case of abuse, there may be a lot of functions, and also to make the code consistent, we add the same callback logic for function.
Changes around this commit:
We are doing this callback in replication is because during the flush, replica may block a while if the flush is doing in the sync way, to avoid the primary to detect the replica is timing out, replica will use this callback to notify the primary (we also do this callback when loading a RDB). And in the async way, we empty the data in the bio and there is no slw operation, so it will ignores the callback.