Skip to content

[BUG] Rds source getTableNames method requires REPLICATION priviledge #6329

@oeyh

Description

@oeyh

Describe the bug
Rds source requires Replication permission for non-replication operations.
For example, I see this error is:

org.opensearch.dataprepper.plugins.source.rds.schema.PostgresSchemaManager - Failed to get table names, retrying
org.postgresql.util.PSQLException: FATAL: permission denied to start WAL sender
 Detail: Only roles with the REPLICATION attribute may start a WAL sender process.
...
at org.opensearch.dataprepper.plugins.source.rds.schema.PostgresSchemaManager.getTableNames(PostgresSchemaManager.java:212)
...

The reason is that the rds source establish a replication connection to database to perform all needed operations, like get table names and schemas, stream CDC data, etc. However, some operations doesn't need a replication connection.
It shouldn't be an issue if the pipeline has stream enabled; but if a user only wants to do export, Replication permission (only needed for stream) shouldn't be required.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
getTableNames method should only require SELECT permissions. We probably need to establish separate connection for non-replication operations.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. Ubuntu 20.04 LTS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Unplanned

Relationships

None yet

Development

No branches or pull requests

Issue actions