-
Notifications
You must be signed in to change notification settings - Fork 5
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
KOJO-127 | StateTransitionLogger LADR #74
base: 4.x
Are you sure you want to change the base?
Conversation
Job state transitions are persisted to RDBMS in `Neighborhoods\Kojo\State\Service::applyRequest()`. | ||
To that logic we will add another `INSERT` into a new table: `kojo_job_state_transitions` (working title). | ||
The schema of that table will include all job information (ID, type, etc.) as well as process information (execution environment, PID, etc.). | ||
Those two statements will be wrapped in a database transaction to ensure that nothing is written to `kojo_job_state_transitions` unless the actual transition succeeds. |
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.
@mucha55 how are you planning on using PDO to accomplish this with user-land transactions? testing PDO::inTransaction?
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.
Doctrine DBAL supports "nested" transactions, but even without them this is fine: If there's a userspace transaction happening, because it being rolled back will mean the job state never changes, which means there shouldn't be anything written to kojo_job_state_transitions
anyway
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.
Per an offline discussion, we have to use \PDO
for managing the transaction, since a Doctrine Connection isn't aware of what happens in the \PDO
connection that it was instantiated with
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.
I'd also like to see an example of the message format that the StateTransitionLogger
would be emitting. You can use a placeholder for the Execution Env info object that I'm working on creating now.
There are multiple unknowns with this design which could cause it to become infeasible to implement, in which case we'd have to go with the approach outlined in Alternative 3. | ||
|
||
## Unresolved Questions | ||
* Should we log when a job is created (i.e. scheduled)? |
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.
On the surface I would answer "yes". When an execution cluster is constrained on resources or limited by process pool size, there may be jobs that never exit the waiting
state. In this condition, we'd never see a StateTransitionLogger
message about that job, and only polling kojo_job
would display it.
Is there an implementation detail that makes logging on creation difficult?
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.
After we talked through the implementation a little bit last week, I realized that including job creation is easier than not including it
No description provided.