Skip to content

Traffic Ops database is not locked during Postinstall #6106

Open
@zrhoffman

Description

@zrhoffman

This Bug Report affects these Traffic Control components:

  • Traffic Ops

Current behavior:

We have no mechanism to verify that multiple Traffic Ops instances are not trying to run the TO Postinstall at the same time.

Previously filed in #4984; sort of fixed in #5138 by making create_tables.sql alone idempotent; idempotency is lost as soon as squash_migrations.sh from #6096 is used.

Expected behavior:

When the Postinstall script starts, it should check if a postinstall lock exists in the DB, and if so, wait for it to be cleared. If there is no lock, it should set one and clear it once Postinstall completes (with or without an error).

The cdn_lock table cannot be used because the username and cdn_name are non-nullable foreign keys.

Also, we should be using --single-transaction for all of our psql commands in the Postinstall script and in db/admin.

Steps to reproduce:

Try to run the Traffic Ops Postinstall on the same database from two separate TO instances at the same time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Traffic Opsrelated to Traffic Opsbugsomething isn't working as intendeddatabaserelating to setup/installation/structure of the Traffic Ops databaseinstallrelated to the installation processlow impactaffects only a small portion of a CDN, and cannot itself break onemedium difficultythe estimated level of effort to resolve this issue is medium

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions