Skip to content

[Bug]: Unable to change job owner #6941

@jflambert

Description

@jflambert

What type of bug is this?

Unexpected error

What subsystems and features are affected?

User-Defined Action (UDA)

What happened?

I need to be able to change ownership of timescaledb background jobs.

Normally I use REASSIGN OWNED BY X TO Y; in order to reassign all objects from role X to role Y, and then drop role Y.

Timescaledb jobs aren't handled by this operation, so I needed to do something like this: UPDATE _timescaledb_config.bgw_job SET owner='Y'; in order for DROP ROLE to work without complaining.

However, the jobs still seem to execute with the older owner.

image

However if I manually use select run_job(1000); I don't have an issue. So it's most likely from the scheduler side caching the OID that was used at creation time?

TimescaleDB version affected

2.14.2

PostgreSQL version used

16.2

What operating system did you use?

timescaledb-ha

What installation method did you use?

Docker

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

No response

How can we reproduce the bug?

- create database D and owner D
- create role X superuser
- (as X) select add_job('xxx', '5s')
- reassign owned by X to D
- UPDATE _timescaledb_config.bgw_job SET owner='D';
- DROP USER X

and you should get errors in the logs every 5 seconds

Metadata

Metadata

Assignees

Labels

Background WorkerThe background worker subsystem, including the schedulerbug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions