-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Bug-fix][Broker-load] Fix the bug of the label already exists when the txn has been finished #1992
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
Conversation
ef99804 to
968c3f0
Compare
|
|
||
| @Override | ||
| protected void executeReplayOnVisible(TransactionState txnState) { | ||
| protected void executeReplayTxnAttachment(TransactionState txnState) { |
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.
| protected void executeReplayTxnAttachment(TransactionState txnState) { | |
| protected void replayTxnAttachment(TransactionState txnState) { |
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.
Changed
| map.put(loadJob.getLabel(), jobs); | ||
| } | ||
| jobs.add(loadJob); | ||
| if (!loadJob.isCompleted()) { |
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.
Add some comment to explain this operation
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.
OK
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be done in prepareJobs();
| writeLock(); | ||
| try { | ||
| executeReplayOnVisible(txnState); | ||
| executeReplayTxnAttachment(txnState); |
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 think the name executeReplayTxnAttachment should be changed.
Or calling a "replay" method in "non-replay" method is weird
imay
left a comment
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.
LGTM
…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
4c60657
Compare
morningman
left a comment
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.
LGTM
imay
left a comment
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.
LGTM
…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.