Skip to content

Commit 1fa686d

Browse files
authored
always wait for async insert except events and tags (#1015)
1 parent 986fb9d commit 1fa686d

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

app-server/src/ch/events.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ pub async fn insert_events(clickhouse: clickhouse::Client, events: Vec<CHEvent>)
6464
match ch_insert {
6565
Ok(mut ch_insert) => {
6666
let mut total_size_bytes = 0;
67+
ch_insert = ch_insert.with_option("wait_for_async_insert", "0");
6768
for event in events {
6869
ch_insert.write(&event).await?;
6970
total_size_bytes += event.size_bytes as usize;

app-server/src/ch/tags.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ pub async fn insert_tags_batch(client: clickhouse::Client, tags: &[SpanTag]) ->
9090
let ch_insert = client.insert("tags");
9191
match ch_insert {
9292
Ok(mut ch_insert) => {
93+
ch_insert = ch_insert.with_option("wait_for_async_insert", "0");
9394
for span_tag in tags {
9495
let id = Uuid::new_v4();
9596
let tag = CHTag::new(

app-server/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ fn main() -> anyhow::Result<()> {
471471
.with_user(clickhouse_user)
472472
.with_database("default")
473473
.with_option("async_insert", "1")
474-
.with_option("wait_for_async_insert", "0");
474+
.with_option("wait_for_async_insert", "1");
475475

476476
let clickhouse = match clickhouse_password {
477477
Ok(password) => clickhouse_client.with_password(password),

0 commit comments

Comments
 (0)