This commit is contained in:
kssenii 2021-04-09 11:02:12 +00:00
parent 12f98e8b11
commit f7361250b2
4 changed files with 4 additions and 12 deletions

View File

@ -42,13 +42,6 @@ ConnectionPtr createReplicationConnection(const ConnectionInfo & connection_info
} }
template <typename T>
std::shared_ptr<T> createTransaction(pqxx::connection & connection)
{
return std::make_shared<T>(connection);
}
Connection::Connection(const ConnectionInfo & connection_info_) Connection::Connection(const ConnectionInfo & connection_info_)
: connection_info(connection_info_) : connection_info(connection_info_)
{ {

View File

@ -61,11 +61,10 @@ private:
}; };
/// Passes transaction object into PostgreSQLBlockInputStream and does not close transaction after read if finished. /// Passes transaction object into PostgreSQLBlockInputStream and does not close transaction after read is finished.
template <typename T> template <typename T>
class PostgreSQLTransactionBlockInputStream : public PostgreSQLBlockInputStream<T> class PostgreSQLTransactionBlockInputStream : public PostgreSQLBlockInputStream<T>
{ {
public: public:
using Base = PostgreSQLBlockInputStream<T>; using Base = PostgreSQLBlockInputStream<T>;

View File

@ -17,6 +17,8 @@ namespace DB
static const auto reschedule_ms = 500; static const auto reschedule_ms = 500;
/// TODO: fetch replica identity index
PostgreSQLReplicationHandler::PostgreSQLReplicationHandler( PostgreSQLReplicationHandler::PostgreSQLReplicationHandler(
const std::string & database_name_, const std::string & database_name_,
const postgres::ConnectionInfo & connection_info_, const postgres::ConnectionInfo & connection_info_,
@ -279,9 +281,8 @@ bool PostgreSQLReplicationHandler::isReplicationSlotExist(pqxx::nontransaction &
if (result.empty()) if (result.empty())
return false; return false;
bool is_active = result[0][0].as<bool>();
LOG_TRACE(log, "Replication slot {} already exists (active: {}). Restart lsn position is {}", LOG_TRACE(log, "Replication slot {} already exists (active: {}). Restart lsn position is {}",
slot_name, is_active, result[0][0].as<std::string>()); slot_name, result[0][0].as<bool>(), result[0][0].as<std::string>());
return true; return true;
} }

View File

@ -77,7 +77,6 @@ StorageMaterializePostgreSQL::StorageMaterializePostgreSQL(
, nested_storage(nested_storage_) , nested_storage(nested_storage_)
, is_postgresql_replica_database(true) , is_postgresql_replica_database(true)
{ {
} }