Skip to content

Move Plan Revision From Scheduling Spec to Scheduling RQ #1142

@Mythicaeda

Description

@Mythicaeda

Follow-up to #971.

Summary taken from "Future Work" of #1141:

As mentioned in #971, part of the reason the bug was occurring was due to the structure of this part of the DB. The plan's revision, which should be part of scheduling_request, is instead on scheduling_specification. This means that the UI has to update the scheduling spec before it hits the schedule endpoint, which updates the specs revision, which allows for a duplicate request to be created (since the PK is currently (spec_id, spec_revision)).

The correct design is to have plan_revision be on scheduling_request, as well as other changes to synchronize the design of the scheduling rq and sim rq tables. This is not possible, however, because plan revision data is stored in the Merlin DB. There are a few solutions possible:

  1. Merge the Databases. We can then grant the scheduler read permission on the plan table and it can properly fetch the plan's revision in the same way that sim rqs fetch revisions.
  2. Create GraphQL requests in the Scheduler Server. This would require adding in additional envvars to the scheduler server container, and potentially duplicating some code from the scheduler-driver package. Additionally, the place this GQL request would be made would be in the middle of a section of code that is reading from and then writing to Postgres in CachedSchedulerService.
  3. Have the Scheduler Server exclusively use GQL requests. This would entirely alleviate the awkwardness of (2), while very likely being more work. Additionally, it would be odd that one container is not able to interact directly with a database that it owns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorA code change that neither fixes a bug nor adds a featureschedulingAnything related to the scheduling domain

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions