---
title: "Discussion on \"Shared resource lock powered by Clickhouse\" | Hashnode"
description: "Discussion on \"Shared resource lock powered by Clickhouse\". Background\nOne core feature if Qryn project is simplicity of setup. We do our best to make the infrastructural complexity of the project as simple as possible. The desired setup for us is just Clickhouse and one (or many) stateless workers connected ..."
url: "https://hashnode.com/posts/shared-resource-lock-powered-by-clickhouse/634d5e48c454aa2b493c1a19"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Shared resource lock powered by Clickhouse](https://blog.gigapipe.com/shared-resource-lock-powered-by-clickhouse?utm_source=hashnode&utm_medium=feed)

Background One core feature if Qryn project is simplicity of setup. We do our best to make the infrastructural complexity of the project as simple as possible. The desired setup for us is just Clickhouse and one (or many) stateless workers connected ...

Oct 17, 2022 · 6 min read · blog.gigapipe.com  
Read the article

-   [#clickhouse](https://hashnode.com/tag/clickhouse)
-   [#qryn](https://hashnode.com/tag/qryn)
-   [#lock](https://hashnode.com/tag/lock)

## Written by

[Volodymyr Akchurin](https://hashnode.com/@akvlad)

@akvlad

  
[View profile](https://hashnode.com/@akvlad)

qryn clickhouse nodejs golang

## Responses 1

Markdown supported · ⌘↵ to post

[Dmitry Titov](https://hashnode.com/@UnamedRus)

[Oct 28, 2022](https://hashnode.com/posts/shared-resource-lock-powered-by-clickhouse/634d5e48c454aa2b493c1a19/comment/635c4dcbb872be2ebe1eb741)

Another funny idea to investigate:

Single ClickHouse server can't have 2 queries with the same query id...

```

In first shell:

> clickhouse-client --query "SELECT sleepEachRow(3) FROM system.zeros FORMAT Null SETTINGS max_block_size=1" --query_id 2 --send_timeout 1


In second shell:

> clickhouse-client --query "SELECT sleepEachRow(3) FROM system.zeros FORMAT Null SETTINGS max_block_size=1" --query_id 2 --send_timeout 1

Received exception from server (version 22.10.1):
Code: 216. DB::Exception: Received from localhost:9000. DB::Exception: Query with id = 2 is already running.. (QUERY_WITH_SAME_ID_IS_ALREADY_RUNNING)
(query: SELECT sleepEachRow(3) FROM system.zeros FORMAT Null SETTINGS max_block_size=1)
```
