Skip to content

Issues caused by asynchronous migrations #704

@olepbr

Description

@olepbr

Hi!

The newly added asynchronous migration feature (#693) brought with it two issues for those who use the CLI to generate SQL plans:

  1. Since the generated plans now puts some migrations in pgboss.bam, the database user one runs pg-boss as now needs CREATE privileges (in this case CREATE INDEX). This is unfortunate, as not granting said privileges to the pg-boss user is part of the motivation from handling migrations separately (cf. https://timgit.github.io/pg-boss/#/install )
  2. The generated rollback plan from version 27 to 26 fails unless pgboss.start() has been run in the meantime, since it unconditionally tries to drop the job_common_i7 index, which doesn't exist unless the migration in pgboss.bam has been run.

The second issue is easy to fix; just add IF EXISTS to the DROP INDEX command in the rollback script.

The first issue is more thorny. I think the documentation should at least give a warning to monitor the SQL plans for invocations of job_table_run_async(). I also feel like this perhaps warrants a major version bump, given that it could break things for anyone running pg-boss without CREATE permissions. At the same time, I understand that this is part of the package when one doesn't opt-in to pg-boss' automatic migrations :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions