Scheduling error to find already existing meta tables when using postgresql
- Dominant language
- Java
- Stars
- 14.1k
- Forks
- 3.8k
- Avg merge
- 2d 58m
- Merged PRs (30d)
- 233
Description
# Description
When using postgresql, I found a case where an error occurred during scheduling that check whether a meta table existed.
The reason is that the schema for the db user is only allowed to be public, which is the default value.
Therefore, I think it would be better to apply the db table schema as a configuration property.
The error log is shown below.
`
Caused by: org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException: org.postgresql.util.PSQLException: ERROR: relation "druid_config" does not exist
Position: 21 [statement:"SELECT payload FROM druid_config WHERE name = :key", located:"SELECT payload FROM druid_config WHERE name = :key", rewritten:"SELECT payload FROM druid_config WHERE name = ?", arguments:{ positional:{}, named:{key:'worker.config'}, finder:[]}]
at org.skife.jdbi.v2.SQLStatement.internalExecute(SQLStatement.java:1334) ~[jdbi-2.63.1.jar:2.63.1]
at org.skife.jdbi.v2.Query.fold(Query.java:173) ~[jdbi-2.63.1.jar:2.63.1]
at org.skife.jdbi.v2.Query.list(Query.java:82) ~[jdbi-2.63.1.jar:2.63.1]
at org.skife.jdbi.v2.Query.list(Query.java:75) ~[jdbi-2.63.1.jar:2.63.1]
at org.apache.druid.metadata.SQLMetadataConnector.lookupWithHandle(SQLMetadataConnector.java:617) ~[druid-server-0.13.0-incubating.jar:0.13.0-incubating]
at org.apache.druid.metadata.SQLMetadataConnector$5.withHandle(SQLMetadataConnector.java:595) ~[druid-server-0.13.0-incubating.jar:0.13.0-incubating]
at org.apache.druid.metadata.SQLMetadataConnector$5.withHandle(SQLMetadataConnector.java:591) ~[druid-server-0.13.0-incubating.jar:0.13.0-incubating]
at org.skife.jdbi.v2.DBI.withHandle(DBI.java:281) ~[jdbi-2.63.1.jar:2.63.1]
... 13 more
`
Contributor guide
Research direction
Start in SQLMetadataConnector.java, particularly the lookup path shown around lines 591-617, and reproduce the scheduling failure with PostgreSQL when the database user's schema is restricted to public. The work is done when the metadata table schema can be configured and the existing-table lookup succeeds under that configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100