aws / aws/amazon-redshift-jdbc-driver
RedshiftDatabaseMetaData.getSchemas(null, null) throws "schema "***" does not exist"
- Dominant language
- Java
- Stars
- 71
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
This is an intermittent issue in Trino CI. Redshift sometimes throws `schema "xxx" does not exist` error.
I don't think the method should throw an exception even if a schema is dropped concurrently.
```
Caused by: com.amazon.redshift.util.RedshiftException: ERROR: schema "xxx" does not exist
at com.amazon.redshift.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2648)
at com.amazon.redshift.core.v3.QueryExecutorImpl.processResultsOnThread(QueryExecutorImpl.java:2295)
at com.amazon.redshift.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
at com.amazon.redshift.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1878)
at com.amazon.redshift.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:375)
at com.amazon.redshift.jdbc.RedshiftStatementImpl.executeInternal(RedshiftStatementImpl.java:519)
at com.amazon.redshift.jdbc.RedshiftStatementImpl.execute(RedshiftStatementImpl.java:440)
at com.amazon.redshift.jdbc.RedshiftStatementImpl.executeWithFlags(RedshiftStatementImpl.java:381)
at com.amazon.redshift.jdbc.RedshiftStatementImpl.executeCachedSql(RedshiftStatementImpl.java:367)
at com.amazon.redshift.jdbc.RedshiftStatementImpl.executeWithFlags(RedshiftStatementImpl.java:344)
at com.amazon.redshift.jdbc.RedshiftStatementImpl.executeQuery(RedshiftStatementImpl.java:268)
at com.amazon.redshift.jdbc.RedshiftDatabaseMetaData.getSchemas(RedshiftDatabaseMetaData.java:1999)
```
Contributor guide
Research direction
Start in RedshiftDatabaseMetaData.java at getSchemas(), around line 1999, and review how schema metadata queries handle schemas dropped during execution. Reproduce or inspect the Trino CI failure if possible; done means getSchemas(null, null) no longer propagates the concurrent schema-not-found error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100