Skip to content
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

[CARBONDATA-3958] Avoid blocking the loading task when the output queue poll timeout #3897

Closed
wants to merge 1 commit into from

Conversation

QiangCai
Copy link
Contributor

@QiangCai QiangCai commented Aug 24, 2020

Why is this PR needed?

In some cases, the CDC merge tasks are blocked when data loading uses CarbonTableOutputFormat.getRecordWriter method. PR #3856 change the code to avoid using CarbonTableOutputFormat.getRecordWriter, CDC merge will not happen this issue again. But this issue maybe happen in other similar scenarios.

Because the poll method of the queue is time out in some cases, so the row batch in the queue will not be polled again.

After the queue is full, the queue blocks the writing task puts a new batch. Even if the queue is not full, it will also lose the row batch in the queue.

What changes were proposed in this PR?

If the output is not closed, it will poll a row batch in the loops till it gets a not null batch.
If the output is closed, it will break the loop.

Does this PR introduce any user interface change?

  • No

Is any new testcase added?

  • No

@CarbonDataQA1
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/2106/

@CarbonDataQA1
Copy link

Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3847/

@QiangCai
Copy link
Contributor Author

retest this please

@ravipesala
Copy link
Contributor

LGTM,
Anyway we are not using it in CDC as per the PR #3856.
This case not supposed to happen, it means source is not writing any data for more than 5 minutes. It should be some exceptional scenarios.

@akashrn5
Copy link
Contributor

@QiangCai as @ravipesala said since we are not using this, may be once after #3856 is merged, we can check and close this i think.

@CarbonDataQA1
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/2110/

@CarbonDataQA1
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3851/

@QiangCai
Copy link
Contributor Author

@ravipesala @akashrn5 we can merge it also. In the future, other cases can use CarbonTableOutputFormat and this issue will not happen.

@QiangCai QiangCai changed the title [CARBONDATA-3958] Fix CDC merge tasks can't finish issue [CARBONDATA-3958] Avoid blocking the loading task when the output queue poll timeout Aug 25, 2020
@akashrn5
Copy link
Contributor

retest this please

@CarbonDataQA1
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3864/

@CarbonDataQA1
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/2123/

@akashrn5
Copy link
Contributor

LGTM

@asfgit asfgit closed this in 1ccfb9b Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants