diff --git a/runtime/rpc.cpp b/runtime/rpc.cpp index 9a083c71e1..be61583e21 100644 --- a/runtime/rpc.cpp +++ b/runtime/rpc.cpp @@ -24,9 +24,12 @@ #include "runtime/tl/rpc_server.h" #include "runtime/tl/rpc_tl_query.h" #include "runtime/tl/tl_builtins.h" +#include "runtime/tl/tl_magics_decoding.h" #include "runtime/zlib.h" #include "server/php-queries.h" +DEFINE_VERBOSITY(rpc); + static const int GZIP_PACKED = 0x3072cfa1; const string tl_str_(""); @@ -816,8 +819,12 @@ void process_rpc_error(int32_t request_id, int32_t error_code, const char *error php_assert (request->resumable_id != -1); return; } - if (!is_fake_error && kphp_tracing::is_turned_on()) { - kphp_tracing::on_rpc_query_fail(request_id, error_code); + if (!is_fake_error) { + tvkprintf(rpc, 1, "RPC error: error_code=%d, request_id=%d, tl_function=%s(0x%08x), actor_id=%d\n", + error_code, request_id, tl_magic_convert_to_name(request->function_magic), request->function_magic, request->actor_or_port); + if (kphp_tracing::is_turned_on()) { + kphp_tracing::on_rpc_query_fail(request_id, error_code); + } } int64_t resumable_id = request->resumable_id; request->resumable_id = -2; diff --git a/runtime/rpc.h b/runtime/rpc.h index 3884f25bf6..51cfc4b6b8 100644 --- a/runtime/rpc.h +++ b/runtime/rpc.h @@ -7,12 +7,15 @@ #include #include "common/algorithms/hashes.h" +#include "common/kprintf.h" #include "runtime/dummy-visitor-methods.h" #include "runtime/kphp_core.h" #include "runtime/net_events.h" #include "runtime/resumable.h" #include "runtime/to-array-processor.h" +DECLARE_VERBOSITY(rpc); + struct rpc_request { int64_t resumable_id; // == 0 - default, > 0 if not finished, -1 if received an answer, -2 if received an error, -3 if answer was gotten union { diff --git a/server/confdata-binlog-replay.cpp b/server/confdata-binlog-replay.cpp index 4955bdf73e..cac6fb3376 100644 --- a/server/confdata-binlog-replay.cpp +++ b/server/confdata-binlog-replay.cpp @@ -11,6 +11,7 @@ #include #include "common/binlog/binlog-replayer.h" +#include "common/dl-utils-lite.h" #include "common/precise-time.h" #include "common/server/engine-settings.h" #include "common/server/init-binlog.h" @@ -189,7 +190,9 @@ class ConfdataBinlogReplayer : vk::binlog::replayer { *updating_confdata_storage_ = previous_confdata_storage; } else { // strictly speaking, they should be identical, but it's too hard to verify - assert(updating_confdata_storage_->size() == previous_confdata_storage.size()); + dl_assert(updating_confdata_storage_->size() == previous_confdata_storage.size(), + dl_pstr("Can't update confdata from binlog: 'updating_confdata' and 'previous_confdata' must be identical, " + "but they have different sizes (%zu != %zu)\n", updating_confdata_storage_->size(), previous_confdata_storage.size())); } } }