Skip to content

Instantly share code, notes, and snippets.

View qoega's full-sized avatar

Ilya Yatsishin qoega

  • ClickHouse Inc.
  • Amsterdam
  • 16:04 (UTC +02:00)
View GitHub Profile
CREATE TABLE payment_types (
payment_type UInt8,
description String
)
ENGINE = MergeTree
ORDER BY payment_type;
INSERT INTO payment_types(payment_type, description) VALUES
(1, 'credit card'),
(2, 'cash'),
@qoega
qoega / log
Created September 27, 2021 07:56
01514_distributed_cancel_query_on_error
2021.09.27 12:15:47.443980 [ 18303 ] {7fb7c9f0-7501-4dfd-b00f-b584719f571c} <Debug> executeQuery: (from [::1]:45826) SELECT 'Running test <__main__.TestSuite object at 0x7fe690e551f0>/01514_distributed_cancel_query_on_error.sh from pid=666';
2021.09.27 12:15:47.444059 [ 18318 ] {3865b870-b48f-4e01-8d0d-c8899dcaafcc} <Trace> ContextAccess (default): Access granted: CREATE TABLE ON test_xwyba8.test_4170337A2E2D4E5E2D4F405C2622547D2A6B672F472B675C385E35376872655B3645292F5A765644
2021.09.27 12:15:47.444060 [ 2483 ] {5441cbd3-3a41-4934-8c69-445f627fcf46} <Trace> ContextAccess (default): Access granted: CREATE TABLE ON test_xwyba8.test_5B2B414A4740704177565D67323B22547D4C26705C747A752E303F5E68366A2D26352E436B555838
2021.09.27 12:15:47.444087 [ 5339 ] {fe90f0e3-a3ab-4176-938e-e76f6799014d} <Trace> ContextAccess (default): Access granted: CREATE TABLE ON test_xwyba8.test_7D2977612D2E32796A7060242C682856342B78494A7967722A356544643B2438265E39227B743267
2021.09.27 12:15:47.444261 [ 18303 ] {7fb7c9f0-7501-4dfd-b00f-b5847
@qoega
qoega / report
Created July 14, 2020 10:59
ThreadSanitizer: data race test_dictionaries_mysql integration test
Saved preprocessed configuration to '/var/lib/clickhouse//preprocessed_configs/config.xml'.
==1==WARNING: invalid path to external symbolizer!
==1==WARNING: Failed to use and restart external symbolizer!
==================
WARNING: ThreadSanitizer: data race (pid=1)
Write of size 4 at 0x7b3c00005af4 by thread T46 (mutexes: write M948143390988828912, write M387163642145980352):
#0 <null> <null> (clickhouse+0x15b22989)
#1 <null> <null> (clickhouse+0x15b1d5ae)
#2 <null> <null> (clickhouse+0x15a03274)
#3 <null> <null> (clickhouse+0x15a3072c)
2020-05-21 12:21:51 dh_builddeb -- -Z gzip # Older systems don't have "xz", so use "gzip" instead.
2020-05-21 12:21:51 dpkg-deb -Z gzip --build debian/clickhouse-client ..
2020-05-21 12:21:51 dpkg-deb -Z gzip --build debian/clickhouse-common-static ..
2020-05-21 12:21:51 dpkg-deb -Z gzip --build debian/clickhouse-server ..
2020-05-21 12:21:51 dpkg-deb -Z gzip --build debian/clickhouse-common-static-dbg ..
2020-05-21 12:21:51 dpkg-deb -Z gzip --build debian/clickhouse-test ..
2020-05-21 12:21:51 dpkg-deb: building package 'clickhouse-client' in '../clickhouse-client_20.5.1.3452+asan_all.deb'.
2020-05-21 12:21:51 dpkg-deb: building package 'clickhouse-common-static' in '../clickhouse-common-static_20.5.1.3452+asan_amd64.deb'.
2020-05-21 12:21:51 dpkg-deb: building package 'clickhouse-common-static-dbg' in '../clickhouse-common-static-dbg_20.5.1.3452+asan_amd64.deb'.
2020-05-21 12:21:51 dpkg-deb: building package 'clickhouse-server' in '../clickhouse-server_20.5.1.3452+asan_all.deb'.
@qoega
qoega / bt full
Created April 28, 2020 08:56
pthread_mutex_lock sigsegv
(gdb) bt full
#0 __GI___pthread_mutex_lock (mutex=mutex@entry=0x60 <boost::exception_detail::error_info_injector<boost::program_options::validation_error>::~error_info_injector()>) at ../nptl/pthread_mutex_lock.c:65
type = <optimized out>
__PRETTY_FUNCTION__ = "__pthread_mutex_lock"
id = <optimized out>
#1 0x0000000004ff6f8e in DB::pthread_mutex_lock (arg=arg@entry=0x60 <boost::exception_detail::error_info_injector<boost::program_options::validation_error>::~error_info_injector()>) at ../src/Common/ThreadFuzzer.cpp:269
ret = <optimized out>
#2 0x000000000c746e79 in std::__1::__libcpp_mutex_lock (__m=__m@entry=0x60 <boost::exception_detail::error_info_injector<boost::program_options::validation_error>::~error_info_injector()>) at ../contrib/libcxx/include/__threading_support:322
No locals.
#3 std::__1::mutex::lock (this=this@entry=0x60 <boost::exception_detail::error_info_injector<boost::program_options::validation_error>::~error_info_injector()>) at ../contrib/libcxx/src/mu
@qoega
qoega / gist:74cbb585cb3a2c5c7e67b0a3cf9ed2a8
Created April 27, 2020 08:57
grep /usr/share/clickhouse-test/config
test/stateless_with_coverage/run.sh:42:ln -s /usr/share/clickhouse-test/config/zookeeper.xml /etc/clickhouse-server/config.d/; \
test/stateless_with_coverage/run.sh:43: ln -s /usr/share/clickhouse-test/config/listen.xml /etc/clickhouse-server/config.d/; \
test/stateless_with_coverage/run.sh:44: ln -s /usr/share/clickhouse-test/config/part_log.xml /etc/clickhouse-server/config.d/; \
test/stateless_with_coverage/run.sh:45: ln -s /usr/share/clickhouse-test/config/text_log.xml /etc/clickhouse-server/config.d/; \
test/stateless_with_coverage/run.sh:46: ln -s /usr/share/clickhouse-test/config/metric_log.xml /etc/clickhouse-server/config.d/; \
test/stateless_with_coverage/run.sh:47: ln -s /usr/share/clickhouse-test/config/query_masking_rules.xml /etc/clickhouse-server/config.d/; \
test/stateless_with_coverage/run.sh:48: ln -s /usr/share/clickhouse-test/config/log_queries.xml /etc/clickhouse-server/users.d/; \
test/stateless_with_coverage/run.sh:49: ln -s /usr/share/clickhouse-test/config/readonl
@qoega
qoega / README
Created April 14, 2020 16:02
Reproduce File not found checksums.txt
1) Take master version of ClickHouse(20.4 for example)
2) Create database and tables
3) You can write data once or several times
4) Restart server several times (actually I write and restart server several times, but there is no other)
5) After several minutes I can see exceptions in log
@qoega
qoega / gist:37ed223082e15670265c985a78e43f9f
Created January 10, 2020 12:21
Open Issues ans Avg Open Issues Lifetime
SELECT
date,
avgIf(diff, created and not resolved) as avg_open_days,
countIf(created and not resolved) as cnt_open
FROM
(
SELECT
toDate( toString(y) || '-' || toString(m) || '-' || '01') as date,
dateDiff('day', created_at, date) as diff,
date >= created_at as created,