Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBase Connection Registry usage with Phoenix JDBC url #24869

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

virajjasani
Copy link
Member

Description

Use various HBase Connection Registries with Phoenix JDBC url formats. Document with recommendations and use in test.

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@virajjasani
Copy link
Member Author

virajjasani commented Jan 31, 2025

I have run TestPhoenixConnectorTest locally 3 times and all 241 out of 337 (96 ignored) tests are passing each time. Not sure why the registry based exception would occur (unless the master daemon is not stable or does not have meta cache).

Edit: updated test to use new format for ZK ConnectionRegistry. RPC Registry for test is facing errors because in docker env, clients can exhaust master with RPC threadpool while it is already running in-house chores.

@virajjasani virajjasani force-pushed the reg branch 5 times, most recently from 2cfd35e to 9f24500 Compare February 1, 2025 03:02
@virajjasani virajjasani requested review from ebyhr and mosabua February 4, 2025 04:50
@ebyhr ebyhr removed their request for review February 4, 2025 04:54
@virajjasani virajjasani requested a review from wendigo February 4, 2025 16:40
@lhofhansl
Copy link
Member

Looks good. +1

@virajjasani
Copy link
Member Author

Thanks @lhofhansl!

FYI @stoty if you would also like to take a look.

@virajjasani
Copy link
Member Author

@wendigo @mosabua I am curious reg the guidelines, as long as there is no merge conflict, is it fine to not keep rebasing the PR?

@stoty
Copy link

stoty commented Feb 5, 2025

LGTM.

Note that in most cases the default jdbc:phoenix URL should be used, as the cluster can be determined from the hbase / hadoop config files that must be present on the classpath anyway for for correct operation.

@@ -79,7 +79,6 @@ private TestingPhoenixServer()
try {
MiniZooKeeperCluster zkCluster = this.hbaseTestingUtility.startMiniZKCluster();
port = zkCluster.getClientPort();

Copy link
Contributor

Choose a reason for hiding this comment

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

revert

(phoenix-connection-url)=
### `phoenix.connection-url`

phoenix.connection-url supports multiple formats:
Copy link
Contributor

Choose a reason for hiding this comment

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

@mosabua ptal for wording

(phoenix-connection-url)=
### `phoenix.connection-url`

phoenix.connection-url supports multiple formats:
Copy link
Member

Choose a reason for hiding this comment

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

The connection URL for Phoenix set with phoenix.connection-url supports multiple formats:

| `phoenix.config.resources` | No | Comma-separated list of configuration files (e.g. `hbase-site.xml`) to use for connection properties. These files must exist on the machines running Trino. |
| `phoenix.max-scans-per-split` | No | Maximum number of HBase scans that will be performed in a single split. Default is 20. Lower values will lead to more splits in Trino. Can also be set via session propery `max_scans_per_split`. For details see: [https://phoenix.apache.org/update_statistics.html](https://phoenix.apache.org/update_statistics.html). (This setting has no effect when guideposts are disabled in Phoenix.) |
| `phoenix.server-scan-page-timeout` | No | The time limit on the amount of work single RPC request can do before it times out. Type: [](prop-type-duration). |

(phoenix-connection-url)=
### `phoenix.connection-url`
Copy link
Member

Choose a reason for hiding this comment

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

Connection URL:

Suggested change
### `phoenix.connection-url`
### Connection URL:

### `phoenix.connection-url`

phoenix.connection-url supports multiple formats:
1. `jdbc:phoenix[:zk_quorum][:zk_port][:zk_hbase_path][:principal][:keytab][;options]`. Connection uses HBase Zookeeper Registry. The `zk_quorum` is a comma separated list of ZooKeeper servers. The `zk_port` is the ZooKeeper port. The `zk_hbase_path` is the HBase root znode path, that is configurable using `hbase-site.xml`. By default the location is `/hbase`. Principal, Keytab and Options are optional.
Copy link
Member

Choose a reason for hiding this comment

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

Change this whole list into an item list and wrap at 80 char width so we can actually review wording.

Like

* `jdbc:phoenix[:zk_quorum][:zk_port][:zk_hbase_path][:principal][:keytab][;options]`:
Connection uses HBase Zookeeper Registry. The `zk_quorum` is a comma separated
list of ZooKeeper servers. The `zk_port` is the ZooKeeper port. The
`zk_hbase_path` is the HBase root znode path, that is configurable using
`hbase-site.xml`.  By default the location is `/hbase`. Principal, Keytab and
Options are optional.
* `jdbc:phoenix+zk[:host1\:port1][,:host2\:port2]...[,:hostN\:portN][:zk_hbase_path][:principal][:keytab][;options]`:
Uses same Connection as above, however host:port pairs are separated by comma.
...

@@ -47,11 +47,22 @@ The following Phoenix-specific configuration properties are available:

| Property name | Required | Description |
|------------------------------------| -------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `phoenix.connection-url` | Yes | `jdbc:phoenix[:zk_quorum][:zk_port][:zk_hbase_path]`. The `zk_quorum` is a comma separated list of ZooKeeper servers. The `zk_port` is the ZooKeeper port. The `zk_hbase_path` is the HBase root znode path, that is configurable using `hbase-site.xml`. By default the location is `/hbase` |
| `phoenix.connection-url` | Yes | Detailed description: [](phoenix-connection-url). |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| `phoenix.connection-url` | Yes | Detailed description: [](phoenix-connection-url). |
| `phoenix.connection-url` | Yes | See [](phoenix-connection-url). |

@@ -47,11 +47,22 @@ The following Phoenix-specific configuration properties are available:

| Property name | Required | Description |
Copy link
Member

Choose a reason for hiding this comment

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

Ideally we change this whole list into a list-table .. but that could be a separate commit before or after .. or even a separate PR

@virajjasani virajjasani force-pushed the reg branch 2 times, most recently from 9024a1a to d09425c Compare February 6, 2025 06:28
@virajjasani virajjasani requested a review from mosabua February 6, 2025 18:24
docs/src/main/sphinx/connector/phoenix.md Outdated Show resolved Hide resolved
docs/src/main/sphinx/connector/phoenix.md Outdated Show resolved Hide resolved
docs/src/main/sphinx/connector/phoenix.md Outdated Show resolved Hide resolved
docs/src/main/sphinx/connector/phoenix.md Outdated Show resolved Hide resolved
docs/src/main/sphinx/connector/phoenix.md Outdated Show resolved Hide resolved
docs/src/main/sphinx/connector/phoenix.md Outdated Show resolved Hide resolved
docs/src/main/sphinx/connector/phoenix.md Outdated Show resolved Hide resolved
docs/src/main/sphinx/connector/phoenix.md Outdated Show resolved Hide resolved
Host names refers to HMaster server names, port refers to HMaster port.
Principal, Keytab and Options are optional.

PHOENIX-6523 introduced support for various Connection Registries.
Copy link
Member

Choose a reason for hiding this comment

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

Remove this line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants