Drop the DbCalcState table#2198
Merged
sphuber merged 1 commit intoNov 14, 2018
Merged
Conversation
Contributor
Author
|
@giovannipizzi a related problem to what you were discussing with leopold today. For this PR I removed the |
Contributor
Author
|
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 |
Member
|
A few interesting notes:
|
38f64d2 to
b58af1f
Compare
b58af1f to
1444480
Compare
1444480 to
7dc049d
Compare
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.
7dc049d to
7ac53ae
Compare
giovannipizzi
approved these changes
Nov 14, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #2197
The
DbCalcStatetable was introduced to both keep the current job stateof
JobCalculationsbut also to function as a sort of locking mechanismto 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
Runnerclass that is running thetask 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 theIMPORTEDcalc stateis 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.