diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index bd0282d50ce..0e914c656fc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,7 +12,7 @@ Changelog category (leave one): - Non-significant (changelog entry is not needed) -Changelog entry (up to few sentences, not needed for non-significant PRs): +Changelog entry (up to few sentences, required except for Non-significant/Documentation categories): ... diff --git a/dbms/src/Common/getNumberOfPhysicalCPUCores.cpp b/dbms/src/Common/getNumberOfPhysicalCPUCores.cpp index dc681200a2d..98c2f88bd6a 100644 --- a/dbms/src/Common/getNumberOfPhysicalCPUCores.cpp +++ b/dbms/src/Common/getNumberOfPhysicalCPUCores.cpp @@ -16,15 +16,11 @@ unsigned getNumberOfPhysicalCPUCores() { #if USE_CPUID cpu_raw_data_t raw_data; - if (0 != cpuid_get_raw_data(&raw_data)) - throw DB::Exception("Cannot cpuid_get_raw_data: " + std::string(cpuid_error()), DB::ErrorCodes::CPUID_ERROR); - cpu_id_t data; - if (0 != cpu_identify(&raw_data, &data)) - throw DB::Exception("Cannot cpu_identify: " + std::string(cpuid_error()), DB::ErrorCodes::CPUID_ERROR); /// On Xen VMs, libcpuid returns wrong info (zero number of cores). Fallback to alternative method. - if (data.num_logical_cpus == 0) + /// Also, libcpuid does not support some CPUs like AMD Hygon C86 7151. + if (0 != cpuid_get_raw_data(&raw_data) || 0 != cpu_identify(&raw_data, &data) || data.num_logical_cpus == 0) return std::thread::hardware_concurrency(); unsigned res = data.num_cores * data.total_logical_cpus / data.num_logical_cpus; @@ -38,6 +34,7 @@ unsigned getNumberOfPhysicalCPUCores() if (res != 0) return res; + #elif USE_CPUINFO uint32_t cores = 0; if (cpuinfo_initialize()) diff --git a/dbms/tests/integration/test_storage_s3/test_server.py b/dbms/tests/integration/test_storage_s3/server.py similarity index 99% rename from dbms/tests/integration/test_storage_s3/test_server.py rename to dbms/tests/integration/test_storage_s3/server.py index 08a1904d1f2..712af20759d 100644 --- a/dbms/tests/integration/test_storage_s3/test_server.py +++ b/dbms/tests/integration/test_storage_s3/server.py @@ -23,9 +23,10 @@ import time import uuid import xml.etree.ElementTree +BASE_DIR = os.path.dirname(__file__) logging.getLogger().setLevel(logging.INFO) -file_handler = logging.FileHandler("/var/log/clickhouse-server/test-server.log", "a", encoding="utf-8") +file_handler = logging.FileHandler(os.path.join(BASE_DIR, "test-server.log"), "a", encoding="utf-8") file_handler.setFormatter(logging.Formatter("%(asctime)s %(message)s")) logging.getLogger().addHandler(file_handler) logging.getLogger().addHandler(logging.StreamHandler()) diff --git a/dbms/tests/integration/test_storage_s3/test.py b/dbms/tests/integration/test_storage_s3/test.py index c5e7d2a7cf1..212a54260c2 100644 --- a/dbms/tests/integration/test_storage_s3/test.py +++ b/dbms/tests/integration/test_storage_s3/test.py @@ -38,7 +38,7 @@ def started_cluster(): cluster.start() cluster.communication_port = 10000 - instance.copy_file_to_container(os.path.join(os.path.dirname(__file__), "test_server.py"), "test_server.py") + instance.copy_file_to_container(os.path.join(os.path.dirname(__file__), "server.py"), "test_server.py") cluster.bucket = "abc" instance.exec_in_container(["python", "test_server.py", str(cluster.communication_port), cluster.bucket], detach=True) cluster.mock_host = instance.ip_address