Fix HiveCatalog connection stability with retry mechanism for TTransportException#98471
Open
otselnik wants to merge 4 commits intoClickHouse:masterfrom
Open
Fix HiveCatalog connection stability with retry mechanism for TTransportException#98471otselnik wants to merge 4 commits intoClickHouse:masterfrom
otselnik wants to merge 4 commits intoClickHouse:masterfrom
Conversation
Contributor
|
Could we use the following class here (maybe with extending) ? ClickHouse/src/Storages/Hive/HiveCommon.h Line 50 in e06788d It looks like it already provides retry logic inside. |
aalexfvk
reviewed
Mar 2, 2026
| #include <Storages/ObjectStorage/DataLakes/Iceberg/SchemaProcessor.h> | ||
| #include <Common/ProxyConfigurationResolverProvider.h> | ||
| #include <Databases/DataLake/Common.h> | ||
| # include <optional> |
Contributor
There was a problem hiding this comment.
These indentations look unnecessary when we wrap by #if the entire module like this.
Author
It uses a client pool under the hood. It seems like overkill for the HiveCatalog. I reused the retry logic from the hive client in this pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed HiveCatalog connection stability by adding automatic retry mechanism and reconnection logic for handling TTransportException errors when communicating with Hive Metastore.
Documentation entry for user-facing changes
Technical Details
Motivation:
HiveCatalog connections to Hive Metastore could fail with TTransportException when the metastore service restarts or network issues occur. This caused queries to fail even though the issue was temporary and could be resolved by reconnecting.
Changes:
reconnect()method to properly close and reopen connections to Hive MetastoreexecuteWithRetry()template method that automatically retries operations up to 3 times on TTransportExceptionBehavior:
When a TTransportException occurs during any Hive Metastore operation (getTables, existsTable, etc.), the system will:
This makes DataLakeCatalog with Hive backend more resilient to temporary connection issues.