ClickHouse® is a real-time analytics DBMS
Go to file
Azat Khuzhin 2cfbc27f13 Fix incorrect memory accounting because of merges/mutations
In case of merges/mutations, separate MemoryTracker object is used, to
track memory separately, to report this metrics.

However, the tail of those allocations hadn't been taken into account,
and in case of lots of mutations/merges it can be significant.

100% reproducible with the following example:

Start the server w/o frequent sync with RSS:

    $ clickhouse-server -C /src/programs/server/config.xml -- --asynchronous_metrics_update_period_s=86400

Run the following snippet:

    create table data (key Int, value Nullable(Decimal(38, 0))) engine=ReplicatedMergeTree('/ch/data', '1') order by key
    insert into data values (1, -13028236692093846346337460743176821145)
    alter table data modify column value UInt256
    Code: 341. DB::Exception: Received from localhost:9000. DB::Exception: Exception happened during execution of mutation 'mutation_2.txt' with part 'all_1_1_0' reason: 'Code: 407. DB::Exception: Convert overflow: while executing 'FUNCTION _CAST(value :: 1, 'UInt256' :: 2) -> _CAST(value, 'UInt256') UInt256 : 3': (while reading from part ./store/dd9/dd9ef183-1270-4877-af22-8a000bdcc1b8/all_1_1_0/): While executing MergeTreeInOrder. (DECIMAL_OVERFLOW) (version 22.12.1.1)'. This error maybe retryable or not. In case of unretryable error, mutation can be killed with KILL MUTATION query. (UNFINISHED)

And track the memory:

    select value/1e9 from system.metrics where metric like 'MemoryTracking'

Reported-by: @filimonov
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-11-22 19:40:35 +01:00
.github Merge pull request #43373 from ClickHouse/trying_to_split_checks 2022-11-19 13:42:15 +01:00
base Revert "Add global flags to base/ libraries" 2022-11-10 11:32:27 +01:00
benchmark Remove old file 2022-07-12 20:28:02 +02:00
cmake Merge pull request #43082 from Algunenano/werror_base 2022-11-22 19:18:44 +01:00
contrib Merge branch 'master' into manual_snapshot_for_keeper 2022-11-03 08:55:01 +01:00
docker Fix backward compatibility check 2022-11-21 12:51:51 +01:00
docs Merge pull request #42033 from mark-polokhov/BSONEachRow 2022-11-22 14:45:21 +01:00
packages Fix ##8685 - added systemd sd_notify implementation 2022-11-20 19:34:12 +02:00
programs Merge pull request #43400 from socketpair/sd_notify 2022-11-22 18:07:50 +01:00
rust Corrosion fixes + review fixes 2022-09-16 00:05:21 +03:00
src Fix incorrect memory accounting because of merges/mutations 2022-11-22 19:40:35 +01:00
tests Merge pull request #43409 from azat/local/fix-uaf 2022-11-22 19:27:08 +01:00
utils Merge pull request #42033 from mark-polokhov/BSONEachRow 2022-11-22 14:45:21 +01:00
website move-images-to-clickhouse-presentations 2022-08-10 04:04:56 +02:00
.clang-format add BeforeLambdaBody to .clang-format 2022-02-11 16:51:45 +01:00
.clang-tidy Function name normalization fix functions header 2022-10-04 17:29:33 +02:00
.editorconfig Changed tabs to spaces in editor configs and in style guide [#CLICKHOUSE-3]. 2017-04-01 11:35:09 +03:00
.git-blame-ignore-revs Add files with revision to ignore for git blame 2022-09-13 23:05:56 +02:00
.gitattributes Ignore core.autocrlf for tests references 2022-10-05 09:13:27 +02:00
.gitignore Merge remote-tracking branch 'origin/master' into revive-sqlancer 2022-10-26 08:31:00 +00:00
.gitmodules add Morton Coding (ZCurve) 2022-10-19 15:59:25 +02:00
.pylintrc Cover deprecated bad-* pylint options with black 2022-06-08 14:18:28 +02:00
.snyk Add exclusions from the Snyk scan 2022-10-31 17:47:02 +01:00
.vimrc Changed tabs to spaces in editor configs and in style guide [#CLICKHOUSE-3]. 2017-04-01 11:35:09 +03:00
.yamllint Drop truthy.check-keys from yamllint (does not supported on CI) 2021-02-21 06:15:36 +03:00
AUTHORS Update AUTHORS 2021-09-22 11:38:03 +03:00
CHANGELOG.md Add #43072 2022-11-17 21:03:18 +01:00
CMakeLists.txt Merge pull request #43082 from Algunenano/werror_base 2022-11-22 19:18:44 +01:00
CODE_OF_CONDUCT.md Add minimal code of conduct #9676 2020-03-16 12:44:28 +03:00
CONTRIBUTING.md Mention ClickHouse CLA in CONTRIBUTING.md (#32697) 2021-12-14 03:47:19 +03:00
format_sources allow several <graphite> targets (#603) 2017-03-21 23:08:09 +04:00
LICENSE Update year 2022-01-27 01:01:27 +03:00
PreLoad.cmake Update PreLoad.cmake 2022-08-26 18:30:05 +08:00
README.md Update README.md 2022-10-28 13:58:14 -06:00
SECURITY.md Merge pull request #43365 from ClickHouse/update-security-on-tag 2022-11-18 22:39:17 +01:00

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 a quick high-level overview of ClickHouse on the main page.
  • ClickHouse Cloud ClickHouse as a service, built by the creators and maintainers.
  • Tutorial shows how to set up and query a 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 chatting with ClickHouse users in real-time.
  • Blog contains various ClickHouse-related articles, as well as announcements and reports about events.
  • Code Browser (Woboq) with syntax highlight and navigation.
  • Code Browser (github.dev) with syntax highlight, powered by github.dev.
  • Contacts can help to get your questions answered if there are any.

Upcoming events

  • v22.11 Release Webinar Original creator, co-founder, and CTO of ClickHouse Alexey Milovidov will walk us through the highlights of the release, provide live demos, and share vision into what is coming in the roadmap.
  • ClickHouse Meetup at the Deutsche Bank office in Berlin Hear from Deutsche Bank on why they chose ClickHouse for big sensitive data in a regulated environment. The ClickHouse team will then present how ClickHouse is used for real time financial data analytics, including tick data, trade analytics and risk management.
  • AWS re:Invent Core members of the ClickHouse team -- including 2 of our founders -- will be at re:Invent from November 29 to December 3. We are available on the show floor, but are also determining interest in holding an event during the time there.