Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-34077

scheduled tasks race condition during DB migration can leave tasks without proper schedule

    Details

    • Notability:
      1

      Description

      There is an apparent race condition between the qrtz_job_details and qrtz_triggers tables during migration to Postgres from OrientDB, where inserts are attempted against qrtz_triggers before all inserts have completed against qrtz_job_details.

      This results in the following types of warnings to be logged during migration:

      16:12:47 [main] WARN c.s.n.d.m.writer.WriterSkipPolicy - Unable to save quartz trigger: ERROR: insert or update on table "qrtz_triggers" violates foreign key constraint "qrtz_triggers_sched_name_job_name_job_group_fkey"
       Detail: Key (sched_name, job_name, job_group)=(nexus, fe2872f6-56f3-437c-9f15-1dda4aadd2dc, nexus) is not present in table "qrtz_job_details".

      And more significantly, results in the impacted task to end up with the incorrect schedule trigger. For example a task that was scheduled as "Daily" before migration ends up with a schedule of "Manual".

      The scheduler status post migration also alerts of the need for the impacted tasks to be updated with the correct frequency per the System check that was added per NEXUS-19224

      Expected:

      Ensure quartz job details are migrated before their corresponding quartz triggers, so that the existing schedules of those tasks are migrated correctly.

       

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            hardeepn Hardeep Nagra
            CC:
            Jozsef Csuti, Tibor Hugyecz
            Last Updated By:
            Peter Lynch Peter Lynch
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response:

                tigCommentSecurity.panel-title