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

Drop the DbCalcState table #2198

Merged

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Nov 13, 2018

Fix #2197

The DbCalcState table was introduced to both keep the current job state
of JobCalculations but also to function as a sort of locking mechanism
to ensure only one process was operating on a job at a time, by enforcing
progressive state changes on the database level. In the new system, this
responsibility is taken care of by the Runner class that is running the
task corresponding to the job calculation. The calculation state is now
merely set as on the node for informational purposes to the user.

Therefore, the simpler solution is to set the job state as a simple attribute
and remove the DbCalcState. This also means that the IMPORTED calc state
is now obsolete, as that was needed to prevent imported calculations from
being picked up by the daemon, which used to determine what calculations to
run based on its calculation state.

@sphuber
Copy link
Contributor Author

sphuber commented Nov 13, 2018

@giovannipizzi a related problem to what you were discussing with leopold today. For this PR I removed the DbCalcState model as it is no longer needed, but the second migration which was added to introduce this very model, relies on it but when it now tries to import it, it will fail. Not sure how to fix this. You have an idea of the right approach?

@sphuber
Copy link
Contributor Author

sphuber commented Nov 13, 2018

Ah maybe the old models will be serialized and stored somewhere once I put in the migration to actually delete this model. I will check this tomorrow

@giovannipizzi
Copy link
Member

A few interesting notes:

@sphuber sphuber force-pushed the fix_2197_drop_calc_state_table branch 3 times, most recently from 38f64d2 to b58af1f Compare November 14, 2018 07:55
@coveralls
Copy link

coveralls commented Nov 14, 2018

Coverage Status

Coverage decreased (-0.2%) to 67.356% when pulling 7ac53ae on sphuber:fix_2197_drop_calc_state_table into 2f1b74a on aiidateam:provenance_redesign.

@sphuber sphuber force-pushed the fix_2197_drop_calc_state_table branch from b58af1f to 1444480 Compare November 14, 2018 08:21
@sphuber sphuber changed the title [WIP] Drop the DbCalcState table Drop the DbCalcState table Nov 14, 2018
@sphuber sphuber force-pushed the fix_2197_drop_calc_state_table branch from 1444480 to 7dc049d Compare November 14, 2018 08:55
The `DbCalcState` table was introduced to both keep the current job state
of `JobCalculations` but also to function as a sort of locking mechanism
to ensure only one process was operating on a job at a time, by enforcing
progressive state changes on the database level. In the new system, this
responsibility is taken care of by the `Runner` class that is running the
task corresponding to the job calculation. The calculation state is now
merely set as on the node for informationalpurposes to the user.

Therefore, the simpler solution is to set the job state as a simple attribute
and remove the `DbCalcState`. This also means that the `IMPORTED` calc state
is now obsolete, as that was needed to prevent imported calculations from
being picked up by the daemon, which used to determine what calculations to
run based on its calculation state.
@sphuber sphuber merged commit 0b38fd5 into aiidateam:provenance_redesign Nov 14, 2018
@sphuber sphuber deleted the fix_2197_drop_calc_state_table branch November 14, 2018 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants