-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store task prerequisites in their own DB table #3863
Conversation
Looks good to me, note to others, this change does not have an upgrader for the database. We have abandoned the idea of maintaining restart compatibility with Cylc7 due to installation changes amongst other things so this is fine. Just be aware that |
Does that mean that the following test: cylc-flow/tests/functional/retries/03-upgrade.t Lines 18 to 27 in 96f5603
which is failing due to
can be removed? |
Sure, but if removing, remove all upgraders and their associated tests. |
Still need to detect when trying to restart a Cylc 7 suite and give a useful error message |
Would it be worth renaming the |
The Cylc version of the current run (even if the suite is stopped it can still be thought of as the current "run") has been stored in the database since Cylc 7.something: $ sqlite3 <path-to-suite>/.service/db 'SELECT value FROM suite_params WHERE key = "cylc_version";' Wasn't expecting this as part of this PR but if you're happy to take a crack at it that would be great. If the SQL execution fails then assume that the Cylc version is less than 8. |
Is there any reason not to rename the db file, though? It would make the logic simpler |
Yes, people may be using it, if an SQL call is too much work why not use the presence of the Note we don't really need to worry about inter-version compatibility between alpha releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, works ok.
One thing left to do, the task_pool table is housekept so as to keep it in sync with the task pool. The same logic will need to apply to the task_prereqs table otherwise it will continue to grow indefinitely.
Had a quick fish about in the code and it looks like the suite_db_mgr
wipes and rebuilds the task_pool and it's related tables for each batch of changes 🤮. The rundb performs all queued insertions and deletions in the same transition so that's probably not as bad as it sounds (depending on the implementation of the database), presumably just means sqlite has to do a bit more legwork to compute what's actually changed?
Probs best to turn a blind eye to this and just fit the task_prerequsites
table into the existing global-update pattern. Perhaps in a later Cylc8 version as we try to make the main loop more async we will make DB updates more event-driven and remove this per-loop global-update logic in the process.
Like this: 01e0798 ? |
@oliver-sanders Looks like that will need a |
Ah, perhaps disable that test for now and add a comment to the checkpoints issue. |
To checkpoint or not to checkpoint?! |
BLOCKED by #3864 |
Can we just disable these tests for now and add a note to #3864 for now, then reinstate checkpoint functionality later if required? |
We could, but is there any reason we can't make a quick decision on removing named checkpointing. All the facts are "on the table" already. |
If named checkpoints are removed does that mean automatic checkpoints are also removed? |
Perhaps but it's a bit off topic for this PR to go removing all of the named checkpointing logic.
Any logic relating to the |
Arguable, but fair enough - my feeling was, this PR breaks checkpointing as-is, so let's wait on the checkpointing decision to know if this PR should be amended or not. Moot point now, as @dpmatthews has agreed on removal on Element chat - I'll remove the blocked label... |
Previously we were abusing the task_pool table by storing prereqs as a JSON string in a column there. Now, the prereqs are stored in the new task_prerequisites table instead.
Because we are droppping the idea of being able to restart a Cylc 7 suite in Cylc 8
If incompatible or missing db, raise meaningful exception
method for updating the table
To be fully removed - cylc#3891
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks @MetRonnie 🎉
These changes close #3752
Instead of storing task prerequisites as a JSON string inside the
task_pool
table, remove thesatisfied
column fromtask_pool
and introduce atask_prerequisites
table.Note: This PR removes the ability to restart a Cylc 7 suite.
For the flow (where
foo.1
fails)the
task_prerequisites
table has the form:where asterisk in the column header denotes primary key.
A task's prerequisites are inserted into the
task_prerequisites
table when the task is added to the runahead pool (if a task has no prerequisites, no entry is inserted to thetask_prerequisites
table). Thetask_prerequisites
table is updated at the same time as before when the prerequisites used to be updated in thetask_pool
table.Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.