diff --git a/clean.sh b/clean.sh index f50448116d..59e214debe 100755 --- a/clean.sh +++ b/clean.sh @@ -2,3 +2,4 @@ rm schema/*.{cc,h} rm -rf external rm -rf build +rm -rf cmake-build-debug diff --git a/cmake/Modules/Findcpp_redis.cmake b/cmake/Modules/Findcpp_redis.cmake index 7f30853c46..d4fc2dca05 100644 --- a/cmake/Modules/Findcpp_redis.cmake +++ b/cmake/Modules/Findcpp_redis.cmake @@ -16,11 +16,11 @@ find_package_handle_standard_args(cpp_redis DEFAULT_MSG ) set(URL1 https://github.com/Cylix/cpp_redis.git) -set(VERSION1 727aa5f06c8ce498168cbab5a023cad5b9c00bc0) +set(VERSION1 f390eef447a62dcb6da288fb1e91f25f8a9b838c) set_target_description(cpp_redis "C++ redis client" ${URL1} ${VERSION1}) set(URL2 https://github.com/Cylix/tacopie.git) -set(VERSION2 290dc38681f346adae41d3cc8feabbe534424675) +set(VERSION2 4c551b8ff1c53c5fa63286371c9c884254fc9423) set_target_description(tacopie "C++ tcp library" ${URL2} ${VERSION2}) if (NOT cpp_redis_FOUND) diff --git a/iroha-cli/interactive/impl/interactive_status_cli.cpp b/iroha-cli/interactive/impl/interactive_status_cli.cpp index 94b09f2979..b2261b511f 100644 --- a/iroha-cli/interactive/impl/interactive_status_cli.cpp +++ b/iroha-cli/interactive/impl/interactive_status_cli.cpp @@ -32,7 +32,7 @@ namespace iroha_cli { "Transaction has successfully passed stateful validation."}, {iroha::protocol::TxStatus::COMMITTED, "Transaction was successfully committed."}, - {iroha::protocol::TxStatus::IN_PROCESS, + {iroha::protocol::TxStatus::IN_PROGRESS, "Transaction is being processed at the moment."}, {iroha::protocol::TxStatus::NOT_RECEIVED, "Transaction was not found in the system."}}; diff --git a/irohad/ametsuchi/impl/mutable_storage_impl.cpp b/irohad/ametsuchi/impl/mutable_storage_impl.cpp index c80be06b71..78f0388051 100644 --- a/irohad/ametsuchi/impl/mutable_storage_impl.cpp +++ b/irohad/ametsuchi/impl/mutable_storage_impl.cpp @@ -28,7 +28,7 @@ namespace iroha { namespace ametsuchi { MutableStorageImpl::MutableStorageImpl( hash256_t top_hash, - std::unique_ptr index, + std::unique_ptr index, std::unique_ptr connection, std::unique_ptr transaction, std::shared_ptr command_executors) diff --git a/irohad/ametsuchi/impl/mutable_storage_impl.hpp b/irohad/ametsuchi/impl/mutable_storage_impl.hpp index 5281cab21f..2b084a431e 100644 --- a/irohad/ametsuchi/impl/mutable_storage_impl.hpp +++ b/irohad/ametsuchi/impl/mutable_storage_impl.hpp @@ -21,7 +21,7 @@ #include "ametsuchi/mutable_storage.hpp" #include -#include +#include #include #include @@ -35,7 +35,7 @@ namespace iroha { public: MutableStorageImpl( - hash256_t top_hash, std::unique_ptr index, + hash256_t top_hash, std::unique_ptr index, std::unique_ptr connection, std::unique_ptr transaction, std::shared_ptr command_executors); @@ -52,7 +52,7 @@ namespace iroha { // ordered collection is used to enforce block insertion order in // StorageImpl::commit std::map block_store_; - std::unique_ptr index_; + std::unique_ptr index_; std::unique_ptr connection_; std::unique_ptr transaction_; diff --git a/irohad/ametsuchi/impl/redis_block_index.cpp b/irohad/ametsuchi/impl/redis_block_index.cpp index a4d5f37d68..090da44f6d 100644 --- a/irohad/ametsuchi/impl/redis_block_index.cpp +++ b/irohad/ametsuchi/impl/redis_block_index.cpp @@ -31,7 +31,7 @@ namespace iroha { namespace ametsuchi { - RedisBlockIndex::RedisBlockIndex(cpp_redis::redis_client &client) + RedisBlockIndex::RedisBlockIndex(cpp_redis::client &client) : client_(client), account_id_height_("%s:%s"), account_id_height_asset_id_("%s:%s:%s") {} diff --git a/irohad/ametsuchi/impl/redis_block_index.hpp b/irohad/ametsuchi/impl/redis_block_index.hpp index a57b1b8669..485b14680b 100644 --- a/irohad/ametsuchi/impl/redis_block_index.hpp +++ b/irohad/ametsuchi/impl/redis_block_index.hpp @@ -21,13 +21,13 @@ #include "ametsuchi/impl/block_index.hpp" #include -#include +#include namespace iroha { namespace ametsuchi { class RedisBlockIndex : public BlockIndex { public: - explicit RedisBlockIndex(cpp_redis::redis_client &client); + explicit RedisBlockIndex(cpp_redis::client &client); void index(const model::Block &block) override; @@ -54,7 +54,7 @@ namespace iroha { const std::string &index, const model::Transaction::CommandsType &commands); - cpp_redis::redis_client &client_; + cpp_redis::client &client_; /// format strings for index keys boost::format account_id_height_, account_id_height_asset_id_; }; diff --git a/irohad/ametsuchi/impl/redis_block_query.cpp b/irohad/ametsuchi/impl/redis_block_query.cpp index 5d8906c041..16fdad54d5 100644 --- a/irohad/ametsuchi/impl/redis_block_query.cpp +++ b/irohad/ametsuchi/impl/redis_block_query.cpp @@ -21,7 +21,7 @@ namespace iroha { namespace ametsuchi { - RedisBlockQuery::RedisBlockQuery(cpp_redis::redis_client &client, + RedisBlockQuery::RedisBlockQuery(cpp_redis::client &client, FlatFile &file_store) : block_store_(file_store), client_(client) {} diff --git a/irohad/ametsuchi/impl/redis_block_query.hpp b/irohad/ametsuchi/impl/redis_block_query.hpp index 0b4b8a5604..677c4ffbc0 100644 --- a/irohad/ametsuchi/impl/redis_block_query.hpp +++ b/irohad/ametsuchi/impl/redis_block_query.hpp @@ -18,7 +18,7 @@ #ifndef IROHA_REDIS_FLAT_BLOCK_QUERY_HPP #define IROHA_REDIS_FLAT_BLOCK_QUERY_HPP -#include +#include #include "ametsuchi/block_query.hpp" #include "ametsuchi/impl/flat_file/flat_file.hpp" @@ -33,7 +33,7 @@ namespace iroha { */ class RedisBlockQuery : public BlockQuery { public: - RedisBlockQuery(cpp_redis::redis_client &client, FlatFile &file_store); + RedisBlockQuery(cpp_redis::client &client, FlatFile &file_store); rxcpp::observable getAccountTransactions( const std::string &account_id) override; @@ -82,7 +82,7 @@ namespace iroha { const rxcpp::subscriber &s, uint64_t block_id); FlatFile &block_store_; - cpp_redis::redis_client &client_; + cpp_redis::client &client_; model::converters::JsonBlockFactory serializer_; }; } // namespace ametsuchi diff --git a/irohad/ametsuchi/impl/storage_impl.cpp b/irohad/ametsuchi/impl/storage_impl.cpp index 6b9454cb96..f9367526a3 100644 --- a/irohad/ametsuchi/impl/storage_impl.cpp +++ b/irohad/ametsuchi/impl/storage_impl.cpp @@ -32,7 +32,7 @@ namespace iroha { std::size_t redis_port, std::string postgres_options, std::unique_ptr block_store, - std::unique_ptr index, + std::unique_ptr index, std::unique_ptr wsv_connection, std::unique_ptr wsv_transaction) : block_store_dir_(std::move(block_store_dir)), @@ -94,7 +94,7 @@ namespace iroha { auto wsv_transaction = std::make_unique( *postgres_connection, "TemporaryWsv"); - auto index = std::make_unique(); + auto index = std::make_unique(); try { index->connect(redis_host_, redis_port_); } catch (const cpp_redis::redis_error &e) { @@ -159,7 +159,7 @@ DROP TABLE IF EXISTS role; // erase tx index log_->info("drop redis"); - cpp_redis::redis_client client; + cpp_redis::client client; client.connect(redis_host_, redis_port_); client.flushall(); client.sync_commit(); @@ -184,7 +184,7 @@ DROP TABLE IF EXISTS role; } log_->info("block store created"); - auto index = std::make_unique(); + auto index = std::make_unique(); try { index->connect(redis_host, redis_port); } catch (const cpp_redis::redis_error &e) { diff --git a/irohad/ametsuchi/impl/storage_impl.hpp b/irohad/ametsuchi/impl/storage_impl.hpp index b62c64a49a..7e318a58f4 100644 --- a/irohad/ametsuchi/impl/storage_impl.hpp +++ b/irohad/ametsuchi/impl/storage_impl.hpp @@ -35,7 +35,7 @@ namespace iroha { struct ConnectionContext { ConnectionContext(std::unique_ptr block_store, - std::unique_ptr index, + std::unique_ptr index, std::unique_ptr pg_lazy, std::unique_ptr pg_nontx) : block_store(std::move(block_store)), @@ -45,7 +45,7 @@ namespace iroha { } std::unique_ptr block_store; - std::unique_ptr index; + std::unique_ptr index; std::unique_ptr pg_lazy; std::unique_ptr pg_nontx; }; @@ -84,7 +84,7 @@ namespace iroha { std::size_t redis_port, std::string postgres_options, std::unique_ptr block_store, - std::unique_ptr index, + std::unique_ptr index, std::unique_ptr wsv_connection, std::unique_ptr wsv_transaction); @@ -104,7 +104,7 @@ namespace iroha { /** * Redis connection */ - std::unique_ptr index_; + std::unique_ptr index_; /** * Pg connection with direct transaction management diff --git a/irohad/model/transaction_response.hpp b/irohad/model/transaction_response.hpp index 00b265729a..9b25f85d5d 100644 --- a/irohad/model/transaction_response.hpp +++ b/irohad/model/transaction_response.hpp @@ -39,7 +39,7 @@ namespace iroha { STATEFUL_VALIDATION_FAILED, // stateful validation failed STATEFUL_VALIDATION_SUCCESS, // stateful validation passed COMMITTED, // tx pipeline succeeded, tx is committed - ON_PROCESS, // transaction is received, but not validated + IN_PROGRESS, // transaction is received, but not validated NOT_RECEIVED // transaction is not in handler map }; diff --git a/irohad/torii/impl/command_service.cpp b/irohad/torii/impl/command_service.cpp index a75bce5b61..9095370c53 100644 --- a/irohad/torii/impl/command_service.cpp +++ b/irohad/torii/impl/command_service.cpp @@ -65,8 +65,8 @@ namespace torii { case iroha::model::TransactionResponse::COMMITTED: res->set_tx_status(iroha::protocol::TxStatus::COMMITTED); break; - case iroha::model::TransactionResponse::ON_PROCESS: - res->set_tx_status(iroha::protocol::TxStatus::ON_PROCESS); + case iroha::model::TransactionResponse::IN_PROGRESS: + res->set_tx_status(iroha::protocol::TxStatus::IN_PROGRESS); break; case iroha::model::TransactionResponse::NOT_RECEIVED: default: @@ -89,7 +89,7 @@ namespace torii { iroha::protocol::ToriiResponse response; response.set_tx_hash(tx_hash); - response.set_tx_status(iroha::protocol::TxStatus::ON_PROCESS); + response.set_tx_status(iroha::protocol::TxStatus::IN_PROGRESS); cache_->addItem(tx_hash, response); // Send transaction to iroha diff --git a/irohad/torii/torii_service_handler.cpp b/irohad/torii/torii_service_handler.cpp index 6e8b30eaf8..7b54650925 100644 --- a/irohad/torii/torii_service_handler.cpp +++ b/irohad/torii/torii_service_handler.cpp @@ -43,7 +43,14 @@ namespace torii { /** * shuts down service handler. (actually, shuts down completion queue only) */ - void ToriiServiceHandler::shutdown() { completionQueue_->Shutdown(); } + void ToriiServiceHandler::shutdown() { completionQueue_->Shutdown(); + void* tag = nullptr; + bool ok = false; + + while (completionQueue_->Next(&tag, &ok)){ + //wait until completion queue shuts down + } + } /** * handles rpcs loop in CommandService. diff --git a/schema/endpoint.proto b/schema/endpoint.proto index 1202399430..846a802107 100644 --- a/schema/endpoint.proto +++ b/schema/endpoint.proto @@ -14,7 +14,7 @@ enum TxStatus { STATEFUL_VALIDATION_FAILED = 2; STATEFUL_VALIDATION_SUCCESS = 3; COMMITTED = 4; - IN_PROCESS = 5; + IN_PROGRESS = 5; NOT_RECEIVED = 6; } diff --git a/test/module/irohad/ametsuchi/ametsuchi_fixture.hpp b/test/module/irohad/ametsuchi/ametsuchi_fixture.hpp index 1f2d58e961..e0b882b8e0 100644 --- a/test/module/irohad/ametsuchi/ametsuchi_fixture.hpp +++ b/test/module/irohad/ametsuchi/ametsuchi_fixture.hpp @@ -99,7 +99,7 @@ DROP TABLE IF EXISTS role; std::shared_ptr connection; - cpp_redis::redis_client client; + cpp_redis::client client; model::generators::CommandGenerator cmd_gen;