Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't delete a table if it is used by window view #35678

Closed
antip00 opened this issue Mar 28, 2022 · 1 comment · Fixed by #36967
Closed

Can't delete a table if it is used by window view #35678

antip00 opened this issue Mar 28, 2022 · 1 comment · Fixed by #36967
Assignees

Comments

@antip00
Copy link

antip00 commented Mar 28, 2022

clickhouse version: 22.2.2.1

if you create a table then create window view that uses this table and try to delete a table than drop table sync is stuck

reproduction

set allow_experimental_window_view = 1

create table qq(id Int64, x Int64) engine=MergeTree order by id

create window view wv as SELECT count(*) FROM qq GROUP BY tumble(now(), INTERVAL '5' SECOND)

drop table qq sync //<---stuck

Error message
2022.03.24 13:34:04.220882 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} MergeTask::PrepareStage: Merging 5 parts: from 202203_82728_82748_5 to 202203_82752_82752_0 into Compact
2022.03.24 13:34:04.220911 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} MergeTask::PrepareStage: Selected MergeAlgorithm: Horizontal
2022.03.24 13:34:04.220941 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} MergeTreeSequentialSource: Reading 2 marks from part 202203_82728_82748_5, total 1611 rows starting from the beginning of the part
2022.03.24 13:34:04.221021 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} MergeTreeSequentialSource: Reading 2 marks from part 202203_82749_82749_0, total 372 rows starting from the beginning of the part
2022.03.24 13:34:04.221078 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} MergeTreeSequentialSource: Reading 2 marks from part 202203_82750_82750_0, total 7 rows starting from the beginning of the part
2022.03.24 13:34:04.221132 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} MergeTreeSequentialSource: Reading 2 marks from part 202203_82751_82751_0, total 10 rows starting from the beginning of the part
2022.03.24 13:34:04.221184 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} MergeTreeSequentialSource: Reading 2 marks from part 202203_82752_82752_0, total 7 rows starting from the beginning of the part
2022.03.24 13:34:04.222531 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} MergeTask::MergeProjectionsStage: Merge sorted 2007 rows, containing 10 columns (10 merged, 0 gathered) in 0.001659891 sec., 1209115.5383094433 rows/sec., 366.08 MiB/sec.
2022.03.24 13:34:04.223042 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} MergedBlockOutputStream: filled checksums 202203_82728_82752_6 (state Temporary)
2022.03.24 13:34:04.223189 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} system.trace_log (0d3abe0f-bb61-4b8c-a610-8bb0ee559d34): Renaming temporary part tmp_merge_202203_82728_82752_6 to 202203_82728_82752_6.
2022.03.24 13:34:04.223244 [ 2593 ] {0d3abe0f-bb61-4b8c-a610-8bb0ee559d34::202203_82728_82752_6} system.trace_log (0d3abe0f-bb61-4b8c-a610-8bb0ee559d34) (MergerMutator): Merged 5 parts: from 202203_82728_82748_5 to 202203_82752_82752_0
2022.03.24 13:34:04.223273 [ 2593 ] {} MemoryTracker: Peak memory usage Mutate/Merge: 4.24 MiB.
2022.03.24 13:34:05.000088 [ 2761 ] {} AsynchronousMetrics: MemoryTracking: was 253.36 MiB, peak 2.12 GiB, will set to 255.01 MiB (RSS), difference: 1.64 MiB
2022.03.24 13:34:05.001463 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:05.008971 [ 2720 ] {} StorageWindowView(default.wv): Watch streams number: 0, target table: None
2022.03.24 13:34:06.000087 [ 2761 ] {} AsynchronousMetrics: MemoryTracking: was 255.01 MiB, peak 2.12 GiB, will set to 180.73 MiB (RSS), difference: -74.28 MiB
2022.03.24 13:34:06.001675 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:06.966103 [ 2583 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Found 2 old parts to remove.
2022.03.24 13:34:06.966132 [ 2583 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Removing part from filesystem 202203_103085_103322_108
2022.03.24 13:34:06.966755 [ 2583 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Removing part from filesystem 202203_103323_103323_0
2022.03.24 13:34:07.001334 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:08.001331 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:08.389911 [ 2610 ] {} SystemLog (system.asynchronous_metric_log): Flushing system log, 2786 entries to flush up to offset 29762550
2022.03.24 13:34:08.390509 [ 2610 ] {} DiskLocal: Reserving 1.00 MiB on disk default, having unreserved 114.39 GiB.
2022.03.24 13:34:08.390819 [ 2610 ] {} MergedBlockOutputStream: filled checksums 202203_11021_11021_0 (state Temporary)
2022.03.24 13:34:08.390960 [ 2610 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Renaming temporary part tmp_insert_202203_11021_11021_0 to 202203_103396_103396_0.
2022.03.24 13:34:08.391059 [ 2610 ] {} SystemLog (system.asynchronous_metric_log): Flushed system log up to offset 29762550
2022.03.24 13:34:08.856752 [ 2709 ] {} default..inner.fcc15ad9-8c62-4793-970e-104bc4abb18e (b3d2b82a-078f-480b-8e41-eba87452c5da): Added mutation: mutation_23.txt
2022.03.24 13:34:09.001358 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:09.258126 [ 2741 ] {} DNSResolver: Updating DNS cache
2022.03.24 13:34:09.258229 [ 2741 ] {} DNSResolver: Updated DNS cache
2022.03.24 13:34:09.983771 [ 2618 ] {} SystemLog (system.metric_log): Flushing system log, 7 entries to flush up to offset 77184
2022.03.24 13:34:09.990173 [ 2618 ] {} DiskLocal: Reserving 1.00 MiB on disk default, having unreserved 114.39 GiB.
2022.03.24 13:34:09.991610 [ 2618 ] {} MergedBlockOutputStream: filled checksums 202203_10267_10267_0 (state Temporary)
2022.03.24 13:34:09.991842 [ 2618 ] {} system.metric_log (ec4da3ca-fb68-4d76-9d7d-f069176fd4d9): Renaming temporary part tmp_insert_202203_10267_10267_0 to 202203_96308_96308_0.
2022.03.24 13:34:09.992659 [ 2618 ] {} SystemLog (system.metric_log): Flushed system log up to offset 77184
2022.03.24 13:34:10.001861 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:10.003036 [ 2737 ] {} StorageWindowView(default.wv): Watch streams number: 0, target table: None
2022.03.24 13:34:10.721114 [ 2565 ] {} system.metric_log (ec4da3ca-fb68-4d76-9d7d-f069176fd4d9): Found 7 old parts to remove.
2022.03.24 13:34:10.721137 [ 2565 ] {} system.metric_log (ec4da3ca-fb68-4d76-9d7d-f069176fd4d9): Removing part from filesystem 202203_93324_96238_559
2022.03.24 13:34:10.728564 [ 2565 ] {} system.metric_log (ec4da3ca-fb68-4d76-9d7d-f069176fd4d9): Removing part from filesystem 202203_96239_96239_0
2022.03.24 13:34:10.728721 [ 2565 ] {} system.metric_log (ec4da3ca-fb68-4d76-9d7d-f069176fd4d9): Removing part from filesystem 202203_96240_96240_0
2022.03.24 13:34:10.728854 [ 2565 ] {} system.metric_log (ec4da3ca-fb68-4d76-9d7d-f069176fd4d9): Removing part from filesystem 202203_96241_96241_0
2022.03.24 13:34:10.728985 [ 2565 ] {} system.metric_log (ec4da3ca-fb68-4d76-9d7d-f069176fd4d9): Removing part from filesystem 202203_96242_96242_0
2022.03.24 13:34:10.729117 [ 2565 ] {} system.metric_log (ec4da3ca-fb68-4d76-9d7d-f069176fd4d9): Removing part from filesystem 202203_96243_96243_0
2022.03.24 13:34:10.729252 [ 2565 ] {} system.metric_log (ec4da3ca-fb68-4d76-9d7d-f069176fd4d9): Removing part from filesystem 202203_96244_96244_0
2022.03.24 13:34:11.000084 [ 2761 ] {} AsynchronousMetrics: MemoryTracking: was 176.50 MiB, peak 2.12 GiB, will set to 179.96 MiB (RSS), difference: 3.46 MiB
2022.03.24 13:34:11.001169 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:11.720897 [ 2615 ] {} SystemLog (system.trace_log): Flushing system log, 10 entries to flush up to offset 989249
2022.03.24 13:34:11.721221 [ 2615 ] {} DiskLocal: Reserving 1.00 MiB on disk default, having unreserved 114.40 GiB.
2022.03.24 13:34:11.721410 [ 2615 ] {} MergedBlockOutputStream: filled checksums 202203_10076_10076_0 (state Temporary)
2022.03.24 13:34:11.721530 [ 2615 ] {} system.trace_log (0d3abe0f-bb61-4b8c-a610-8bb0ee559d34): Renaming temporary part tmp_insert_202203_10076_10076_0 to 202203_82753_82753_0.
2022.03.24 13:34:11.721633 [ 2615 ] {} SystemLog (system.trace_log): Flushed system log up to offset 989249
2022.03.24 13:34:12.001315 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:13.001215 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:13.381968 [ 2583 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Found 2 old parts to remove.
2022.03.24 13:34:13.381991 [ 2583 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Removing part from filesystem 202203_103085_103323_109
2022.03.24 13:34:13.382462 [ 2583 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Removing part from filesystem 202203_103324_103324_0
2022.03.24 13:34:13.860126 [ 2641 ] {} default..inner.fcc15ad9-8c62-4793-970e-104bc4abb18e (b3d2b82a-078f-480b-8e41-eba87452c5da): Added mutation: mutation_24.txt
2022.03.24 13:34:14.001530 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:15.001496 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:15.003033 [ 2687 ] {} StorageWindowView(default.wv): Watch streams number: 0, target table: None
2022.03.24 13:34:15.391166 [ 2610 ] {} SystemLog (system.asynchronous_metric_log): Flushing system log, 2786 entries to flush up to offset 29765336
2022.03.24 13:34:15.391746 [ 2610 ] {} DiskLocal: Reserving 1.00 MiB on disk default, having unreserved 114.40 GiB.
2022.03.24 13:34:15.392042 [ 2610 ] {} MergedBlockOutputStream: filled checksums 202203_11022_11022_0 (state Temporary)
2022.03.24 13:34:15.392163 [ 2610 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Renaming temporary part tmp_insert_202203_11022_11022_0 to 202203_103397_103397_0.
2022.03.24 13:34:15.392248 [ 2610 ] {} SystemLog (system.asynchronous_metric_log): Flushed system log up to offset 29765336
2022.03.24 13:34:16.001496 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:17.001226 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:17.492722 [ 2618 ] {} SystemLog (system.metric_log): Flushing system log, 8 entries to flush up to offset 77192
2022.03.24 13:34:17.498361 [ 2618 ] {} DiskLocal: Reserving 1.00 MiB on disk default, having unreserved 114.40 GiB.
2022.03.24 13:34:17.499876 [ 2618 ] {} MergedBlockOutputStream: filled checksums 202203_10268_10268_0 (state Temporary)
2022.03.24 13:34:17.500159 [ 2618 ] {} system.metric_log (ec4da3ca-fb68-4d76-9d7d-f069176fd4d9): Renaming temporary part tmp_insert_202203_10268_10268_0 to 202203_96309_96309_0.
2022.03.24 13:34:17.501027 [ 2618 ] {} SystemLog (system.metric_log): Flushed system log up to offset 77192
2022.03.24 13:34:18.001518 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:18.865126 [ 2708 ] {} default..inner.fcc15ad9-8c62-4793-970e-104bc4abb18e (b3d2b82a-078f-480b-8e41-eba87452c5da): Added mutation: mutation_25.txt
2022.03.24 13:34:19.001357 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:19.221715 [ 2615 ] {} SystemLog (system.trace_log): Flushing system log, 7 entries to flush up to offset 989256
2022.03.24 13:34:19.222098 [ 2615 ] {} DiskLocal: Reserving 1.00 MiB on disk default, having unreserved 114.40 GiB.
2022.03.24 13:34:19.222292 [ 2615 ] {} MergedBlockOutputStream: filled checksums 202203_10077_10077_0 (state Temporary)
2022.03.24 13:34:19.222405 [ 2615 ] {} system.trace_log (0d3abe0f-bb61-4b8c-a610-8bb0ee559d34): Renaming temporary part tmp_insert_202203_10077_10077_0 to 202203_82754_82754_0.
2022.03.24 13:34:19.222499 [ 2615 ] {} SystemLog (system.trace_log): Flushed system log up to offset 989256
2022.03.24 13:34:20.001419 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:20.003038 [ 2606 ] {} StorageWindowView(default.wv): Watch streams number: 0, target table: None
2022.03.24 13:34:21.001572 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:21.073830 [ 2565 ] {} system.trace_log (0d3abe0f-bb61-4b8c-a610-8bb0ee559d34): Found 5 old parts to remove.
2022.03.24 13:34:21.073851 [ 2565 ] {} system.trace_log (0d3abe0f-bb61-4b8c-a610-8bb0ee559d34): Removing part from filesystem 202203_82655_82691_9
2022.03.24 13:34:21.074025 [ 2565 ] {} system.trace_log (0d3abe0f-bb61-4b8c-a610-8bb0ee559d34): Removing part from filesystem 202203_82692_82692_0
2022.03.24 13:34:21.074150 [ 2565 ] {} system.trace_log (0d3abe0f-bb61-4b8c-a610-8bb0ee559d34): Removing part from filesystem 202203_82693_82693_0
2022.03.24 13:34:21.074271 [ 2565 ] {} system.trace_log (0d3abe0f-bb61-4b8c-a610-8bb0ee559d34): Removing part from filesystem 202203_82694_82694_0
2022.03.24 13:34:21.074392 [ 2565 ] {} system.trace_log (0d3abe0f-bb61-4b8c-a610-8bb0ee559d34): Removing part from filesystem 202203_82695_82695_0
2022.03.24 13:34:22.001651 [ 2761 ] {} AsynchronousMetrics: Hardware monitor 'nouveau', sensor '' exists but could not be read, error 22.
2022.03.24 13:34:22.030551 [ 2586 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Found 2 old parts to remove.
2022.03.24 13:34:22.030572 [ 2586 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Removing part from filesystem 202203_103085_103324_110
2022.03.24 13:34:22.031005 [ 2586 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Removing part from filesystem 202203_103325_103325_0
2022.03.24 13:34:22.392361 [ 2610 ] {} SystemLog (system.asynchronous_metric_log): Flushing system log, 2786 entries to flush up to offset 29768122
2022.03.24 13:34:22.392962 [ 2610 ] {} DiskLocal: Reserving 1.00 MiB on disk default, having unreserved 114.40 GiB.
2022.03.24 13:34:22.393242 [ 2610 ] {} MergedBlockOutputStream: filled checksums 202203_11023_11023_0 (state Temporary)
2022.03.24 13:34:22.393364 [ 2610 ] {} system.asynchronous_metric_log (7033d2ff-eef7-489c-aded-9bd84930227e): Renaming temporary part tmp_insert_202203_11023_11023_0 to 202203_103398_103398_0.
2022.03.24 13:34:22.393452 [ 2610 ] {} SystemLog (system.asynchronous_metric_log): Flushed system log up to offset 29768122

clickhouse logs this without stopping

@Vxider
Copy link
Contributor

Vxider commented May 6, 2022

Sorry for the late response, this will be fixed by #36967

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants