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

models: incorrect run number assignment after many restarts #173

Closed
mdonadoni opened this issue Jun 20, 2022 · 2 comments · Fixed by #176
Closed

models: incorrect run number assignment after many restarts #173

mdonadoni opened this issue Jun 20, 2022 · 2 comments · Fixed by #176
Labels

Comments

@mdonadoni
Copy link
Member

How to reproduce:

  1. Execute one workflow (e.g. a demo example)
  2. Restart the workflow ten times
  3. The workflow runs will have the following run numbers:
    • workflow.1 (initial run)
    • workflow.1.1 (first restart)
    • workflow.1.2 (second restart)
    • ...
    • workflow.1.9 (ninth restart)
    • workflow.2 (tenth restart)

However, the tenth restart should be workflow.1.10.

At this point, it is also not possible to create a new workflow (reana-client create ...) with the same name. The workflow creation will fail given that workflow.2 is already being used:

(psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "_user_workflow_run_uc"
DETAIL:  Key (name, owner_id, run_number)=(workflow, 00000000-0000-0000-0000-000000000000, 2) already exists.

The cause of the issue is that run numbers are stored as floats and the new run numbers are generated in this way:

return round(last_workflow.run_number + 0.1, 1)

One possible solution would be to store each run number as two integers and update the rest of the codebase accordingly.

@mdonadoni mdonadoni added type/bug Something isn't working size/xl priority/soon labels Jun 20, 2022
mdonadoni added a commit to mdonadoni/reana-db that referenced this issue Jun 27, 2022
Considering issue reanahub#173, the limit is currently set to permit at most
nine restarts.
@mdonadoni mdonadoni linked a pull request Jun 27, 2022 that will close this issue
@audrium
Copy link
Member

audrium commented Jun 27, 2022

Temporarily closed with #176. Reopening for the future to implement a different way how to store the run_number value in the DB

@audrium
Copy link
Member

audrium commented Nov 29, 2022

Created a new issue to solve the remaining limit of nine restarts #186

@audrium audrium closed this as completed Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants