clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

Java client-v2 server settings does not work for wait_for_async_insert

Open aadhikary opened this issue 5 months ago • 4 comments

Description

When using the clickhouse client for insert and setting the serverSetting for wait_for_async_insert does not get set. I have set the server setting as below

InsertSettings insertSettings = new InsertSettings();
insertSettings.serverSetting(ServerSettings.ASYNC_INSERT, "1")
insertSettings.serverSetting(ServerSettings.WAIT_ASYNC_INSERT, "1")

client.insert(table,records, insertSettings)

after the client has inserted the data I go and check query log

SELECT *
FROM system.query_log
WHERE (type = 'QueryFinish') AND (query ILIKE 'INSERT%')
ORDER BY event_time DESC
LIMIT 10;

Settings:                               {'connect_timeout_with_failover_ms':'1000','load_balancing':'nearest_hostname','distributed_aggregation_memory_efficient':'1','do_not_merge_across_partitions_select_final':'1','os_thread_priority':'2','log_queries':'1','prefer_localhost_replica':'0','parallel_view_processing':'1','async_insert':'1'}

Expected Behaviour

The settings output should contain wait_for_async_insert and my client should wait for data parts to be created and records visible in the table count as soon as client has seen the acknowledgement

Environment

  • Client version: client-v2: 0.9.0

ClickHouse Server

  • ClickHouse Server version: 25.6.4.12

aadhikary avatar Jul 29 '25 17:07 aadhikary

Thank you for reporting, @aadhikary ! We will look into it.

chernser avatar Aug 21 '25 23:08 chernser

Looks like a ClickHouse server issue:

  • Client sends all server settings

chernser avatar Sep 17 '25 00:09 chernser

Were you able to reproduce it? I managed to get the client to wait after setting this "distributed_foreground_insert = 1". This is with the cluster where shards are replicating.

aadhikary avatar Oct 01 '25 13:10 aadhikary

Good day, @aadhikary !

Thank you for the information! Can you reproduce it on other client by a chance?

chernser avatar Oct 01 '25 14:10 chernser