diff --git a/src/Common/ZooKeeper/TestKeeperStorage.cpp b/src/Common/ZooKeeper/TestKeeperStorage.cpp index a3e637a4ce8..22a06f67988 100644 --- a/src/Common/ZooKeeper/TestKeeperStorage.cpp +++ b/src/Common/ZooKeeper/TestKeeperStorage.cpp @@ -376,12 +376,14 @@ struct TestKeeperStorageMultiRequest final : public TestKeeperStorageRequest try { + size_t i = 0; for (const auto & concrete_request : concrete_requests) { auto [ cur_response, undo_action ] = concrete_request->process(container, zxid); - response.responses.emplace_back(cur_response); + response.responses[i] = cur_response; if (cur_response->error != Coordination::Error::ZOK) { + std::cerr << "GOT ERROR ON: " << i << " error" << static_cast(cur_response->error) << std::endl; response.error = cur_response->error; for (auto it = undo_actions.rbegin(); it != undo_actions.rend(); ++it) @@ -392,6 +394,7 @@ struct TestKeeperStorageMultiRequest final : public TestKeeperStorageRequest } else undo_actions.emplace_back(std::move(undo_action)); + ++i; } response.error = Coordination::Error::ZOK; @@ -482,9 +485,6 @@ void TestKeeperStorage::finalize() } - - - class TestKeeperWrapperFactory final : private boost::noncopyable { diff --git a/src/Common/ZooKeeper/ZooKeeperCommon.cpp b/src/Common/ZooKeeper/ZooKeeperCommon.cpp index b1a11b2d473..f26a72a3d55 100644 --- a/src/Common/ZooKeeper/ZooKeeperCommon.cpp +++ b/src/Common/ZooKeeper/ZooKeeperCommon.cpp @@ -544,12 +544,14 @@ void ZooKeeperMultiResponse::readImpl(ReadBuffer & in) void ZooKeeperMultiResponse::writeImpl(WriteBuffer & out) const { + std::cerr << "WRITING MULTIRESPONSE " << responses.size() << std::endl; for (auto & response : responses) { const ZooKeeperResponse & zk_response = dynamic_cast(*response); OpNum op_num = zk_response.getOpNum(); bool done = false; Error op_error = zk_response.error; + std::cerr << "WRITING OP ERROR:" << static_cast(op_error) << std::endl; Coordination::write(op_num, out); Coordination::write(done, out); diff --git a/src/Common/ZooKeeper/ZooKeeperImpl.cpp b/src/Common/ZooKeeper/ZooKeeperImpl.cpp index 33204686dce..4d81748ca3d 100644 --- a/src/Common/ZooKeeper/ZooKeeperImpl.cpp +++ b/src/Common/ZooKeeper/ZooKeeperImpl.cpp @@ -824,11 +824,15 @@ void ZooKeeper::receiveEvent() try { + std::cerr << "READING RESPONSE FOR REQUEST ID:" << request_info.request->getOpNum() << std::endl; if (!response) response = request_info.request->makeResponse(); if (err != Error::ZOK) + { + std::cerr << "GOT ERROR:" << static_cast(err) << std::endl; response->error = err; + } else { response->readImpl(*in);