feat(replication): First iteration on partial sync. (#1836)

First iteration on partial sync.
This commit is contained in:
Roy Jacobson 2023-09-26 10:35:50 +03:00 committed by GitHub
parent d9f4ca8003
commit d50b492e1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 524 additions and 86 deletions

View file

@ -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)