ClickHouse / clickhouse-cpp

C++ client library for ClickHouse
Apache License 2.0
306 stars 159 forks source link

Automatic reconnect ignores settings applied for the connection #371

Open pet74alex opened 6 months ago

pet74alex commented 6 months ago

Client::Impl::RetryGuard performs automatic connection resets so the application code doesn't have a chance to restore expected connection settings applied before executing the current request.

For example, SET mutations_sync=2, automatic reconnect, ALTER TABLE sequence causes mutations to be executed asynchronously when the application assumes synchronous execution of the mutation.

It looks like connection settings should be stored in the Client::Impl and they should be re-applied in case of such reconnect before executing the client query.