Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
5.2.0
-
None
-
None
Description
In order to execute any query at the server side, Phoenix client requires creating CQSI (ConnectionQueryServicesImpl) connection, which internally initiates and maintains long lasting connection against HBase server. CQSI connection is unique per JDBC url used to initiate the connection. Once created, CQSI connections are cached per 24 hr (by default) for every unique JDBC url provided.
When client initiates CQSI connection, the connection initialization also attempts to execute some metadata queries to ensure that the system tables like SYSTEM.CATALOG exist and the client version is compatible against the server version. For this, CQSI#init makes RPC calls against MetaDataEndpointImpl coproc.
This operation is valid for every CQSI connection initiated for every unique JDBC url by every client. However, when server hosting SYSTEM.CATALOG initiates CQSI connection, it means that SYSTEM.CATALOG and other system tables already exist. Moreover, client/server version compatibility check is not required because the connection is being created from the same server that is hosting SYSTEM.CATALOG.
Metadata operations performed by the regionserver hosting SYSTEM.CATALOG region(s) also hold row level write lock for the given PTable entry. Hence, this improvement is also expected to bring some perf improvement for the metadata operations.