mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 02:15:45 +02:00
feat(replication): First iteration on partial sync. (#1836)
First iteration on partial sync.
This commit is contained in:
parent
d9f4ca8003
commit
d50b492e1f
21 changed files with 524 additions and 86 deletions
|
@ -148,10 +148,13 @@ class ProtocolClient {
|
|||
/**
|
||||
* A convenience macro to use with ProtocolClient instances for protocol input validation.
|
||||
*/
|
||||
#define PC_RETURN_ON_BAD_RESPONSE(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
LOG(ERROR) << "Bad response to \"" << last_cmd_ << "\": \"" << absl::CEscape(last_resp_); \
|
||||
return std::make_error_code(errc::bad_message); \
|
||||
} \
|
||||
#define PC_RETURN_ON_BAD_RESPONSE_T(T, x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
LOG(ERROR) << "Bad response to \"" << last_cmd_ << "\": \"" << absl::CEscape(last_resp_) \
|
||||
<< "\""; \
|
||||
return (T)(std::make_error_code(errc::bad_message)); \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
#define PC_RETURN_ON_BAD_RESPONSE(x) PC_RETURN_ON_BAD_RESPONSE_T(std::error_code, x)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue