cylc-flow icon indicating copy to clipboard operation
cylc-flow copied to clipboard

Db store force triggered

Open hjoliver opened this issue 3 years ago • 4 comments

These changes close #5020

Requirements check-list

  • [x] I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • [x] Contains logically grouped changes (else tidy your branch by rebase).
  • [x] Does not contain off-topic changes (use other PRs for other changes).
  • [x] Applied any dependency changes to both setup.cfg and conda-environment.yml.
  • [x] Appropriate tests are included (unit and/or functional).
  • [x] Appropriate change log entry included.
  • [x] No documentation update required.
  • [ ] [if bugfix] PRs raised to both master and the relevant bugfix branch.

hjoliver avatar Jul 28 '22 08:07 hjoliver

Sorry, accidentally deleted 8.0.x!

MetRonnie avatar Aug 03 '22 12:08 MetRonnie

Yes, I need to (re)-investigate that - I ~think I did it deliberately, and it seems to work correctly, but have forgotten my own chain of thought already... [DONE]

A good way to check updates of the task status table:

[scheduling]
    [[graph]]
        R1 = "a => b => c => d"
[runtime]
    [[a, b, d]]
        pre-script = sleep 5
    [[c]]   # trigger a new flow at a, then fail so the new flow will merge with me
        script = """
            sleep 5
            if ((CYLC_TASK_SUBMIT_NUMBER == 1 )); then
               cylc trigger --flow=new $CYLC_WORKFLOW_ID//1/a
               false
            fi
         """

Run the above with this alongside:

$ watch -n 1 sqlite3 -header -column ~/cylc-run/test/runN/log/db \
   "select name, flow_nums, submit_num, status from task_states"

hjoliver avatar Aug 10 '22 19:08 hjoliver

I tried your example running on 8.0.x and this branch, but I can't say I noticed a difference in the changes to the task_states table

MetRonnie avatar Aug 12 '22 10:08 MetRonnie

Sorry, poorly explained by me! - that was just intended to show that my changes to the task status DB calls had not broken anything.

hjoliver avatar Aug 12 '22 11:08 hjoliver

~~(TBD: resolve Oliver's question above.)~~ DONE

hjoliver avatar Aug 18 '22 04:08 hjoliver

Oops, this breaks the ability of Cylc to restart 8.0.{0,1,2} workflows.

ERROR - no such column: task_states.is_manual_submit
    Traceback (most recent call last):
      File "~/github/cylc-flow/cylc/flow/scheduler.py", line 670, in start
        await self.configure()
      File "~/github/cylc-flow/cylc/flow/scheduler.py", line 459, in configure
        self._load_pool_from_db()
      File "~/github/cylc-flow/cylc/flow/scheduler.py", line 719, in _load_pool_from_db
        self.workflow_db_mgr.pri_dao.select_task_pool_for_restart(
      File "~/github/cylc-flow/cylc/flow/rundb.py", line 860, in select_task_pool_for_restart
        for row_idx, row in enumerate(self.connect().execute(stmt)):
    sqlite3.OperationalError: no such column: task_states.is_manual_submit
CRITICAL - Workflow shutting down - no such column: task_states.is_manual_submit

We need to make this an 8.1.0-only bugfix.

  • 8.0.x branch - #5173
  • Master branch - #5174
  • Both branches: add a functional test for restarting a min-compatible-version workflow?

Edit: Oliver has suggested an alternative is implementing a DB upgrader


Generally we need to be careful about changes to the DB structure.

MetRonnie avatar Oct 03 '22 16:10 MetRonnie

Dammit, not sure how I missed that :facepalm:

oliver-sanders avatar Oct 04 '22 08:10 oliver-sanders

Oops, sorry :face_with_spiral_eyes: should have thought of that myself!

hjoliver avatar Oct 09 '22 21:10 hjoliver