mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix race condition in MySQL pool
This commit is contained in:
parent
8ae2bc06a1
commit
de722cd57c
@ -3,6 +3,7 @@
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <atomic>
|
||||
|
||||
#include <Poco/Exception.h>
|
||||
#include <mysqlxx/Connection.h>
|
||||
@ -35,7 +36,9 @@ protected:
|
||||
struct Connection
|
||||
{
|
||||
mysqlxx::Connection conn;
|
||||
int ref_count = 0;
|
||||
/// Ref count modified in constructor/descructor of Entry
|
||||
/// but also read in pool code.
|
||||
std::atomic<int> ref_count = 0;
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<yandex>
|
||||
<logger>
|
||||
<level>trace</level>
|
||||
<log>/var/log/clickhouse-server/log.log</log>
|
||||
<errorlog>/var/log/clickhouse-server/log.err.log</errorlog>
|
||||
<size>1000M</size>
|
||||
<count>10</count>
|
||||
<stderr>/var/log/clickhouse-server/stderr.log</stderr>
|
||||
<stdout>/var/log/clickhouse-server/stdout.log</stdout>
|
||||
</logger>
|
||||
</yandex>
|
@ -5,7 +5,7 @@ from helpers.cluster import ClickHouseCluster
|
||||
|
||||
CONFIG_FILES = ['configs/dictionaries/mysql_dict1.xml', 'configs/dictionaries/mysql_dict2.xml',
|
||||
'configs/remote_servers.xml']
|
||||
CONFIG_FILES += ['configs/enable_dictionaries.xml']
|
||||
CONFIG_FILES += ['configs/enable_dictionaries.xml', 'configs/log_conf.xml']
|
||||
cluster = ClickHouseCluster(__file__)
|
||||
instance = cluster.add_instance('instance', main_configs=CONFIG_FILES, with_mysql=True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user