Skip to content

Instantly share code, notes, and snippets.

View kolobaev's full-sized avatar

Vladimir Kolobaev kolobaev

View GitHub Profile
CREATE MATERIALIZED VIEW graphite.names
(
`Name` String,
`Date` Date
)
ENGINE = ReplicatedReplacingMergeTree('/clickhouse/tables/replicator_common/graphite.names', '{replica}', Date)
PARTITION BY toYYYYMM(Date)
ORDER BY (Name, Date)
SETTINGS index_granularity = 8192 AS
SELECT DISTINCT
CREATE TABLE graphite.tagged
(
`Date` Date,
`Name` String CODEC(ZSTD(1)),
`Path` String CODEC(ZSTD(1)),
`Tags` Array(String),
`Version` UInt32,
`Host` LowCardinality(String) CODEC(ZSTD(1)),
`Hostname` LowCardinality(String) CODEC(ZSTD(1)),
`Namespace` LowCardinality(String) CODEC(ZSTD(1)),
2020.12.09 14:55:51.134536 [ 11729 ] {} <Error> graphite.metrics: auto DB::StorageReplicatedMergeTree::queueTask()::(anonymous class)::operator()(DB::StorageReplicatedMergeTree::LogEntryPtr &) const: Code: 235, e.displayText() = DB::Exception: Part 20161101_20161101_29901593_29901601_2 (state Committed) already exists, Stack trace (when copying this message, always include the lines below):
0. DB::MergeTreeData::renameTempPartAndReplace(std::__1::shared_ptr<DB::IMergeTreeDataPart>&, SimpleIncrement*, DB::MergeTreeData::Transaction*, std::__1::unique_lock<std::__1::mutex>&, std::__1::vector<std::__1::shared_ptr<DB::IMergeTreeDataPart const>, std::__1::allocator<std::__1::shared_ptr<DB::IMergeTreeDataPart const> > >*) @ 0xe0bf922 in /usr/bin/clickhouse
1. DB::MergeTreeData::renameTempPartAndReplace(std::__1::shared_ptr<DB::IMergeTreeDataPart>&, SimpleIncrement*, DB::MergeTreeData::Transaction*) @ 0xe0c087d in /usr/bin/clickhouse
2. DB::StorageReplicatedMergeTree::fetchPart(std::__1::basic_string<char, std::__1
Thread 141 "QueryPipelineEx" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f5b4e2a5700 (LWP 5951)]
libunwind::DwarfInstructions<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::evaluateExpression (
expression=<optimized out>, addressSpace=..., registers=..., initialStackValue=<optimized out>)
at ../contrib/libunwind/src/DwarfInstructions.hpp:301
301 ../contrib/libunwind/src/DwarfInstructions.hpp: No such file or directory.
(gdb) bt
#0 libunwind::DwarfInstructions<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::evaluateExpression (
expression=<optimized out>, addressSpace=..., registers=..., initialStackValue=<optimized out>)
at ../contrib/libunwind/src/DwarfInstructions.hpp:301
@kolobaev
kolobaev / gist:0f83b9be367af77b7deca56beb0ed90c
Created November 10, 2020 16:38
clcikhouse segfault #1
(gdb) bt
#0 libunwind::DwarfInstructions<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::evaluateExpression (
expression=<optimized out>, addressSpace=..., registers=..., initialStackValue=<optimized out>)
at ../contrib/libunwind/src/DwarfInstructions.hpp:301
#1 0x0000000011efec5a in libunwind::DwarfInstructions<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::getCFA (
addressSpace=..., prolog=..., registers=...) at ../contrib/libunwind/src/DwarfInstructions.hpp:72
#2 libunwind::DwarfInstructions<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::stepWithDwarf (addressSpace=...,
pc=<optimized out>, fdeStart=<optimized out>, registers=...) at ../contrib/libunwind/src/DwarfInstructions.hpp:164
#3 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::stepWithDwarfFDE (this=0x7f4ad1ceebd0)
at ../contrib/libunwind/src/UnwindCursor.hpp:933
2020.11.10 16:28:04.174076 [ 48902 ] {} <Trace> graphite.data_rev: Renaming temporary part tmp_fetch_20201110_214607_214607_0 to 20201110_214607_214607_0.
2020.11.10 16:28:04.174333 [ 49049 ] {759b7ef42d2013d01c2fb1d063027446::7e601074b7cab507} <Trace> AggregatingTransform: Aggregated. 0 to 0 rows (from 0.00 B) in 0.021112294 sec. (0.0 rows/sec., 0.00 B/sec.)
2020.11.10 16:28:04.174337 [ 34427 ] {759b7ef42d2013d01c2fb1d063027446::7e601074b7cab507} <Trace> AggregatingTransform: Aggregated. 0 to 0 rows (from 0.00 B) in 0.021028329 sec. (0.0 rows/sec., 0.00 B/sec.)
2020.11.10 16:28:04.174381 [ 34423 ] {759b7ef42d2013d01c2fb1d063027446::7e601074b7cab507} <Trace> AggregatingTransform: Aggregated. 0 to 0 rows (from 0.00 B) in 0.021097418 sec. (0.0 rows/sec., 0.00 B/sec.)
2020.11.10 16:28:04.174381 [ 4333 ] {759b7ef42d2013d01c2fb1d063027446::7e601074b7cab507} <Trace> AggregatingTransform: Aggregated. 0 to 0 rows (from 0.00 B) in 0.021125629 sec. (0.0 rows/sec., 0.00 B/sec.)
2020.11.10 16:28:04.174670 [ 34432 ] {759b
@kolobaev
kolobaev / gist:f388077c40a1940588a1ec8075df922e
Created November 10, 2020 13:32
ClickHouse 20.10.3.30 crashed
2020.11.10 16:28:38.136660 [ 62863 ] {} <Warning> graphite.data2: Removing temporary directory /var/lib/clickhouse/data/graphite/data2/tmp_merge_20201107_20201110_49353_75824_23/
2020.11.10 16:28:38.645842 [ 62832 ] {} <Warning> graphite.series2: Tried to commit obsolete part 20201110_20201110_759029_759158_70 covered by 20201110_20201110_759029_759185_78 (state Committed)
2020.11.10 16:28:50.510349 [ 66015 ] {} <Warning> TCPHandler: Client has not sent any data.
2020.11.10 16:28:50.519333 [ 66015 ] {} <Error> ServerErrorHandler: Code: 101, e.displayText() = DB::NetException: Unexpected packet from client, Stack trace (when copying this message, always include the lines below):
0. DB::TCPHandler::receiveHello() @ 0xe56c988 in /usr/bin/clickhouse
1. DB::TCPHandler::runImpl() @ 0xe568299 in /usr/bin/clickhouse
2. DB::TCPHandler::run() @ 0xe575ca7 in /usr/bin/clickhouse
3. Poco::Net::TCPServerConnection::start() @ 0x10d4dd6f in /usr/bin/clickhouse
4. Poco::Net::TCPServerDispatcher::run() @ 0x10d4f77e in /usr/bi
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
2020.04.01 18:01:15.942147 [ 26174 ] {} <Warning> graphite.series (ReplicatedMergeTreeQueue): Mutation with version 1909196 not found in partition ID 201912 (trying to mutate part 20191201_20191228_962857_1623700_316_1909195)
2020.04.01 18:01:15.946294 [ 26174 ] {} <Error> graphite.series: DB::StorageReplicatedMergeTree::queueTask()::<lambda(DB::StorageReplicatedMergeTree::LogEntryPtr&)>: Code: 33, e.displayText() = DB::Exception: Cannot read all data. Bytes read: 0. Bytes expected: 4., Stack trace (when copying this message, always include the lines below):
0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x102e0d8c in /usr/bin/clickhouse
1. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x8f2d989 in /usr/bin/clickhouse
2. DB::ReadBuffer::readStrict(char*, unsigned long) @ 0x8f662af in /usr/bin/clickhouse
3. DB::DataTypeNumberBase<unsigned int>::des
2020.04.01 17:39:33.666337 [ 26205 ] {} <Warning> graphite.series (ReplicatedMergeTreePartCheckThread): Checking part 20191201_20191228_962857_1623700_316_1909195
2020.04.01 17:39:33.666465 [ 26179 ] {} <Error> graphite.series: DB::StorageReplicatedMergeTree::queueTask()::<lambda(DB::StorageReplicatedMergeTree::LogEntryPtr&)>: Code: 246, e.displayText() = DB::Exception: Bad size of marks file '/var/lib/clickhouse/data/graphite/series/20191201_20191228_962857_1623700_316_1909195/Path.mrk': 504048, must be: 336032, Stack trace (when copying this message, always include the lines below):
0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x102e0d8c in /usr/bin/clickhouse
1. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x8f2d989 in /usr/bin/clickhouse
2. ? @ 0xd884474 in /usr/bin/clickhouse
3. std::__1::pair<std::__1::shared_ptr<DB::MarksInCompressedFile