Skip to content
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

compute prerequisites for tasks outside n=0 #4036

Closed
oliver-sanders opened this issue Jan 19, 2021 · 12 comments · Fixed by #4874 or #4581
Closed

compute prerequisites for tasks outside n=0 #4036

oliver-sanders opened this issue Jan 19, 2021 · 12 comments · Fixed by #4874 or #4581
Assignees
Labels
bug Something is wrong :(
Milestone

Comments

@oliver-sanders
Copy link
Member

See #3938 (comment)

Tasks that are not active are listed as having no prerequisites. This is especially unhelpful as we are not especially interested in the prerequisites of an active task.

Suggest computing prerequisites for the entire scheduler window (n=1 by default).

@oliver-sanders oliver-sanders added this to the cylc-8.0.0 milestone Jan 19, 2021
@hjoliver
Copy link
Member

Need to test current situation again.

Can we interrogate the hidden pool task proxies (used for tracking prerequisites). Further ahead, we need compute the prerequisites (none of which will be satisfied).

@hjoliver
Copy link
Member

hjoliver commented Oct 8, 2021

Easiest way to do this: temporarily instantiate the target task proxy and grab its cycle point-specific prerequisites.

@hjoliver
Copy link
Member

The datastore should have these anyway, if the node is in the window. DS to check.

@hjoliver
Copy link
Member

Need to check partially satisfied prerequisites.

@hjoliver
Copy link
Member

Currently, the scheduler and DB record partially satisfied prerequisites. (And fully satisfied n=0 tasks).

Historical tasks can be assumed to have satisfied prerequisites, and future tasks unsatisfied.

However, if the scheduler is down the UIS can't ask it to instantiate a transient task to get its prerequisites. And, future tasks are not in the DB.

Maybe the scheduler could dump relevant task information to file so that the UIS can use that to compute prerequisites on the fly for any task in the graph, if the scheduler is down?

@hjoliver
Copy link
Member

hjoliver commented Jan 27, 2022

Summary as of #4581:

Historical task data in the n-window is now loaded from the DB, but that does not include prerequisite satisfaction status except for partially satisfied prerequisites, which are stored in the DB as needed for restarts - which we want to infer from task status rather than add to permanent DB bloat.

So currently:

  • window expansion (i.e. increase n) at run time will cause some succeeded tasks to re-appear that don't show prerequisites satisfied
  • we can't yet request to see historical tasks in the UI (without triggering a reflow) ... but if we could, they would currently have the wrong prerequisite status (but correct data otherwise)
  • if you trigger a reflow back in the graph, window tasks behind the reflow will not show prereqs satisfied, and those ahead of won't either - but in this case that's correct for the reflow
  • all of a task's job are shown, regardless of flow

(From @dwsutherland: It loads it if present in the DB, so for partially satisfied prereqs at n=1 .. Or infact any future task shows the correct prerequisite satisfaction (along with past tasks that stayed in the window since being active))

@hjoliver
Copy link
Member

hjoliver commented Feb 11, 2022

#4581 is merged

Bumping this Issue to rc2.

Historical task data in the n-window is now loaded from the DB, but that does not include prerequisite satisfaction status (except for partially satisfied prerequisites, which are stored in the DB for restarts).

To close this Issue, we need to infer other prerequisites (fully satisfied or fully unsatisfied) from task status rather than add to permanent DB bloat.

(Note 4581 originally closed this issue, by storing all prereqs in the DB, but we backed that out in favor of the above)

@hjoliver hjoliver modified the milestones: cylc-8.0rc1, cylc-8.0rc2 Feb 11, 2022
@MetRonnie MetRonnie added the could be better Not exactly a bug, but not ideal. label Feb 15, 2022
@hjoliver hjoliver self-assigned this May 3, 2022
@hjoliver
Copy link
Member

hjoliver commented May 3, 2022

@dwsutherland - if you haven't started on this, I'll have a crack at it myself (just taking a look at the code now...)

@hjoliver
Copy link
Member

We can close this by reporting no prerequisites (or at least not the satisfaction state of them) for past tasks. See #4849 (comment)

@hjoliver hjoliver modified the milestones: cylc-8.0rc4, cylc-8.0rc3 May 13, 2022
@hjoliver hjoliver added bug Something is wrong :( and removed could be better Not exactly a bug, but not ideal. labels May 13, 2022
@hjoliver
Copy link
Member

(relabeling: reporting past task prerequisites as unsatisfied is a bug)

Moved to rc3 as I thought I had a quick fix ... bug maybe not.

@hjoliver
Copy link
Member

UPDATE on the status of this issue:

Currently the datastore:

  • correctly shows the status of n=0 task prerequisites, and
  • correctly shows future tasks have unsatisfied prerequisites

However, it wrongly shows past tasks loaded from the DB as having unsatisfied prerequisites.

To see this:

[scheduler]
    allow implicit tasks = True
[scheduling]
    [[graph]]
        R1 = "a => b => c => d => e"
[runtime]
    [[c]]
        script = "sleep 1000"

Then do cylc stop --now while c is running, followed by a restart so that 1/b in n=1 has to be loaded from the DB.

Finally, look at the prerequisites reported by cylc show for 1/d (future), 1/c (n=0), and 1/b (past).

As discussed in the last meeting, rather than create DB bloat by retaining prerequisite history for a very niche query (in a conditionally triggered past task, which prerequisites exactly were satisfied to make it trigger?) we will essentially say that past tasks do not have prerequisites - which I think is reasonable.

@hjoliver
Copy link
Member

I thought I had quick fix for this, but getting the datastore to ignore prerequisites of past tasks (status > "running") on loading from the DB. However, that was a bit too simple, as the prerequisites then stay ignored (in the datastore) even if the affected tasks are brought back to life by re-triggering.

@MetRonnie MetRonnie linked a pull request May 16, 2022 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :(
Projects
None yet
4 participants