pvary commented on a change in pull request #2119:
URL: https://github.com/apache/iceberg/pull/2119#discussion_r560809477
##########
File path:
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveClientPool.java
##########
@@ -83,6 +83,20 @@ protected HiveMetaStoreClient reconnect(HiveMetaStoreClient
client) {
return client;
}
+ @Override
+ protected boolean failureDetection(HiveMetaStoreClient client, Exception ex)
{
+ if (null != ex && ex instanceof MetaException) {
+ try {
+ client.getDatabase("default");
Review comment:
2. For example: When you try to run `client.getTable(null, "tableName")`
you will receive MetaException. You can take a look at the test cases
[here](https://github.com/apache/hive/tree/master/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client)
and see that there are multiple cases where MetaException is thrown. In this
case MetaException is an acceptable result returning a valid error, and we do
not need to try to reconnect
3. Based on 2. we might get a MetaException even if everything is working
correctly
4. Collecting db information is more costly than returning the only row from
a table. We need a check method which is as cheap as possible.
So basically I think we can not rule out receiving the MetaException when we
are working correctly. We might decide that in relation to Iceberg we think the
risk is minimal enough to accept the risk of double calls and the risk worth
the code simplicity. How complicated would be to create a "theoretically" sound
solution?
Checked the `client.getServerVersion()` client method. This might be less
costly than calling `client.getDatabase("default")`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]