Uh oh!
There was an error while loading. Please reload this page.
[Bug-fix][Broker-load] Fix the bug of the label already exists when the txn has been finished - #1992
Conversation
EmmyMiao87
commented
Oct 16, 2019
ef99804 to
968c3f0Compare| @Override | ||
| protected void executeReplayOnVisible(TransactionState txnState) { | ||
| protected void executeReplayTxnAttachment(TransactionState txnState) { |
There was a problem hiding this comment.
| protectedvoidexecuteReplayTxnAttachment(TransactionStatetxnState) { | |
| protectedvoidreplayTxnAttachment(TransactionStatetxnState) { |
| map.put(loadJob.getLabel(), jobs); | ||
| } | ||
| jobs.add(loadJob); | ||
| if (!loadJob.isCompleted()) { |
There was a problem hiding this comment.
Add some comment to explain this operation
There was a problem hiding this comment.
I think you should use another way to achieve this. When this function is called, Catalog is not ready. However you start to use Catalog's item, this is error-prone.
There was a problem hiding this comment.
The callback need to be add in here. The reason is that the replay of txn maybe use the callback and reload the job state.
| map.put(loadJob.getLabel(), jobs); | ||
| } | ||
| jobs.add(loadJob); | ||
| if (!loadJob.isCompleted()) { |
There was a problem hiding this comment.
I think you should use another way to achieve this. When this function is called, Catalog is not ready. However you start to use Catalog's item, this is error-prone.
morningman
left a comment
There was a problem hiding this comment.
Some other questions:
isCommittingandisCancellablevariable in LoadJob.java is confusing. Add some comments.
And it seems thatisCancellableis useless.
| } | ||
| jobs.add(loadJob); | ||
| if (!loadJob.isCompleted()) { | ||
| Catalog.getCurrentGlobalTransactionMgr().getCallbackFactory().addCallback(loadJob); |
There was a problem hiding this comment.
This should be done in prepareJobs();
| writeLock(); | ||
| try { | ||
| executeReplayOnVisible(txnState); | ||
| executeReplayTxnAttachment(txnState); |
There was a problem hiding this comment.
I think the name executeReplayTxnAttachment should be changed.
Or calling a "replay" method in "non-replay" method is weird
…he txn has been finished If FE is restarted between txn committed and visible, the load job will be rescheduled and failed with label already exists. The reason is that there are inconsistency between transaction of load job and meta of load job. So, the replay of the txn attachment need to be done in function replayOnCommitted. The load job state and progress is correct after that.
f4f051e to
4c60657Compare…he txn has been finished (apache#1992) If FE is restarted between txn committed and visible, the load job will be rescheduled and failed with label already exists. The reason is that there are inconsistency between transaction of load job and meta of load job. So, the replay of the txn attachment need to be done in function replayOnCommitted. The load job state and progress is correct after that.
…he txn has been finished (apache#1992) If FE is restarted between txn committed and visible, the load job will be rescheduled and failed with label already exists. The reason is that there are inconsistency between transaction of load job and meta of load job. So, the replay of the txn attachment need to be done in function replayOnCommitted. The load job state and progress is correct after that.
If FE is restarted between txn committed and visible, the load job will be rescheduled and failed with label already exists.
The reason is that there are inconsistency between transaction of load job and meta of load job.
So, the replay of the txn attachment need to be done in function replayOnCommitted.
The load job state and progress is correct after that.