Skip to content

Conversation

@yzeng1618
Copy link
Contributor

#10226

Purpose of this pull request

This PR improves Hive connector metastore HA by:

  • Using RetryingMetaStoreClient (when available) for metastore retry/failover, with a safe fallback to HiveMetaStoreClient.

  • Supporting comma-separated metastore_uri (with whitespace trimming), so users can configure multiple HMS endpoints for automatic failover.

  • Fixing HiveServer2 JDBC URL derivation when metastore_uri contains multiple URIs (derive from the first URI only).

Does this PR introduce any user-facing change?

Yes.

metastore_uri now supports multiple HMS URIs separated by commas (whitespace is allowed), and the connector will fail over to the next available metastore if the first one is unreachable.

How was this patch tested?

  1. Unit tests added: HiveMetaStoreCatalogMetastoreUrisTest.java

  2. E2E tests added: HiveIT.java and configs:

  • fake_to_hive_metastore_uri_failover.conf

  • hive_to_assert_metastore_uri_failover.conf

Check list

Copy link
Contributor

@LiJie20190102 LiJie20190102 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

davidzollo
davidzollo previously approved these changes Dec 28, 2025
Copy link
Contributor

@davidzollo davidzollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add related doc!

LGTM
+1 if doc is ready

@corgy-w
Copy link
Contributor

corgy-w commented Dec 29, 2025

Please add related doc!

LGTM +1 if doc is ready

This reads as if failover/DR is assumed by default. I’ve asked the contributor to add a few usage use cases in the write-up to make the expectations explicit.

…toreClient and add metastore_uri failover example
@yzeng1618
Copy link
Contributor Author

The relevant document content has been added.

@yzeng1618 yzeng1618 requested a review from davidzollo December 29, 2025 06:11
Copy link
Contributor

@corgy-w corgy-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good pr!

Copy link
Contributor

@davidzollo davidzollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@davidzollo davidzollo merged commit d56b164 into apache:dev Jan 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants