ClickHouse® is a real-time analytics DBMS
Go to file
Kevin Michel aa3f4003c8
Fix hanging DDL queries on Replicated database
There was a race condition when issuing a DDL query on a replica just
after a new replica was added.

If the DDL query is issued after the new replica adds itself to the
list of replicas, but before the new replica has finished its
recovery, then the first replica adds the new replica to the list of
replicas to wait to confirm the query was replicated.

Meanwhile, the new replica is still in recovery and applies queries
from the /metadata snapshot. When it's done, it bumps its log_ptr
without marking the corresponding log entries (if any) as finished.

The first replica then waits until distributed_ddl_task_timeout
expires and wrongly assumes the query was not replicated.

The issue is fixed by remembering the max_log_ptr at the exact point
where the replica adds itself to the list of replicas, then mark as
finished all queries that happened between that max_log_ptr and the
max_log_ptr of the metadata snapshot used in recovery.

The bug was randomly observed during a downstream test. It can be
reproduced more easily by inserting a sleep of a few seconds at the
end of createReplicaNodesInZooKeeper, enough to have time to issue a
DDL query on the first replica.
2021-09-24 12:51:52 +02:00
.github Update 85_bug-report.md 2021-08-25 02:26:31 +03:00
base Merge pull request #28888 from azat/mysql-in-fix 2021-09-18 15:53:40 +03:00
benchmark Benchmark script fix 2021-07-29 13:02:10 +03:00
cmake Merge branch 'master' into ccache-fix 2021-09-16 18:53:24 +00:00
contrib Merge pull request #28759 from nikitamikhaylov/enable-gcc-11 2021-09-12 15:56:57 +03:00
debian Merge pull request #28759 from nikitamikhaylov/enable-gcc-11 2021-09-12 15:56:57 +03:00
docker Merge pull request #28046 from syominsergey/fix-build-clang-13-2 2021-09-13 12:11:38 +03:00
docs Merge pull request #28952 from fuzzERot/h3-functions 2021-09-18 14:27:11 +03:00
programs Merge pull request #28888 from azat/mysql-in-fix 2021-09-18 15:53:40 +03:00
src Fix hanging DDL queries on Replicated database 2021-09-24 12:51:52 +02:00
tests Update clickhouse-test 2021-09-19 01:05:17 +03:00
utils Update version_date.tsv after release 21.7.10.4 2021-09-18 11:46:19 +03:00
website [website] move js around (#29152) 2021-09-18 10:49:15 +03:00
.arcignore
.clang-format
.clang-tidy Revert "Revert "Fix tidy"" 2021-09-06 12:16:52 +03:00
.editorconfig
.gitattributes
.gitignore
.gitmodules Initial: replacing hardcoded toString for enums with magic_enum 2021-09-06 16:24:03 +02:00
.potato.yml
.pylintrc
.vimrc
.yamllint
AUTHORS
CHANGELOG.md Update CHANGELOG.md 2021-09-09 00:34:45 +03:00
CMakeLists.txt better flag check 2021-09-15 12:26:27 +08:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
docker-compose.yml
format_sources
LICENSE
PreLoad.cmake
README.md Update README.md 2021-08-28 14:51:55 +03:00
release Proper build 2021-08-24 00:09:19 +00:00
SECURITY.md Update SECURITY.md 2021-08-23 16:10:41 +03:00
uncrustify.cfg
ya.make

ClickHouse — open source distributed column-oriented DBMS

ClickHouse® is an open-source column-oriented database management system that allows generating analytical data reports in real time.

  • Official website has quick high-level overview of ClickHouse on main page.
  • Tutorial shows how to set up and query small ClickHouse cluster.
  • Documentation provides more in-depth information.
  • YouTube channel has a lot of content about ClickHouse in video format.
  • Slack and Telegram allow to chat with ClickHouse users in real-time.
  • Blog contains various ClickHouse-related articles, as well as announcements and reports about events.
  • Code Browser with syntax highlight and navigation.
  • Contacts can help to get your questions answered if there are any.