Added FaTE TStatus.SUBMITTED#2462
Conversation
When a FaTE transaction is created in the Manager its status is set to IN_PROGRESS even though it's not actually running, it could be waiting to run. The output from the `fate print` command will show that the newly created transaction is IN_PROGRESS and could be confusing to users. This change introduces the SUBMITTED state, which is the state of the transaction after it has been created but before it is executed.
ctubbsii
left a comment
There was a problem hiding this comment.
I'm not really sure I understand the difference between the NEW state that already exists and your new SUBMITTED state.
Co-authored-by: Christopher Tubbs <ctubbsii@apache.org>
Prior to this change, when With this change, there is an intermediate state (SUBMITTED). Here's an excerpt from FateIT: |
|
I took a quick look and confirmed that the metrics look okay - the TX state is added to the expected states. |
No requested changes. Just a comment remaining.
|
I just had a thought for an alternative approach. I am not sure if it is a better solution to adding the |
|
So, currently the NEW fate transactions are aged off. If we moved NEW to mean SUBMITTED, then we would need another state to still exist so that they could be aged off. At that point, we're at the same place. |
I was thinking to not store the TxD in ZK. It doesn't look like we are really doing anything between the creation and seeding. |
I'm not sure of the side effects of that approach, if any. Will need someone else with more FaTE knowledge to chime in. |
Yeah, I am not sure either. One side effect, which I think would be a good one, would be less TxIDs created in ZK. Currently the call to create the TxID is technically repeatable but it will create a lot of extra TxIDs in ZK and extra calls to ZK to age them off. The TxID is just a random number so its not like we are tracking it for other purposes, like we do with TableId. |
Isn't storing it in ZK guaranteeing it's unique, though? |
Yes |
|
@milleruntime - are you good with this approach then considering the discussion? |
Yeah I think this approach is fine. I wanted to look through the code closer but if its holding you up, feel free to merge. |
| store.setProperty(tid, DEBUG_PROP, repo.getDescription()); | ||
|
|
||
| store.setStatus(tid, TStatus.IN_PROGRESS); | ||
| store.setStatus(tid, TStatus.SUBMITTED); |
There was a problem hiding this comment.
I think there are some OPs that do work in the isReady() function so I wonder if changing when it gets set to IN_PROGRESS will affect them. I will see if I can find one.
There was a problem hiding this comment.
The BulkImport and Compact operations do things in the isReady() function. I don't know if it matters if the status is IN_PROGRESS or SUBMITTED though.
There was a problem hiding this comment.
Also the ShutdownTServer operation
milleruntime
left a comment
There was a problem hiding this comment.
As far as I can tell, moving the setting of the status, shouldn't affect the business logic in the operations. But we should probably do something about the operations that are doing stuff in the isReady() method since we can't assume this method is just checking things. It looks like the worst offenders are: BulkImport, Compact and the ShutdownTServer operations
|
I created a follow on: #2466 |
When a FaTE transaction is created in the Manager its status is set
to IN_PROGRESS even though it's not actually running, it could be
waiting to run. The output from the
fate printcommand will showthat the newly created transaction is IN_PROGRESS and could be
confusing to users. This change introduces the SUBMITTED state, which
is the state of the transaction after it has been created but before
it is executed.