SharedMergeTree: read-after-write fails intermittently — best approach for CRUD operations? #97183
Unanswered
matthew-bl
asked this question in
Q&A
Replies: 1 comment
-
|
You can make read from "clusterAllReplicas('{cluster}', db, user_reports)" table function. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
@clickhouse/client(Node.js, HTTP protocol) via Kysely query builder with@founderpath/kysely-clickhousedialect(user_id, id)whereidis UUIDProblem
I have a table where users can create, update, and delete reports. After an
INSERTorDELETE+INSERT(for updates), I immediatelySELECTthe row by itsidto return it to the client. This sometimes fails with a "no result" error — the row hasn't replicated yet.Simplified flow (using Kysely):
Questions
Why does
session_idnot guarantee same-node routing via HTTP in ClickHouse Cloud? Is sticky routing based onsession_idsupported, or is it only guaranteed with the native protocol?What is the recommended approach for read-after-write in SharedMergeTree? For a low-volume CRUD table (~hundreds to low thousands of rows), is
SYSTEM SYNC REPLICA LIGHTWEIGHTbefore each critical read acceptable, or is there a lighter-weight solution?Would
select_sequential_consistency = 1on the individual SELECT query be more appropriate thanSYSTEM SYNC REPLICA LIGHTWEIGHT? What's the relative overhead of each?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions