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

Add cause of failures in ThriftHiveMetastore #19655

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

pajaks
Copy link
Member

@pajaks pajaks commented Nov 7, 2023

This will be beneficial in case of detecting retry issues.
Currently in case of failure after retry (e.g createTable, dropTable) we have no information that it was consecutive attempt. After this change exceptions from previous attempts will be visible in stack trace.

Example in case 2 attemps:

  1. ClientException
  2. NoSuchObjectException

Before:

io.trino.spi.connector.TableNotFoundException: Table 'test.test' not found

	at io.trino.plugin.hive.metastore.thrift.ThriftHiveMetastore.dropTable(ThriftHiveMetastore.java:1103)
	at io.trino.plugin.hive.TestTriftHiveMetastore.testDropTable(TestTriftHiveMetastore.java:194)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

After:

io.trino.spi.connector.TableNotFoundException: Table 'test.test' not found

	at io.trino.plugin.hive.metastore.thrift.ThriftHiveMetastore.dropTable(ThriftHiveMetastore.java:1103)
	at io.trino.plugin.hive.TestTriftHiveMetastore.testDropTable(TestTriftHiveMetastore.java:194)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: NoSuchObjectException(message:null)
	at io.trino.plugin.hive.TestTriftHiveMetastore$2.getTable(TestTriftHiveMetastore.java:178)
	at io.trino.plugin.hive.metastore.thrift.ThriftHiveMetastore.lambda$dropTable$41(ThriftHiveMetastore.java:1092)
	at io.trino.plugin.hive.metastore.thrift.ThriftMetastoreApiStats.lambda$wrap$0(ThriftMetastoreApiStats.java:41)
	at io.trino.plugin.hive.util.RetryDriver.run(RetryDriver.java:116)
	at io.trino.plugin.hive.metastore.thrift.ThriftHiveMetastore.dropTable(ThriftHiveMetastore.java:1090)
	... 4 more
	Suppressed: io.trino.client.ClientException: Timout
		at io.trino.plugin.hive.TestTriftHiveMetastore$2.getTable(TestTriftHiveMetastore.java:176)
		... 8 more

'''

Description

Additional context and related issues

Release notes

(x ) 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`)

@cla-bot cla-bot bot added the cla-signed label Nov 7, 2023
@github-actions github-actions bot added tests:hive hive Hive connector labels Nov 7, 2023
@findepi findepi added the no-release-notes This pull request does not require release notes entry label Nov 7, 2023
@findepi
Copy link
Member

findepi commented Nov 7, 2023

This will be beneficial in case of detecting retry issues

Please expand rationale. Maybe example of the situation where current error reporting is insufficient and this change helps.

@pajaks pajaks force-pushed the pajaks/imporve_error_message branch from 98d0acc to a9506ba Compare November 8, 2023 08:55
@github-actions github-actions bot added the iceberg Iceberg connector label Nov 8, 2023
@pajaks pajaks requested a review from findinpath November 8, 2023 08:55
@findinpath
Copy link
Contributor

Failure in ci / test (plugin/trino-delta-lake)

Error:  io.trino.plugin.deltalake.TestDeltaLakeMinioAndHmsConnectorSmokeTest.testNonDeltaTablesCannotBeAccessed -- Time elapsed: 29.37 s <<< ERROR!
2023-11-08T03:23:48.900-0600	INFO	dispatcher-query-12	io.trino.event.QueryMonitor	TIMELINE: Query 20231108_092348_00631_xs34i :: FINISHED :: elapsed 144ms :: planning 3ms :: waiting 46ms :: scheduling 61ms :: running 59ms :: finishing 21ms :: begin 2023-11-08T03:23:48.755-06:00 :: end 2023-11-08T03:23:48.899-06:00
java.lang.IllegalStateException: result set must have exactly one row
	at com.google.common.base.Preconditions.checkState(Preconditions.java:512)
	at io.trino.testing.MaterializedResult.getOnlyValue(MaterializedResult.java:298)
	at io.trino.testing.AbstractTestQueryFramework.computeScalar(AbstractTestQueryFramework.java:323)
	at io.trino.testing.AbstractTestQueryFramework.computeScalar(AbstractTestQueryFramework.java:318)
	at io.trino.plugin.deltalake.BaseDeltaLakeConnectorSmokeTest.testNonDeltaTablesCannotBeAccessed(BaseDeltaLakeConnectorSmokeTest.java:495)

It is going to be likely fixed through #19343

This will be beneficial in case of detecting retry issues
@pajaks pajaks force-pushed the pajaks/imporve_error_message branch from a9506ba to 490cab8 Compare November 13, 2023 09:37
@pajaks pajaks requested a review from ebyhr November 13, 2023 13:46
@ebyhr ebyhr merged commit 8155c56 into trinodb:master Nov 13, 2023
57 checks passed
@github-actions github-actions bot added this to the 434 milestone Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hive Hive connector iceberg Iceberg connector no-release-notes This pull request does not require release notes entry
Development

Successfully merging this pull request may close these issues.

4 participants