diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml
index 7bb5ac65140..fa980a95a39 100644
--- a/.github/workflows/debug.yml
+++ b/.github/workflows/debug.yml
@@ -2,7 +2,7 @@
name: Debug
'on':
- [push, pull_request, release]
+ [push, pull_request, release, workflow_dispatch]
jobs:
DebugInfo:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dad9a25ab26..4f1a6c05730 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -314,6 +314,15 @@ if (ENABLE_BUILD_PATH_MAPPING)
set (CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
endif ()
+option (ENABLE_BUILD_PROFILING "Enable profiling of build time" OFF)
+if (ENABLE_BUILD_PROFILING)
+ if (COMPILER_CLANG)
+ set (COMPILER_FLAGS "${COMPILER_FLAGS} -ftime-trace")
+ else ()
+ message (${RECONFIGURE_MESSAGE_LEVEL} "Build profiling is only available with CLang")
+ endif ()
+endif ()
+
if (${CMAKE_VERSION} VERSION_LESS "3.12.4")
# CMake < 3.12 doesn't support setting 20 as a C++ standard version.
# We will add C++ standard controlling flag in CMAKE_CXX_FLAGS manually for now.
diff --git a/base/base/getAvailableMemoryAmount.cpp b/base/base/getAvailableMemoryAmount.cpp
index d2f794e8952..e9bbbd95caf 100644
--- a/base/base/getAvailableMemoryAmount.cpp
+++ b/base/base/getAvailableMemoryAmount.cpp
@@ -14,8 +14,8 @@
uint64_t getAvailableMemoryAmountOrZero()
{
-#if defined(_SC_AVPHYS_PAGES) // linux
- return getPageSize() * sysconf(_SC_AVPHYS_PAGES);
+#if defined(_SC_PHYS_PAGES) // linux
+ return getPageSize() * sysconf(_SC_PHYS_PAGES);
#elif defined(__FreeBSD__)
struct vmtotal vmt;
size_t vmt_size = sizeof(vmt);
diff --git a/base/base/phdr_cache.cpp b/base/base/phdr_cache.cpp
index 20a755ed7a4..36a9b4f1f62 100644
--- a/base/base/phdr_cache.cpp
+++ b/base/base/phdr_cache.cpp
@@ -2,7 +2,7 @@
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif
-/// This code was based on the code by Fedor Korotkiy (prime@yandex-team.ru) for YT product in Yandex.
+/// This code was based on the code by Fedor Korotkiy https://www.linkedin.com/in/fedor-korotkiy-659a1838/
#include
diff --git a/base/base/phdr_cache.h b/base/base/phdr_cache.h
index d2854ece0bc..b522710c4c4 100644
--- a/base/base/phdr_cache.h
+++ b/base/base/phdr_cache.h
@@ -1,6 +1,6 @@
#pragma once
-/// This code was based on the code by Fedor Korotkiy (prime@yandex-team.ru) for YT product in Yandex.
+/// This code was based on the code by Fedor Korotkiy https://www.linkedin.com/in/fedor-korotkiy-659a1838/
/** Collects all dl_phdr_info items and caches them in a static array.
* Also rewrites dl_iterate_phdr with a lock-free version which consults the above cache
diff --git a/base/daemon/BaseDaemon.h b/base/daemon/BaseDaemon.h
index 54a74369dce..152a431922c 100644
--- a/base/daemon/BaseDaemon.h
+++ b/base/daemon/BaseDaemon.h
@@ -76,10 +76,10 @@ public:
/// return none if daemon doesn't exist, reference to the daemon otherwise
static std::optional> tryGetInstance() { return tryGetInstance(); }
- /// В Graphite компоненты пути(папки) разделяются точкой.
- /// У нас принят путь формата root_path.hostname_yandex_ru.key
- /// root_path по умолчанию one_min
- /// key - лучше группировать по смыслу. Например "meminfo.cached" или "meminfo.free", "meminfo.total"
+ /// Graphite metric name has components separated by dots.
+ /// We used to have the following format: root_path.hostname_clickhouse_com.key
+ /// root_path - one_min by default
+ /// key - something that makes sense. Examples: "meminfo.cached" or "meminfo.free", "meminfo.total".
template
void writeToGraphite(const std::string & key, const T & value, const std::string & config_name = DEFAULT_GRAPHITE_CONFIG_NAME, time_t timestamp = 0, const std::string & custom_root_path = "")
{
diff --git a/contrib/sysroot b/contrib/sysroot
index bbcac834526..e9fb375d0a1 160000
--- a/contrib/sysroot
+++ b/contrib/sysroot
@@ -1 +1 @@
-Subproject commit bbcac834526d90d1e764164b861be426891d1743
+Subproject commit e9fb375d0a1e5ebfd74c043f088f2342552103f8
diff --git a/debian/.gitignore b/debian/.gitignore
deleted file mode 100644
index b4432556de7..00000000000
--- a/debian/.gitignore
+++ /dev/null
@@ -1,18 +0,0 @@
-control
-copyright
-tmp/
-clickhouse-benchmark/
-clickhouse-client.docs
-clickhouse-client/
-clickhouse-common-static-dbg/
-clickhouse-common-static.docs
-clickhouse-common-static/
-clickhouse-server-base/
-clickhouse-server-common/
-clickhouse-server/
-debhelper-build-stamp
-files
-*.debhelper.log
-*.debhelper
-*.substvars
-
diff --git a/debian/.pbuilderrc b/debian/.pbuilderrc
deleted file mode 100644
index 485906f6198..00000000000
--- a/debian/.pbuilderrc
+++ /dev/null
@@ -1,223 +0,0 @@
-#
-# sudo apt install pbuilder fakeroot debhelper debian-archive-keyring debian-keyring
-#
-# ubuntu:
-# prepare old (trusty or earlier) host system:
-
-# sudo ln -s gutsy /usr/share/debootstrap/scripts/eoan
-# sudo ln -s gutsy /usr/share/debootstrap/scripts/disco
-# sudo ln -s gutsy /usr/share/debootstrap/scripts/cosmic
-# sudo ln -s gutsy /usr/share/debootstrap/scripts/artful
-# sudo ln -s gutsy /usr/share/debootstrap/scripts/bionic
-# sudo ln -s sid /usr/share/debootstrap/scripts/buster
-# build ubuntu:
-# sudo DIST=bionic pbuilder create --configfile debian/.pbuilderrc && DIST=bionic pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=cosmic pbuilder create --configfile debian/.pbuilderrc && DIST=cosmic pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=disco pbuilder create --configfile debian/.pbuilderrc && DIST=disco pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=eoan pbuilder create --configfile debian/.pbuilderrc && DIST=eoan pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=devel pbuilder create --configfile debian/.pbuilderrc && DIST=devel pdebuild --configfile debian/.pbuilderrc
-# build debian:
-# sudo DIST=stable pbuilder create --configfile debian/.pbuilderrc && DIST=stable pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=testing pbuilder create --configfile debian/.pbuilderrc && DIST=testing pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=unstable pbuilder create --configfile debian/.pbuilderrc && DIST=unstable pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=experimental pbuilder create --configfile debian/.pbuilderrc && DIST=experimental pdebuild --configfile debian/.pbuilderrc
-# build i386 experimental:
-# sudo DIST=trusty ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=trusty ARCH=i386 pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=xenial ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=xenial ARCH=i386 pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=zesty ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=zesty ARCH=i386 pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=artful ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=artful ARCH=i386 pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=bionic ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=bionic ARCH=i386 pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=stable ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=stable ARCH=i386 pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=testing ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=testing ARCH=i386 pdebuild --configfile debian/.pbuilderrc
-# sudo DIST=experimental ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=experimental ARCH=i386 pdebuild --configfile debian/.pbuilderrc
-# test gcc-9
-# env DEB_CC=gcc-9 DEB_CXX=g++-9 EXTRAPACKAGES="g++-9 gcc-9" DIST=disco pdebuild --configfile debian/.pbuilderrc
-# use only clang:
-# env DEB_CC=clang-8 DEB_CXX=clang++-8 EXTRAPACKAGES=clang-8 DIST=disco pdebuild --configfile debian/.pbuilderrc
-# env DEB_CC=clang-5.0 DEB_CXX=clang++-5.0 EXTRAPACKAGES=clang-5.0 DIST=artful pdebuild --configfile debian/.pbuilderrc
-# clang+asan:
-# env DEB_CC=clang-5.0 DEB_CXX=clang++-5.0 EXTRAPACKAGES="clang-5.0 libc++abi-dev libc++-dev" CMAKE_FLAGS="-DENABLE_TCMALLOC=0 -DENABLE_UNWIND=0 -DCMAKE_BUILD_TYPE=Asan" DIST=artful pdebuild --configfile debian/.pbuilderrc
-# clang+tsan:
-# env DEB_CC=clang-5.0 DEB_CXX=clang++-5.0 EXTRAPACKAGES="clang-5.0 libc++abi-dev libc++-dev" CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Tsan" DIST=artful pdebuild --configfile debian/.pbuilderrc
-# without sse for old systems and some VM:
-# env DH_VERBOSE=1 CMAKE_FLAGS="-DHAVE_SSE41=0 -DHAVE_SSE42=0 -DHAVE_POPCNT=0 -DHAVE_SSE2_INTRIN=0 -DSSE2FLAG=' ' -DHAVE_SSE42_INTRIN=0 -DSSE4FLAG=' ' -DHAVE_PCLMULQDQ_INTRIN=0 -DPCLMULFLAG=' '" DIST=artful pdebuild --configfile debian/.pbuilderrc
-
-# Note: on trusty host creating some future dists can fail (debootstrap error).
-
-# Your packages built here: /var/cache/pbuilder/*-*/result
-
-# from https://wiki.debian.org/PbuilderTricks :
-
-# Codenames for Debian suites according to their alias. Update these when
-# needed.
-UNSTABLE_CODENAME="sid"
-TESTING_CODENAME="buster"
-STABLE_CODENAME="stretch"
-STABLE_BACKPORTS_SUITE="$STABLE_CODENAME-backports"
-
-# List of Debian suites.
-DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME $STABLE_BACKPORTS_SUITE
- "experimental" "unstable" "testing" "stable")
-
-# List of Ubuntu suites. Update these when needed.
-UBUNTU_SUITES=("eoan" "disco" "cosmic" "bionic" "artful" "zesty" "xenial" "trusty" "devel")
-
-# Set a default distribution if none is used. Note that you can set your own default (i.e. ${DIST:="unstable"}).
-HOST_DIST=`lsb_release --short --codename`
-: ${DIST:="$HOST_DIST"}
-
-# Optionally change Debian codenames in $DIST to their aliases.
-case "$DIST" in
- $UNSTABLE_CODENAME)
- DIST="unstable"
- ;;
- $TESTING_CODENAME)
- DIST="testing"
- ;;
- $STABLE_CODENAME)
- DIST="stable"
- ;;
-esac
-
-# Optionally set the architecture to the host architecture if none set. Note
-# that you can set your own default (i.e. ${ARCH:="i386"}).
-: ${ARCH:="$(dpkg --print-architecture)"}
-
-NAME="$DIST"
-if [ -n "${ARCH}" ]; then
- NAME="$NAME-$ARCH"
- DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}")
-fi
-
-BASETGZ=${SET_BASETGZ}
-BASETGZ=${BASETGZ:="/var/cache/pbuilder/$NAME-base.tgz"}
-DISTRIBUTION="$DIST"
-BUILDRESULT=${SET_BUILDRESULT}
-BUILDRESULT=${BUILDRESULT:="/var/cache/pbuilder/$NAME/result/"}
-APTCACHE="/var/cache/pbuilder/$NAME/aptcache/"
-BUILDPLACE="/var/cache/pbuilder/build/"
-ALLOWUNTRUSTED=${SET_ALLOWUNTRUSTED:=${ALLOWUNTRUSTED}}
-
-#DEBOOTSTRAPOPTS=( '--variant=buildd' $SET_DEBOOTSTRAPOPTS )
-
-
-if $(echo ${DEBIAN_SUITES[@]} | grep -q $DIST); then
- # Debian configuration
- OSNAME=debian
- MIRRORSITE=${SET_MIRRORSITE="http://deb.debian.org/$OSNAME/"}
- COMPONENTS="main contrib non-free"
- if $(echo "$STABLE_CODENAME stable" | grep -q $DIST); then
- OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $STABLE_BACKPORTS_SUITE $COMPONENTS"
- fi
- # APTKEYRINGS=/usr/share/keyrings/debian-archive-keyring.gpg
-
- case "$HOST_DIST" in
- "trusty" )
- DEBOOTSTRAPOPTS+=( '--no-check-gpg' )
- ;;
- *)
- DEBOOTSTRAPOPTS+=( '--keyring' '/usr/share/keyrings/debian-archive-keyring.gpg' )
- # DEBOOTSTRAPOPTS+=( '--keyring' '/usr/share/keyrings/debian-keyring.gpg' )
- esac
-elif $(echo ${UBUNTU_SUITES[@]} | grep -q $DIST); then
- # Ubuntu configuration
- OSNAME=ubuntu
-
- if [[ "$ARCH" == "amd64" || "$ARCH" == "i386" ]]; then
- MIRRORSITE=${SET_MIRRORSITE="http://archive.ubuntu.com/$OSNAME/"}
- else
- MIRRORSITE=${SET_MIRRORSITE="http://ports.ubuntu.com/ubuntu-ports/"}
- fi
-
- COMPONENTS="main restricted universe multiverse"
-
- OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $DIST-updates main restricted universe multiverse"
- OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $DIST-security main restricted universe multiverse"
- OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $DIST-proposed main restricted universe multiverse"
-
- case "$DIST" in
- "trusty" | "xenial" )
- OTHERMIRROR="$OTHERMIRROR | deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/$OSNAME $DIST main"
- ALLOWUNTRUSTED=yes
- ;;
- esac
-
- # deb http://apt.llvm.org/zesty/ llvm-toolchain-zesty-5.0 main
-else
- echo "Unknown distribution: $DIST"
- exit 1
-fi
-
-echo "using $NAME $OSNAME $DIST $ARCH $LOGNAME $MIRRORSITE"
-
-case "$DIST" in
- "trusty")
- # ccache broken
- ;;
- *)
- CCACHEDIR=${SET_CCACHEDIR:="/var/cache/pbuilder/ccache"}
- ;;
-esac
-
-# old systems with default gcc <= 6
-case "$DIST" in
- "trusty" | "xenial" | "stable" )
- export DEB_CC=gcc-7
- export DEB_CXX=g++-7
- ;;
-esac
-
-if [ "$ARCH" != arm64 ]; then
- case "$DIST" in
-# TODO: fix llvm-8 and use for "disco" and "eoan"
- "experimental")
- EXTRAPACKAGES+=" liblld-8-dev libclang-8-dev llvm-8-dev liblld-8 "
- export CMAKE_FLAGS="-DLLVM_VERSION=8 $CMAKE_FLAGS"
- ;;
- "eoan" | "disco" | "cosmic" | "testing" | "unstable")
- EXTRAPACKAGES+=" liblld-7-dev libclang-7-dev llvm-7-dev liblld-7 "
- export CMAKE_FLAGS="-DLLVM_VERSION=7 $CMAKE_FLAGS"
- ;;
- "bionic")
- EXTRAPACKAGES+=" liblld-6.0-dev libclang-6.0-dev liblld-6.0 "
- export CMAKE_FLAGS="-DLLVM_VERSION=6 $CMAKE_FLAGS"
- ;;
- "artful" )
- EXTRAPACKAGES+=" liblld-5.0-dev libclang-5.0-dev liblld-5.0 "
- ;;
- esac
-else
- export CMAKE_FLAGS="-DENABLE_EMBEDDED_COMPILER=0 $CMAKE_FLAGS"
-fi
-
-# Will test symbols
-#EXTRAPACKAGES+=" gdb "
-
-# For killall in pbuilder-hooks:
-EXTRAPACKAGES+=" psmisc "
-
-[[ $CCACHE_PREFIX == 'distcc' ]] && EXTRAPACKAGES+=" $CCACHE_PREFIX " && USENETWORK=yes && export DISTCC_DIR=/var/cache/pbuilder/distcc
-
-[[ $ARCH == 'i386' ]] && EXTRAPACKAGES+=" libssl-dev "
-
-export DEB_BUILD_OPTIONS=parallel=`nproc`
-
-# Floating bug with permissions:
-[ -n "$CCACHEDIR" ] && sudo mkdir -p $CCACHEDIR
-[ -n "$CCACHEDIR" ] && sudo chmod -R a+rwx $CCACHEDIR || true
-# chown -R $BUILDUSERID:$BUILDUSERID $CCACHEDIR
-
-
-# Do not create source package inside pbuilder (-b)
-# Use current dir to make package (by default should have src archive)
-# echo "3.0 (native)" > debian/source/format
-# OR
-# pdebuild -b --debbuildopts "--source-option=--format=\"3.0 (native)\""
-# OR
-DEBBUILDOPTS="-b --source-option=--format=\"3.0 (native)\""
-
-HOOKDIR="debian/pbuilder-hooks"
-
-#echo "DEBOOTSTRAPOPTS=${DEBOOTSTRAPOPTS[@]}"
-#echo "ALLOWUNTRUSTED=${ALLOWUNTRUSTED} OTHERMIRROR=${OTHERMIRROR}"
-#echo "EXTRAPACKAGES=${EXTRAPACKAGES}"
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index 43b46f561c8..00000000000
--- a/debian/changelog
+++ /dev/null
@@ -1,5 +0,0 @@
-clickhouse (22.1.1.1) unstable; urgency=low
-
- * Modified source code
-
- -- clickhouse-release Thu, 09 Dec 2021 00:32:58 +0300
diff --git a/debian/changelog.in b/debian/changelog.in
deleted file mode 100644
index ce2ee757999..00000000000
--- a/debian/changelog.in
+++ /dev/null
@@ -1,5 +0,0 @@
-clickhouse (@VERSION_STRING@) unstable; urgency=low
-
- * Modified source code
-
- -- @AUTHOR@ <@EMAIL@> @DATE@
diff --git a/debian/clickhouse-client.install b/debian/clickhouse-client.install
deleted file mode 100644
index f19f937b318..00000000000
--- a/debian/clickhouse-client.install
+++ /dev/null
@@ -1,7 +0,0 @@
-usr/bin/clickhouse-client
-usr/bin/clickhouse-local
-usr/bin/clickhouse-compressor
-usr/bin/clickhouse-benchmark
-usr/bin/clickhouse-format
-usr/bin/clickhouse-obfuscator
-etc/clickhouse-client/config.xml
diff --git a/debian/clickhouse-common-static.install b/debian/clickhouse-common-static.install
deleted file mode 100644
index 087a6dbba8f..00000000000
--- a/debian/clickhouse-common-static.install
+++ /dev/null
@@ -1,5 +0,0 @@
-usr/bin/clickhouse
-usr/bin/clickhouse-odbc-bridge
-usr/bin/clickhouse-library-bridge
-usr/bin/clickhouse-extract-from-config
-usr/share/bash-completion/completions
diff --git a/debian/clickhouse-server.cron.d b/debian/clickhouse-server.cron.d
deleted file mode 100644
index 1e5d4aab733..00000000000
--- a/debian/clickhouse-server.cron.d
+++ /dev/null
@@ -1 +0,0 @@
-#*/10 * * * * root ((which service > /dev/null 2>&1 && (service clickhouse-server condstart ||:)) || /etc/init.d/clickhouse-server condstart) > /dev/null 2>&1
diff --git a/debian/clickhouse-server.docs b/debian/clickhouse-server.docs
deleted file mode 100644
index e12d6533be2..00000000000
--- a/debian/clickhouse-server.docs
+++ /dev/null
@@ -1,4 +0,0 @@
-LICENSE
-AUTHORS
-README.md
-CHANGELOG.md
diff --git a/debian/clickhouse-server.init b/debian/clickhouse-server.init
deleted file mode 100755
index 1695f6286b8..00000000000
--- a/debian/clickhouse-server.init
+++ /dev/null
@@ -1,227 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides: clickhouse-server
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Should-Start: $time $network
-# Should-Stop: $network
-# Short-Description: clickhouse-server daemon
-### END INIT INFO
-#
-# NOTES:
-# - Should-* -- script can start if the listed facilities are missing, unlike Required-*
-#
-# For the documentation [1]:
-#
-# [1]: https://wiki.debian.org/LSBInitScripts
-
-CLICKHOUSE_USER=clickhouse
-CLICKHOUSE_GROUP=${CLICKHOUSE_USER}
-SHELL=/bin/bash
-PROGRAM=clickhouse-server
-CLICKHOUSE_GENERIC_PROGRAM=clickhouse
-CLICKHOUSE_PROGRAM_ENV=""
-EXTRACT_FROM_CONFIG=${CLICKHOUSE_GENERIC_PROGRAM}-extract-from-config
-CLICKHOUSE_CONFDIR=/etc/$PROGRAM
-CLICKHOUSE_LOGDIR=/var/log/clickhouse-server
-CLICKHOUSE_LOGDIR_USER=root
-CLICKHOUSE_DATADIR=/var/lib/clickhouse
-if [ -d "/var/lock" ]; then
- LOCALSTATEDIR=/var/lock
-else
- LOCALSTATEDIR=/run/lock
-fi
-
-if [ ! -d "$LOCALSTATEDIR" ]; then
- mkdir -p "$LOCALSTATEDIR"
-fi
-
-CLICKHOUSE_BINDIR=/usr/bin
-CLICKHOUSE_CRONFILE=/etc/cron.d/clickhouse-server
-CLICKHOUSE_CONFIG=$CLICKHOUSE_CONFDIR/config.xml
-LOCKFILE=$LOCALSTATEDIR/$PROGRAM
-CLICKHOUSE_PIDDIR=/var/run/$PROGRAM
-CLICKHOUSE_PIDFILE="$CLICKHOUSE_PIDDIR/$PROGRAM.pid"
-# CLICKHOUSE_STOP_TIMEOUT=60 # Disabled by default. Place to /etc/default/clickhouse if you need.
-
-# Some systems lack "flock"
-command -v flock >/dev/null && FLOCK=flock
-
-# Override defaults from optional config file
-test -f /etc/default/clickhouse && . /etc/default/clickhouse
-
-
-die()
-{
- echo $1 >&2
- exit 1
-}
-
-
-# Check that configuration file is Ok.
-check_config()
-{
- if [ -x "$CLICKHOUSE_BINDIR/$EXTRACT_FROM_CONFIG" ]; then
- su -s $SHELL ${CLICKHOUSE_USER} -c "$CLICKHOUSE_BINDIR/$EXTRACT_FROM_CONFIG --config-file=\"$CLICKHOUSE_CONFIG\" --key=path" >/dev/null || die "Configuration file ${CLICKHOUSE_CONFIG} doesn't parse successfully. Won't restart server. You may use forcerestart if you are sure.";
- fi
-}
-
-
-initdb()
-{
- ${CLICKHOUSE_GENERIC_PROGRAM} install --user "${CLICKHOUSE_USER}" --pid-path "${CLICKHOUSE_PIDDIR}" --config-path "${CLICKHOUSE_CONFDIR}" --binary-path "${CLICKHOUSE_BINDIR}"
-}
-
-
-start()
-{
- ${CLICKHOUSE_GENERIC_PROGRAM} start --user "${CLICKHOUSE_USER}" --pid-path "${CLICKHOUSE_PIDDIR}" --config-path "${CLICKHOUSE_CONFDIR}" --binary-path "${CLICKHOUSE_BINDIR}"
-}
-
-
-stop()
-{
- ${CLICKHOUSE_GENERIC_PROGRAM} stop --pid-path "${CLICKHOUSE_PIDDIR}"
-}
-
-
-restart()
-{
- ${CLICKHOUSE_GENERIC_PROGRAM} restart --user "${CLICKHOUSE_USER}" --pid-path "${CLICKHOUSE_PIDDIR}" --config-path "${CLICKHOUSE_CONFDIR}" --binary-path "${CLICKHOUSE_BINDIR}"
-}
-
-
-forcestop()
-{
- ${CLICKHOUSE_GENERIC_PROGRAM} stop --force --pid-path "${CLICKHOUSE_PIDDIR}"
-}
-
-
-service_or_func()
-{
- if [ -x "/bin/systemctl" ] && [ -f /etc/systemd/system/clickhouse-server.service ] && [ -d /run/systemd/system ]; then
- systemctl $1 $PROGRAM
- else
- $1
- fi
-}
-
-forcerestart()
-{
- forcestop
- # Should not use 'start' function if systemd active
- service_or_func start
-}
-
-use_cron()
-{
- # 1. running systemd
- if [ -x "/bin/systemctl" ] && [ -f /etc/systemd/system/clickhouse-server.service ] && [ -d /run/systemd/system ]; then
- return 1
- fi
- # 2. disabled by config
- if [ -z "$CLICKHOUSE_CRONFILE" ]; then
- return 2
- fi
- return 0
-}
-# returns false if cron disabled (with systemd)
-enable_cron()
-{
- use_cron && sed -i 's/^#*//' "$CLICKHOUSE_CRONFILE"
-}
-# returns false if cron disabled (with systemd)
-disable_cron()
-{
- use_cron && sed -i 's/^#*/#/' "$CLICKHOUSE_CRONFILE"
-}
-
-
-is_cron_disabled()
-{
- use_cron || return 0
-
- # Assumes that either no lines are commented or all lines are commented.
- # Also please note, that currently cron file for ClickHouse has only one line (but some time ago there was more).
- grep -q -E '^#' "$CLICKHOUSE_CRONFILE";
-}
-
-
-main()
-{
- # See how we were called.
- EXIT_STATUS=0
- case "$1" in
- start)
- service_or_func start && enable_cron
- ;;
- stop)
- disable_cron
- service_or_func stop
- ;;
- restart)
- service_or_func restart && enable_cron
- ;;
- forcestop)
- disable_cron
- forcestop
- ;;
- forcerestart)
- forcerestart && enable_cron
- ;;
- reload)
- service_or_func restart
- ;;
- condstart)
- service_or_func start
- ;;
- condstop)
- service_or_func stop
- ;;
- condrestart)
- service_or_func restart
- ;;
- condreload)
- service_or_func restart
- ;;
- initdb)
- initdb
- ;;
- enable_cron)
- enable_cron
- ;;
- disable_cron)
- disable_cron
- ;;
- *)
- echo "Usage: $0 {start|stop|status|restart|forcestop|forcerestart|reload|condstart|condstop|condrestart|condreload|initdb}"
- exit 2
- ;;
- esac
-
- exit $EXIT_STATUS
-}
-
-
-status()
-{
- ${CLICKHOUSE_GENERIC_PROGRAM} status --pid-path "${CLICKHOUSE_PIDDIR}"
-}
-
-
-# Running commands without need of locking
-case "$1" in
-status)
- status
- exit 0
- ;;
-esac
-
-
-(
- if $FLOCK -n 9; then
- main "$@"
- else
- echo "Init script is already running" && exit 1
- fi
-) 9> $LOCKFILE
diff --git a/debian/clickhouse-server.install b/debian/clickhouse-server.install
deleted file mode 100644
index b1475fdf162..00000000000
--- a/debian/clickhouse-server.install
+++ /dev/null
@@ -1,6 +0,0 @@
-usr/bin/clickhouse-server
-usr/bin/clickhouse-copier
-usr/bin/clickhouse-report
-etc/clickhouse-server/config.xml
-etc/clickhouse-server/users.xml
-etc/systemd/system/clickhouse-server.service
diff --git a/debian/clickhouse-server.postinst b/debian/clickhouse-server.postinst
deleted file mode 100644
index 419c13e3daf..00000000000
--- a/debian/clickhouse-server.postinst
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-set -e
-# set -x
-
-PROGRAM=clickhouse-server
-CLICKHOUSE_USER=${CLICKHOUSE_USER:=clickhouse}
-CLICKHOUSE_GROUP=${CLICKHOUSE_GROUP:=${CLICKHOUSE_USER}}
-# Please note that we don't support paths with whitespaces. This is rather ignorant.
-CLICKHOUSE_CONFDIR=${CLICKHOUSE_CONFDIR:=/etc/clickhouse-server}
-CLICKHOUSE_DATADIR=${CLICKHOUSE_DATADIR:=/var/lib/clickhouse}
-CLICKHOUSE_LOGDIR=${CLICKHOUSE_LOGDIR:=/var/log/clickhouse-server}
-CLICKHOUSE_BINDIR=${CLICKHOUSE_BINDIR:=/usr/bin}
-CLICKHOUSE_GENERIC_PROGRAM=${CLICKHOUSE_GENERIC_PROGRAM:=clickhouse}
-EXTRACT_FROM_CONFIG=${CLICKHOUSE_GENERIC_PROGRAM}-extract-from-config
-CLICKHOUSE_CONFIG=$CLICKHOUSE_CONFDIR/config.xml
-CLICKHOUSE_PIDDIR=/var/run/$PROGRAM
-
-[ -f /usr/share/debconf/confmodule ] && . /usr/share/debconf/confmodule
-[ -f /etc/default/clickhouse ] && . /etc/default/clickhouse
-
-if [ ! -f "/etc/debian_version" ]; then
- not_deb_os=1
-fi
-
-if [ "$1" = configure ] || [ -n "$not_deb_os" ]; then
-
- ${CLICKHOUSE_GENERIC_PROGRAM} install --user "${CLICKHOUSE_USER}" --group "${CLICKHOUSE_GROUP}" --pid-path "${CLICKHOUSE_PIDDIR}" --config-path "${CLICKHOUSE_CONFDIR}" --binary-path "${CLICKHOUSE_BINDIR}" --log-path "${CLICKHOUSE_LOGDIR}" --data-path "${CLICKHOUSE_DATADIR}"
-
- if [ -x "/bin/systemctl" ] && [ -f /etc/systemd/system/clickhouse-server.service ] && [ -d /run/systemd/system ]; then
- # if old rc.d service present - remove it
- if [ -x "/etc/init.d/clickhouse-server" ] && [ -x "/usr/sbin/update-rc.d" ]; then
- /usr/sbin/update-rc.d clickhouse-server remove
- fi
-
- /bin/systemctl daemon-reload
- /bin/systemctl enable clickhouse-server
- else
- # If you downgrading to version older than 1.1.54336 run: systemctl disable clickhouse-server
- if [ -x "/etc/init.d/clickhouse-server" ]; then
- if [ -x "/usr/sbin/update-rc.d" ]; then
- /usr/sbin/update-rc.d clickhouse-server defaults 19 19 >/dev/null || exit $?
- else
- echo # Other OS
- fi
- fi
- fi
-fi
diff --git a/debian/clickhouse-server.service b/debian/clickhouse-server.service
deleted file mode 100644
index 028b4fbf8ab..00000000000
--- a/debian/clickhouse-server.service
+++ /dev/null
@@ -1,27 +0,0 @@
-[Unit]
-Description=ClickHouse Server (analytic DBMS for big data)
-Requires=network-online.target
-# NOTE: that After/Wants=time-sync.target is not enough, you need to ensure
-# that the time was adjusted already, if you use systemd-timesyncd you are
-# safe, but if you use ntp or some other daemon, you should configure it
-# additionaly.
-After=time-sync.target network-online.target
-Wants=time-sync.target
-
-[Service]
-Type=simple
-User=clickhouse
-Group=clickhouse
-Restart=always
-RestartSec=30
-RuntimeDirectory=clickhouse-server
-ExecStart=/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid
-# Minus means that this file is optional.
-EnvironmentFile=-/etc/default/clickhouse
-LimitCORE=infinity
-LimitNOFILE=500000
-CapabilityBoundingSet=CAP_NET_ADMIN CAP_IPC_LOCK CAP_SYS_NICE CAP_NET_BIND_SERVICE
-
-[Install]
-# ClickHouse should not start from the rescue shell (rescue.target).
-WantedBy=multi-user.target
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index f599e28b8ab..00000000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-10
diff --git a/debian/control b/debian/control
deleted file mode 100644
index c5d98d98f41..00000000000
--- a/debian/control
+++ /dev/null
@@ -1,58 +0,0 @@
-Source: clickhouse
-Section: database
-Priority: optional
-Maintainer: Alexey Milovidov
-Build-Depends: debhelper (>= 9),
- cmake | cmake3,
- ninja-build,
- clang-13,
- llvm-13,
- lld-13,
- libc6-dev,
- tzdata
-Standards-Version: 3.9.8
-
-Package: clickhouse-client
-Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, clickhouse-common-static (= ${binary:Version})
-Replaces: clickhouse-compressor
-Conflicts: clickhouse-compressor
-Description: Client binary for ClickHouse
- ClickHouse is a column-oriented database management system
- that allows generating analytical data reports in real time.
- .
- This package provides clickhouse-client , clickhouse-local and clickhouse-benchmark
-
-Package: clickhouse-common-static
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Suggests: clickhouse-common-static-dbg
-Replaces: clickhouse-common, clickhouse-server-base
-Provides: clickhouse-common, clickhouse-server-base
-Description: Common files for ClickHouse
- ClickHouse is a column-oriented database management system
- that allows generating analytical data reports in real time.
- .
- This package provides common files for both clickhouse server and client
-
-Package: clickhouse-server
-Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, clickhouse-common-static (= ${binary:Version}), adduser
-Recommends: libcap2-bin
-Replaces: clickhouse-server-common, clickhouse-server-base
-Provides: clickhouse-server-common
-Description: Server binary for ClickHouse
- ClickHouse is a column-oriented database management system
- that allows generating analytical data reports in real time.
- .
- This package provides clickhouse common configuration files
-
-Package: clickhouse-common-static-dbg
-Architecture: any
-Section: debug
-Priority: optional
-Depends: ${misc:Depends}
-Replaces: clickhouse-common-dbg
-Conflicts: clickhouse-common-dbg
-Description: debugging symbols for clickhouse-common-static
- This package contains the debugging symbols for clickhouse-common.
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 414d472c13d..00000000000
--- a/debian/rules
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-# -pie only for static mode
-export DEB_BUILD_MAINT_OPTIONS=hardening=-all
-
-# because copy_headers.sh have hardcoded path to build/include_directories.txt
-BUILDDIR = obj-$(DEB_HOST_GNU_TYPE)
-CURDIR = $(shell pwd)
-DESTDIR = $(CURDIR)/debian/tmp
-
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-
-ifeq ($(CCACHE_PREFIX),distcc)
- THREADS_COUNT=$(shell distcc -j)
-endif
-ifeq ($(THREADS_COUNT),)
- THREADS_COUNT=$(shell nproc || grep -c ^processor /proc/cpuinfo || sysctl -n hw.ncpu || echo 4)
-endif
-DEB_BUILD_OPTIONS+=parallel=$(THREADS_COUNT)
-
-ifndef ENABLE_TESTS
- CMAKE_FLAGS += -DENABLE_TESTS=0
-else
-# To export binaries and from deb build we do not strip them. No need to run tests in deb build as we run them in CI
- DEB_BUILD_OPTIONS+= nocheck
- DEB_BUILD_OPTIONS+= nostrip
-endif
-
-ifndef MAKE_TARGET
- MAKE_TARGET = clickhouse-bundle
-endif
-
-CMAKE_FLAGS += -DENABLE_UTILS=0
-
-DEB_CC ?= $(shell which gcc-11 gcc-10 gcc-9 gcc | head -n1)
-DEB_CXX ?= $(shell which g++-11 g++-10 g++-9 g++ | head -n1)
-
-ifdef DEB_CXX
- DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
- DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
- CC := $(DEB_CC)
- CXX := $(DEB_CXX)
-else ifeq (clang,$(findstring clang,$(DEB_CXX)))
-# If we crosscompile with clang, it knows what to do
- CC := $(DEB_CC)
- CXX := $(DEB_CXX)
-else
- CC := $(DEB_HOST_GNU_TYPE)-$(DEB_CC)
- CXX := $(DEB_HOST_GNU_TYPE)-$(DEB_CXX)
-endif
-endif
-
-ifdef CXX
- CMAKE_FLAGS += -DCMAKE_CXX_COMPILER=`which $(CXX)`
-endif
-ifdef CC
- CMAKE_FLAGS += -DCMAKE_C_COMPILER=`which $(CC)`
-endif
-
-ifndef DISABLE_NINJA
- NINJA=$(shell which ninja)
-ifneq ($(NINJA),)
- CMAKE_FLAGS += -GNinja
- export MAKE=$(NINJA) $(NINJA_FLAGS)
-endif
-endif
-
-ifndef DH_VERBOSE
- CMAKE_FLAGS += -DCMAKE_VERBOSE_MAKEFILE=0
-endif
-
-# Useful for bulding on low memory systems
-ifndef DISABLE_PARALLEL
- DH_FLAGS += --parallel
-else
- THREADS_COUNT = 1
-endif
-
-%:
- dh $@ $(DH_FLAGS) --buildsystem=cmake
-
-override_dh_auto_configure:
- dh_auto_configure -- $(CMAKE_FLAGS)
-
-override_dh_auto_build:
- # Fix for ninja. Do not add -O.
- $(MAKE) -j$(THREADS_COUNT) -C $(BUILDDIR) $(MAKE_TARGET)
-
-override_dh_auto_test:
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
- cd $(BUILDDIR) && ctest -j$(THREADS_COUNT) -V
-endif
-
-# Disable config.guess and config.sub update
-override_dh_update_autotools_config:
-
-override_dh_clean:
- rm -rf debian/copyright debian/clickhouse-client.docs debian/clickhouse-common-static.docs
- dh_clean # -X contrib
-
-override_dh_strip:
- #https://www.debian.org/doc/debian-policy/ch-source.html#debian-rules-and-deb-build-options
-ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
- dh_strip -pclickhouse-common-static --dbg-package=clickhouse-common-static-dbg
-endif
-
-override_dh_install:
- # Making docs
- cp LICENSE debian/copyright
-
- ln -sf clickhouse-server.docs debian/clickhouse-client.docs
- ln -sf clickhouse-server.docs debian/clickhouse-common-static.docs
-
- # systemd compatibility
- mkdir -p $(DESTDIR)/etc/systemd/system/
- cp debian/clickhouse-server.service $(DESTDIR)/etc/systemd/system/
-
- dh_install --list-missing --sourcedir=$(DESTDIR)
-
-override_dh_auto_install:
- env DESTDIR=$(DESTDIR) $(MAKE) -j$(THREADS_COUNT) -C $(BUILDDIR) install
-
-override_dh_shlibdeps:
- true # We depend only on libc and dh_shlibdeps gives us wrong (too strict) dependency.
-
-override_dh_builddeb:
- dh_builddeb -- -Z gzip # Older systems don't have "xz", so use "gzip" instead.
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8d82b..00000000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/debian/source/options b/debian/source/options
deleted file mode 100644
index 0ceb3b9e28b..00000000000
--- a/debian/source/options
+++ /dev/null
@@ -1,9 +0,0 @@
-tar-ignore
-tar-ignore="build_*/*"
-tar-ignore="workspace/*"
-tar-ignore="contrib/poco/openssl/*"
-tar-ignore="contrib/poco/gradle/*"
-tar-ignore="contrib/poco/Data/SQLite/*"
-tar-ignore="contrib/poco/PDF/*"
-compression-level=3
-compression=gzip
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index ed3cab97ade..00000000000
--- a/debian/watch
+++ /dev/null
@@ -1,6 +0,0 @@
-version=4
-
-opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)-stable\.tar\.gz%clickhouse-$1.tar.gz%" \
- https://github.com/ClickHouse/ClickHouse/tags \
- (?:.*?/)?v?(\d[\d.]*)-stable\.tar\.gz debian uupdate
-
diff --git a/docker/test/performance-comparison/compare.sh b/docker/test/performance-comparison/compare.sh
index cdfa080a475..6297bbead70 100755
--- a/docker/test/performance-comparison/compare.sh
+++ b/docker/test/performance-comparison/compare.sh
@@ -362,19 +362,6 @@ function get_profiles
clickhouse-client --port $RIGHT_SERVER_PORT --query "select 1"
}
-function build_log_column_definitions
-{
-# FIXME This loop builds column definitons from TSVWithNamesAndTypes in an
-# absolutely atrocious way. This should be done by the file() function itself.
-for x in {right,left}-{addresses,{query,query-thread,trace,{async-,}metric}-log}.tsv
-do
- paste -d' ' \
- <(sed -n '1{s/\t/\n/g;p;q}' "$x" | sed 's/\(^.*$\)/"\1"/') \
- <(sed -n '2{s/\t/\n/g;p;q}' "$x" ) \
- | tr '\n' ', ' | sed 's/,$//' > "$x.columns"
-done
-}
-
# Build and analyze randomization distribution for all queries.
function analyze_queries
{
@@ -382,8 +369,6 @@ rm -v analyze-commands.txt analyze-errors.log all-queries.tsv unstable-queries.t
rm -rf analyze ||:
mkdir analyze analyze/tmp ||:
-build_log_column_definitions
-
# Split the raw test output into files suitable for analysis.
# To debug calculations only for a particular test, substitute a suitable
# wildcard here, e.g. `for test_file in modulo-raw.tsv`.
@@ -422,12 +407,10 @@ create table partial_query_times engine File(TSVWithNamesAndTypes,
-- Process queries that were run normally, on both servers.
create view left_query_log as select *
- from file('left-query-log.tsv', TSVWithNamesAndTypes,
- '$(cat "left-query-log.tsv.columns")');
+ from file('left-query-log.tsv', TSVWithNamesAndTypes);
create view right_query_log as select *
- from file('right-query-log.tsv', TSVWithNamesAndTypes,
- '$(cat "right-query-log.tsv.columns")');
+ from file('right-query-log.tsv', TSVWithNamesAndTypes);
create view query_logs as
select 0 version, query_id, ProfileEvents,
@@ -645,8 +628,6 @@ mkdir report report/tmp ||:
rm ./*.{rep,svg} test-times.tsv test-dump.tsv unstable.tsv unstable-query-ids.tsv unstable-query-metrics.tsv changed-perf.tsv unstable-tests.tsv unstable-queries.tsv bad-tests.tsv slow-on-client.tsv all-queries.tsv run-errors.tsv ||:
-build_log_column_definitions
-
cat analyze/errors.log >> report/errors.log ||:
cat profile-errors.log >> report/errors.log ||:
@@ -1028,8 +1009,7 @@ create table unstable_query_runs engine File(TSVWithNamesAndTypes,
;
create view query_log as select *
- from file('$version-query-log.tsv', TSVWithNamesAndTypes,
- '$(cat "$version-query-log.tsv.columns")');
+ from file('$version-query-log.tsv', TSVWithNamesAndTypes);
create table unstable_run_metrics engine File(TSVWithNamesAndTypes,
'unstable-run-metrics.$version.rep') as
@@ -1057,8 +1037,7 @@ create table unstable_run_metrics_2 engine File(TSVWithNamesAndTypes,
array join v, n;
create view trace_log as select *
- from file('$version-trace-log.tsv', TSVWithNamesAndTypes,
- '$(cat "$version-trace-log.tsv.columns")');
+ from file('$version-trace-log.tsv', TSVWithNamesAndTypes);
create view addresses_src as select addr,
-- Some functions change name between builds, e.g. '__clone' or 'clone' or
@@ -1067,8 +1046,7 @@ create view addresses_src as select addr,
[name, 'clone.S (filtered by script)', 'pthread_cond_timedwait (filtered by script)']
-- this line is a subscript operator of the above array
[1 + multiSearchFirstIndex(name, ['clone.S', 'pthread_cond_timedwait'])] name
- from file('$version-addresses.tsv', TSVWithNamesAndTypes,
- '$(cat "$version-addresses.tsv.columns")');
+ from file('$version-addresses.tsv', TSVWithNamesAndTypes);
create table addresses_join_$version engine Join(any, left, address) as
select addr address, name from addresses_src;
@@ -1195,15 +1173,12 @@ done
function report_metrics
{
-build_log_column_definitions
-
rm -rf metrics ||:
mkdir metrics
clickhouse-local --query "
create view right_async_metric_log as
- select * from file('right-async-metric-log.tsv', TSVWithNamesAndTypes,
- '$(cat right-async-metric-log.tsv.columns)')
+ select * from file('right-async-metric-log.tsv', TSVWithNamesAndTypes)
;
-- Use the right log as time reference because it may have higher precision.
@@ -1211,8 +1186,7 @@ create table metrics engine File(TSV, 'metrics/metrics.tsv') as
with (select min(event_time) from right_async_metric_log) as min_time
select metric, r.event_time - min_time event_time, l.value as left, r.value as right
from right_async_metric_log r
- asof join file('left-async-metric-log.tsv', TSVWithNamesAndTypes,
- '$(cat left-async-metric-log.tsv.columns)') l
+ asof join file('left-async-metric-log.tsv', TSVWithNamesAndTypes) l
on l.metric = r.metric and r.event_time <= l.event_time
order by metric, event_time
;
diff --git a/docker/test/stress/stress b/docker/test/stress/stress
index e42587e9a4d..d78de84f60d 100755
--- a/docker/test/stress/stress
+++ b/docker/test/stress/stress
@@ -83,15 +83,15 @@ def make_query_command(query):
def prepare_for_hung_check(drop_databases):
# FIXME this function should not exist, but...
- # ThreadFuzzer significantly slows down server and causes false-positive hung check failures
- call_with_retry("clickhouse client -q 'SYSTEM STOP THREAD FUZZER'")
-
# We attach gdb to clickhouse-server before running tests
# to print stacktraces of all crashes even if clickhouse cannot print it for some reason.
# However, it obstruct checking for hung queries.
logging.info("Will terminate gdb (if any)")
call_with_retry("kill -TERM $(pidof gdb)")
+ # ThreadFuzzer significantly slows down server and causes false-positive hung check failures
+ call_with_retry("clickhouse client -q 'SYSTEM STOP THREAD FUZZER'")
+
call_with_retry(make_query_command('SELECT 1 FORMAT Null'))
# Some tests execute SYSTEM STOP MERGES or similar queries.
diff --git a/docs/en/getting-started/example-datasets/ontime.md b/docs/en/getting-started/example-datasets/ontime.md
index efc807b75fa..87096354f1f 100644
--- a/docs/en/getting-started/example-datasets/ontime.md
+++ b/docs/en/getting-started/example-datasets/ontime.md
@@ -159,6 +159,10 @@ $ clickhouse-client --query "select count(*) from datasets.ontime"
!!! info "Info"
If you will run the queries described below, you have to use the full table name, `datasets.ontime`.
+
+!!! info "Info"
+ If you are using the prepared partitions or the Online Playground replace any occurrence of `IATA_CODE_Reporting_Airline` or `IATA_CODE_Reporting_Airline AS Carrier` in the following queries with `Carrier` (see `describe ontime`).
+
## Queries {#queries}
Q0.
diff --git a/docs/en/interfaces/cli.md b/docs/en/interfaces/cli.md
index eaf7a96ce42..a252f55de2c 100644
--- a/docs/en/interfaces/cli.md
+++ b/docs/en/interfaces/cli.md
@@ -124,7 +124,7 @@ You can pass parameters to `clickhouse-client` (all parameters have a default va
- `--time, -t` – If specified, print the query execution time to ‘stderr’ in non-interactive mode.
- `--stacktrace` – If specified, also print the stack trace if an exception occurs.
- `--config-file` – The name of the configuration file.
-- `--secure` – If specified, will connect to server over secure connection.
+- `--secure` – If specified, will connect to server over secure connection (TLS). You might need to configure your CA certificates in the [configuration file](#configuration_files). The available configuration settings are the same as for [server-side TLS configuration](../operations/server-configuration-parameters/settings.md#server_configuration_parameters-openssl).
- `--history_file` — Path to a file containing command history.
- `--param_` — Value for a [query with parameters](#cli-queries-with-parameters).
- `--hardware-utilization` — Print hardware utilization information in progress bar.
@@ -148,7 +148,12 @@ Example of a config file:
username
password
- False
+ true
+
+
+ /etc/ssl/cert.pem
+
+
```
diff --git a/docs/en/interfaces/http.md b/docs/en/interfaces/http.md
index d72fb4d6f17..ca2a165bbd8 100644
--- a/docs/en/interfaces/http.md
+++ b/docs/en/interfaces/http.md
@@ -5,11 +5,10 @@ toc_title: HTTP Interface
# HTTP Interface {#http-interface}
-The HTTP interface lets you use ClickHouse on any platform from any programming language. We use it for working from Java and Perl, as well as shell scripts. In other departments, the HTTP interface is used from Perl, Python, and Go. The HTTP interface is more limited than the native interface, but it has better compatibility.
+The HTTP interface lets you use ClickHouse on any platform from any programming language in a form of REST API. The HTTP interface is more limited than the native interface, but it has better language support.
By default, `clickhouse-server` listens for HTTP on port 8123 (this can be changed in the config).
-
-Sometimes, `curl` command is not available on user operating systems. On Ubuntu or Debian, run `sudo apt install curl`. Please refer this [documentation](https://curl.se/download.html) to install it before running the examples.
+HTTPS can be enabled as well with port 8443 by default.
If you make a `GET /` request without parameters, it returns 200 response code and the string which defined in [http_server_default_response](../operations/server-configuration-parameters/settings.md#server_configuration_parameters-http_server_default_response) default value “Ok.” (with a line feed at the end)
@@ -18,11 +17,12 @@ $ curl 'http://localhost:8123/'
Ok.
```
+Sometimes, `curl` command is not available on user operating systems. On Ubuntu or Debian, run `sudo apt install curl`. Please refer this [documentation](https://curl.se/download.html) to install it before running the examples.
+
Web UI can be accessed here: `http://localhost:8123/play`.
![Web UI](../images/play.png)
-
In health-check scripts use `GET /ping` request. This handler always returns “Ok.” (with a line feed at the end). Available from version 18.12.13. See also `/replicas_status` to check replica's delay.
``` bash
@@ -32,7 +32,7 @@ $ curl 'http://localhost:8123/replicas_status'
Ok.
```
-Send the request as a URL ‘query’ parameter, or as a POST. Or send the beginning of the query in the ‘query’ parameter, and the rest in the POST (we’ll explain later why this is necessary). The size of the URL is limited to 16 KB, so keep this in mind when sending large queries.
+Send the request as a URL ‘query’ parameter, or as a POST. Or send the beginning of the query in the ‘query’ parameter, and the rest in the POST (we’ll explain later why this is necessary). The size of the URL is limited to 1 MiB by default, this can be changed with the `http_max_uri_size` setting.
If successful, you receive the 200 response code and the result in the response body.
If an error occurs, you receive the 500 response code and an error description text in the response body.
diff --git a/docs/en/introduction/adopters.md b/docs/en/introduction/adopters.md
index 98eea85bbfa..2c5c0b7cd52 100644
--- a/docs/en/introduction/adopters.md
+++ b/docs/en/introduction/adopters.md
@@ -28,6 +28,7 @@ toc_title: Adopters
| Badoo | Dating | Timeseries | — | 1.6 mln events/sec (2018) | [Slides in Russian, December 2019](https://presentations.clickhouse.com/meetup38/forecast.pdf) |
| Beeline | Telecom | Data Platform | — | — | [Blog post, July 2021](https://habr.com/en/company/beeline/blog/567508/) |
| Benocs | Network Telemetry and Analytics | Main Product | — | — | [Slides in English, October 2017](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup9/lpm.pdf) |
+| Better Stack | Cloud, SaaS | Log Management | - | - | [Official Website](https://betterstack.com/logtail) |
| BIGO | Video | Computing Platform | — | — | [Blog Article, August 2020](https://www.programmersought.com/article/44544895251/) |
| BiliBili | Video sharing | — | — | — | [Blog post, June 2021](https://chowdera.com/2021/06/20210622012241476b.html) |
| Bloomberg | Finance, Media | Monitoring | — | — | [Job opening, September 2021](https://careers.bloomberg.com/job/detail/94913), [slides, May 2018](https://www.slideshare.net/Altinity/http-analytics-for-6m-requests-per-second-using-clickhouse-by-alexander-bocharov) |
@@ -112,7 +113,7 @@ toc_title: Adopters
| NLMK | Steel | Monitoring | — | — | [Article in Russian, Jan 2022](https://habr.com/en/company/nlmk/blog/645943/) |
| NOC Project | Network Monitoring | Analytics | Main Product | — | [Official Website](https://getnoc.com/features/big-data/) |
| Noction | Network Technology | Main Product | — | — | [Official Website](https://www.noction.com/news/irp-3-11-remote-triggered-blackholing-capability)
-| ntop | Network Monitoning | Monitoring | — | — | [Official website, Jan 2022](https://www.ntop.org/ntop/historical-traffic-analysis-at-scale-using-clickhouse-with-ntopng/) |
+| ntop | Network Monitoning | Monitoring | — | — | [Official website, January 2022](https://www.ntop.org/ntop/historical-traffic-analysis-at-scale-using-clickhouse-with-ntopng/) |
| Nuna Inc. | Health Data Analytics | — | — | — | [Talk in English, July 2020](https://youtu.be/GMiXCMFDMow?t=170) |
| Ok.ru | Social Network | — | 72 servers | 810 TB compressed, 50bn rows/day, 1.5 TB/day | [SmartData conference, October 2021](https://assets.ctfassets.net/oxjq45e8ilak/4JPHkbJenLgZhBGGyyonFP/57472ec6987003ec4078d0941740703b/____________________ClickHouse_______________________.pdf) |
| Omnicomm | Transportation Monitoring | — | — | — | [Facebook post, October 2021](https://www.facebook.com/OmnicommTeam/posts/2824479777774500) |
@@ -123,6 +124,7 @@ toc_title: Adopters
| Panelbear | Analytics | Monitoring and Analytics | — | — | [Tech Stack, November 2020](https://panelbear.com/blog/tech-stack/) |
| Percent 百分点 | Analytics | Main Product | — | — | [Slides in Chinese, June 2019](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup24/4.%20ClickHouse万亿数据双中心的设计与实践%20.pdf) |
| Percona | Performance analysis | Percona Monitoring and Management | — | — | [Official website, Mar 2020](https://www.percona.com/blog/2020/03/30/advanced-query-analysis-in-percona-monitoring-and-management-with-direct-clickhouse-access/) |
+| PingCAP | Analytics | Real-Time Transactional and Analytical Processing | - | - | [GitHub, TiFlash/TiDB](https://github.com/pingcap/tiflash) |
| Plausible | Analytics | Main Product | — | — | [Blog post, June 2020](https://twitter.com/PlausibleHQ/status/1273889629087969280) |
| PostHog | Product Analytics | Main Product | — | — | [Release Notes, October 2020](https://posthog.com/blog/the-posthog-array-1-15-0), [Blog, November 2021](https://posthog.com/blog/how-we-turned-clickhouse-into-our-eventmansion) |
| Postmates | Delivery | — | — | — | [Talk in English, July 2020](https://youtu.be/GMiXCMFDMow?t=188) |
@@ -159,6 +161,7 @@ toc_title: Adopters
| Suning | E-Commerce | User behaviour analytics | — | — | [Blog article](https://www.sohu.com/a/434152235_411876) |
| Superwall | Monetization Tooling | Main product | — | — | [Word of mouth, Jan 2022](https://github.com/ClickHouse/ClickHouse/pull/33573) |
| Swetrix | Analytics | Main Product | — | — | [Source code](https://github.com/swetrix/swetrix-api) |
+| Synpse | Application Management | Main Product | - | - | [Tweet, January 2022](https://twitter.com/KRusenas/status/1483571168363880455) |
| Teralytics | Mobility | Analytics | — | — | [Tech blog](https://www.teralytics.net/knowledge-hub/visualizing-mobility-data-the-scalability-challenge) |
| Tencent | Big Data | Data processing | — | — | [Slides in Chinese, October 2018](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup19/5.%20ClickHouse大数据集群应用_李俊飞腾讯网媒事业部.pdf) |
| Tencent | Messaging | Logging | — | — | [Talk in Chinese, November 2019](https://youtu.be/T-iVQRuw-QY?t=5050) |
@@ -172,6 +175,7 @@ toc_title: Adopters
| UTMSTAT | Analytics | Main product | — | — | [Blog post, June 2020](https://vc.ru/tribuna/133956-striming-dannyh-iz-servisa-skvoznoy-analitiki-v-clickhouse) |
| Vercel | Traffic and Performance Analytics | — | — | — | Direct reference, October 2021 |
| VKontakte | Social Network | Statistics, Logging | — | — | [Slides in Russian, August 2018](https://github.com/ClickHouse/clickhouse-presentations/blob/master/meetup17/3_vk.pdf) |
+| VKontech | Distributed Systems | Migrating from MongoDB | - | - | [Blog, January 2022](https://vkontech.com/migrating-your-reporting-queries-from-a-general-purpose-db-mongodb-to-a-data-warehouse-clickhouse-performance-overview/) |
| VMware | Cloud | VeloCloud, SDN | — | — | [Product documentation](https://docs.vmware.com/en/vRealize-Operations-Manager/8.3/com.vmware.vcom.metrics.doc/GUID-A9AD72E1-C948-4CA2-971B-919385AB3CA8.html) |
| Walmart Labs | Internet, Retail | — | — | — | [Talk in English, July 2020](https://youtu.be/GMiXCMFDMow?t=144) |
| Wargaming | Games | | — | — | [Interview](https://habr.com/en/post/496954/) |
@@ -197,5 +201,6 @@ toc_title: Adopters
| ДомКлик | Real Estate | — | — | — | [Article in Russian, October 2021](https://habr.com/ru/company/domclick/blog/585936/) |
| АС "Стрела" | Transportation | — | — | — | [Job posting, Jan 2022](https://vk.com/topic-111905078_35689124?post=3553) |
| Piwik PRO | Web Analytics | — | — | — | [Official website, Dec 2018](https://piwik.pro/blog/piwik-pro-clickhouse-faster-efficient-reports/) |
+| Deepglint 格灵深瞳 | AI, Computer Vision | OLAP | — | — | [Official Website](https://www.deepglint.com/) |
[Original article](https://clickhouse.com/docs/en/introduction/adopters/)
diff --git a/docs/en/operations/clickhouse-keeper.md b/docs/en/operations/clickhouse-keeper.md
index a8ca2079070..26d61dabaf9 100644
--- a/docs/en/operations/clickhouse-keeper.md
+++ b/docs/en/operations/clickhouse-keeper.md
@@ -3,13 +3,10 @@ toc_priority: 66
toc_title: ClickHouse Keeper
---
-# [pre-production] ClickHouse Keeper {#clickHouse-keeper}
+# ClickHouse Keeper {#clickHouse-keeper}
ClickHouse server uses [ZooKeeper](https://zookeeper.apache.org/) coordination system for data [replication](../engines/table-engines/mergetree-family/replication.md) and [distributed DDL](../sql-reference/distributed-ddl.md) queries execution. ClickHouse Keeper is an alternative coordination system compatible with ZooKeeper.
-!!! warning "Warning"
- This feature is currently in the pre-production stage. We test it in our CI and on small internal installations.
-
## Implementation details {#implementation-details}
ZooKeeper is one of the first well-known open-source coordination systems. It's implemented in Java, has quite a simple and powerful data model. ZooKeeper's coordination algorithm called ZAB (ZooKeeper Atomic Broadcast) doesn't provide linearizability guarantees for reads, because each ZooKeeper node serves reads locally. Unlike ZooKeeper ClickHouse Keeper is written in C++ and uses [RAFT algorithm](https://raft.github.io/) [implementation](https://github.com/eBay/NuRaft). This algorithm allows to have linearizability for reads and writes, has several open-source implementations in different languages.
diff --git a/docs/en/operations/server-configuration-parameters/settings.md b/docs/en/operations/server-configuration-parameters/settings.md
index 301b348925f..fb53fd38fe3 100644
--- a/docs/en/operations/server-configuration-parameters/settings.md
+++ b/docs/en/operations/server-configuration-parameters/settings.md
@@ -366,12 +366,12 @@ Opens `https://tabix.io/` when accessing `http://localhost: http_port`.