Skip to content

Commit ff01bcf

Browse files
qoegaalesapin
authored andcommitted
Merge pull request ClickHouse#14323 from qoega/try-dns-fix
Add tag pass for integration base image. Add explicit dns options for docker-compose. (cherry picked from commit 2b8ad57)
1 parent aef16bb commit ff01bcf

File tree

19 files changed

+65
-40
lines changed

19 files changed

+65
-40
lines changed

programs/server/Server.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ int Server::main(const std::vector<std::string> & /*args*/)
773773
{
774774
/// Disable DNS caching at all
775775
DNSResolver::instance().setDisableCacheFlag();
776+
LOG_DEBUG(log, "DNS caching disabled");
776777
}
777778
else
778779
{

src/Interpreters/DNSCacheUpdater.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ void DNSCacheUpdater::run()
4242

4343
void DNSCacheUpdater::start()
4444
{
45+
LOG_INFO(&Poco::Logger::get("DNSCacheUpdater"), "Update period {} seconds", update_period_seconds);
4546
task_handle->activateAndSchedule();
4647
}
4748

tests/integration/helpers/cluster.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def __init__(self, base_path, name=None, base_configs_dir=None, server_bin_path=
111111

112112
custom_dockerd_host = custom_dockerd_host or os.environ.get('CLICKHOUSE_TESTS_DOCKERD_HOST')
113113
self.docker_api_version = os.environ.get("DOCKER_API_VERSION")
114+
self.docker_base_tag = os.environ.get("DOCKER_BASE_TAG")
114115

115116
self.base_cmd = ['docker-compose']
116117
if custom_dockerd_host:
@@ -165,7 +166,7 @@ def add_instance(self, name, config_dir=None, main_configs=None, user_configs=No
165166
with_zookeeper=False, with_mysql=False, with_kafka=False, with_rabbitmq=False, clickhouse_path_dir=None,
166167
with_odbc_drivers=False, with_postgres=False, with_hdfs=False, with_mongo=False,
167168
with_redis=False, with_minio=False, with_cassandra=False,
168-
hostname=None, env_variables=None, image="yandex/clickhouse-integration-test",
169+
hostname=None, env_variables=None, image="yandex/clickhouse-integration-test", tag=None,
169170
stay_alive=False, ipv4_address=None, ipv6_address=None, with_installed_binary=False, tmpfs=None,
170171
zookeeper_docker_compose_path=None, zookeeper_use_tmpfs=True, minio_certs_dir=None):
171172
"""Add an instance to the cluster.
@@ -183,13 +184,16 @@ def add_instance(self, name, config_dir=None, main_configs=None, user_configs=No
183184
if name in self.instances:
184185
raise Exception("Can\'t add instance `%s': there is already an instance with the same name!" % name)
185186

187+
if tag is None:
188+
tag = self.docker_base_tag
189+
186190
instance = ClickHouseInstance(
187191
self, self.base_dir, name, config_dir, main_configs or [], user_configs or [], macros or {},
188192
with_zookeeper,
189193
self.zookeeper_config_path, with_mysql, with_kafka, with_rabbitmq, with_mongo, with_redis, with_minio, with_cassandra,
190194
self.base_configs_dir, self.server_bin_path,
191195
self.odbc_bridge_bin_path, clickhouse_path_dir, with_odbc_drivers, hostname=hostname,
192-
env_variables=env_variables or {}, image=image, stay_alive=stay_alive, ipv4_address=ipv4_address,
196+
env_variables=env_variables or {}, image=image, tag=tag, stay_alive=stay_alive, ipv4_address=ipv4_address,
193197
ipv6_address=ipv6_address,
194198
with_installed_binary=with_installed_binary, tmpfs=tmpfs or [])
195199

@@ -704,7 +708,7 @@ def add_zookeeper_startup_command(self, command):
704708
version: '2.3'
705709
services:
706710
{name}:
707-
image: {image}
711+
image: {image}:{tag}
708712
hostname: {hostname}
709713
volumes:
710714
- {configs_dir}:/etc/clickhouse-server/
@@ -723,6 +727,11 @@ def add_zookeeper_startup_command(self, command):
723727
- {env_file}
724728
security_opt:
725729
- label:disable
730+
dns_opt:
731+
- attempts:2
732+
- timeout:1
733+
- inet6
734+
- rotate
726735
{networks}
727736
{app_net}
728737
{ipv4_address}
@@ -736,10 +745,10 @@ class ClickHouseInstance:
736745

737746
def __init__(
738747
self, cluster, base_path, name, custom_config_dir, custom_main_configs, custom_user_configs, macros,
739-
with_zookeeper, zookeeper_config_path, with_mysql, with_kafka, with_rabbitmq, with_mongo, with_redis, with_minio, with_cassandra,
740-
base_configs_dir, server_bin_path, odbc_bridge_bin_path,
748+
with_zookeeper, zookeeper_config_path, with_mysql, with_kafka, with_rabbitmq, with_mongo,
749+
with_redis, with_minio, with_cassandra, base_configs_dir, server_bin_path, odbc_bridge_bin_path,
741750
clickhouse_path_dir, with_odbc_drivers, hostname=None, env_variables=None,
742-
image="yandex/clickhouse-integration-test",
751+
image="yandex/clickhouse-integration-test", tag="latest",
743752
stay_alive=False, ipv4_address=None, ipv6_address=None, with_installed_binary=False, tmpfs=None):
744753

745754
self.name = name
@@ -783,6 +792,7 @@ def __init__(
783792
self.client = None
784793
self.default_timeout = 20.0 # 20 sec
785794
self.image = image
795+
self.tag = tag
786796
self.stay_alive = stay_alive
787797
self.ipv4_address = ipv4_address
788798
self.ipv6_address = ipv6_address
@@ -1160,6 +1170,7 @@ def create_dir(self, destroy_dir=True):
11601170
with open(self.docker_compose_path, 'w') as docker_compose:
11611171
docker_compose.write(DOCKER_COMPOSE_TEMPLATE.format(
11621172
image=self.image,
1173+
tag=self.tag,
11631174
name=self.name,
11641175
hostname=self.hostname,
11651176
binary_volume=binary_volume,

tests/integration/runner

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ if __name__ == "__main__":
150150
env_tags += "-e {}={} ".format("DOCKER_MYSQL_PHP_CLIENT_TAG", tag)
151151
elif image == "yandex/clickhouse-postgresql-java-client":
152152
env_tags += "-e {}={} ".format("DOCKER_POSTGRESQL_JAVA_CLIENT_TAG", tag)
153+
elif image == "yandex/clickhouse-integration-test":
154+
env_tags += "-e {}={}".format("DOCKER_BASE_TAG", tag)
153155
else:
154156
raise Exception("Unknown image {}".format(image))
155157

tests/integration/test_adaptive_granularity/test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212
node1 = cluster.add_instance('node1', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True)
1313
node2 = cluster.add_instance('node2', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True)
1414

15-
node3 = cluster.add_instance('node3', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server:19.6.3.18', with_installed_binary=True)
15+
node3 = cluster.add_instance('node3', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server', tag='19.6.3.18', with_installed_binary=True)
1616
node4 = cluster.add_instance('node4', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True)
1717

18-
node5 = cluster.add_instance('node5', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server:19.1.15', with_installed_binary=True)
18+
node5 = cluster.add_instance('node5', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server', tag='19.1.15', with_installed_binary=True)
1919
node6 = cluster.add_instance('node6', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True)
2020

21-
node7 = cluster.add_instance('node7', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server:19.6.3.18', stay_alive=True, with_installed_binary=True)
22-
node8 = cluster.add_instance('node8', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server:19.1.15', stay_alive=True, with_installed_binary=True)
21+
node7 = cluster.add_instance('node7', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server', tag='19.6.3.18', stay_alive=True, with_installed_binary=True)
22+
node8 = cluster.add_instance('node8', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server', tag='19.1.15', stay_alive=True, with_installed_binary=True)
2323

24-
node9 = cluster.add_instance('node9', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml', 'configs/merge_tree_settings.xml'], with_zookeeper=True, image='yandex/clickhouse-server:19.1.15', stay_alive=True, with_installed_binary=True)
25-
node10 = cluster.add_instance('node10', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml', 'configs/merge_tree_settings.xml'], with_zookeeper=True, image='yandex/clickhouse-server:19.6.3.18', stay_alive=True, with_installed_binary=True)
24+
node9 = cluster.add_instance('node9', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml', 'configs/merge_tree_settings.xml'], with_zookeeper=True, image='yandex/clickhouse-server', tag='19.1.15', stay_alive=True, with_installed_binary=True)
25+
node10 = cluster.add_instance('node10', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml', 'configs/merge_tree_settings.xml'], with_zookeeper=True, image='yandex/clickhouse-server', tag='19.6.3.18', stay_alive=True, with_installed_binary=True)
2626

27-
node11 = cluster.add_instance('node11', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server:19.1.15', stay_alive=True, with_installed_binary=True)
28-
node12 = cluster.add_instance('node12', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server:19.1.15', stay_alive=True, with_installed_binary=True)
27+
node11 = cluster.add_instance('node11', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server', tag='19.1.15', stay_alive=True, with_installed_binary=True)
28+
node12 = cluster.add_instance('node12', config_dir="configs", main_configs=['configs/remote_servers.xml', 'configs/log_conf.xml'], with_zookeeper=True, image='yandex/clickhouse-server', tag='19.1.15', stay_alive=True, with_installed_binary=True)
2929

3030

3131
def prepare_single_pair_with_setting(first_node, second_node, group):

tests/integration/test_adaptive_granularity_different_settings/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
node2 = cluster.add_instance('node2', with_zookeeper=True)
88

99
# no adaptive granularity by default
10-
node3 = cluster.add_instance('node3', image='yandex/clickhouse-server:19.9.5.36', with_installed_binary=True, stay_alive=True)
10+
node3 = cluster.add_instance('node3', image='yandex/clickhouse-server', tag='19.9.5.36', with_installed_binary=True, stay_alive=True)
1111

1212
@pytest.fixture(scope="module")
1313
def start_cluster():

tests/integration/test_adaptive_granularity_replicated/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
node1 = cluster.add_instance('node1', with_zookeeper=True)
1313
node2 = cluster.add_instance('node2', with_zookeeper=True)
14-
node3 = cluster.add_instance('node3', with_zookeeper=True, image='yandex/clickhouse-server:19.1.14', with_installed_binary=True)
14+
node3 = cluster.add_instance('node3', with_zookeeper=True, image='yandex/clickhouse-server', tag='19.1.14', with_installed_binary=True)
1515

1616
@pytest.fixture(scope="module")
1717
def start_cluster():

tests/integration/test_backup_with_other_granularity/test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
cluster = ClickHouseCluster(__file__)
66

77

8-
node1 = cluster.add_instance('node1', with_zookeeper=True, image='yandex/clickhouse-server:19.4.5.35', stay_alive=True, with_installed_binary=True)
9-
node2 = cluster.add_instance('node2', with_zookeeper=True, image='yandex/clickhouse-server:19.4.5.35', stay_alive=True, with_installed_binary=True)
10-
node3 = cluster.add_instance('node3', with_zookeeper=True, image='yandex/clickhouse-server:19.4.5.35', stay_alive=True, with_installed_binary=True)
8+
node1 = cluster.add_instance('node1', with_zookeeper=True, image='yandex/clickhouse-server', tag='19.4.5.35', stay_alive=True, with_installed_binary=True)
9+
node2 = cluster.add_instance('node2', with_zookeeper=True, image='yandex/clickhouse-server', tag='19.4.5.35', stay_alive=True, with_installed_binary=True)
10+
node3 = cluster.add_instance('node3', with_zookeeper=True, image='yandex/clickhouse-server', tag='19.4.5.35', stay_alive=True, with_installed_binary=True)
1111
node4 = cluster.add_instance('node4')
1212

1313

tests/integration/test_backward_compatibility/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from helpers.cluster import ClickHouseCluster
55

66
cluster = ClickHouseCluster(__file__)
7-
node1 = cluster.add_instance('node1', with_zookeeper=True, image='yandex/clickhouse-server:19.17.8.54', stay_alive=True, with_installed_binary=True)
7+
node1 = cluster.add_instance('node1', with_zookeeper=True, image='yandex/clickhouse-server', tag='19.17.8.54', stay_alive=True, with_installed_binary=True)
88
node2 = cluster.add_instance('node2', with_zookeeper=True)
99

1010
@pytest.fixture(scope="module")

tests/integration/test_backward_compatibility/test_aggregate_function_state_avg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
cluster = ClickHouseCluster(__file__)
77
node1 = cluster.add_instance('node1',
8-
with_zookeeper=False, image='yandex/clickhouse-server:19.16.9.37', stay_alive=True, with_installed_binary=True)
8+
with_zookeeper=False, image='yandex/clickhouse-server', tag='19.16.9.37', stay_alive=True, with_installed_binary=True)
99
node2 = cluster.add_instance('node2',
10-
with_zookeeper=False, image='yandex/clickhouse-server:19.16.9.37', stay_alive=True, with_installed_binary=True)
10+
with_zookeeper=False, image='yandex/clickhouse-server', tag='19.16.9.37', stay_alive=True, with_installed_binary=True)
1111
node3 = cluster.add_instance('node3', with_zookeeper=False)
1212
node4 = cluster.add_instance('node4', with_zookeeper=False)
1313

0 commit comments

Comments
 (0)