Skip to content

[Bugfix](schema change) fix memory exceeded when schema change#11748

Merged
morningman merged 3 commits intoapache:masterfrom
Lchangliang:fix-schema-change
Aug 15, 2022
Merged

[Bugfix](schema change) fix memory exceeded when schema change#11748
morningman merged 3 commits intoapache:masterfrom
Lchangliang:fix-schema-change

Conversation

@Lchangliang
Copy link
Contributor

@Lchangliang Lchangliang commented Aug 12, 2022

Proposed changes

Issue Number: close #xxx

Problem summary

In row mode schema change, it will fail sometime because memory exceeded. When the left memory is enough for sorting but not enough for next block, it will not flush row_block_arr which data in memory and continue to alloc next block so it can't alloc the memory and return directly. And if it can't alloc the memory for block, it need to flush row_block_arr and try it again unless row_block_arr is empty.

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • No

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename OLAP_ERR_INPUT_PARAMETER_ERROR to other status code which can express memory exceeds limit.

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Aug 15, 2022
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@morningman morningman merged commit 71df826 into apache:master Aug 15, 2022
yiguolei pushed a commit to yiguolei/incubator-doris that referenced this pull request Aug 16, 2022
…1748)

In row mode schema change, it will fail sometime because memory exceeded.
When the left memory is enough for sorting but not enough for next block,
it will not flush row_block_arr which data in memory and continue to alloc next block
so it can't alloc the memory and return directly.
And if it can't alloc the memory for block, it need to flush row_block_arr and
try it again unless row_block_arr is empty.
yiguolei pushed a commit to yiguolei/incubator-doris that referenced this pull request Aug 16, 2022
…1748)

In row mode schema change, it will fail sometime because memory exceeded.
When the left memory is enough for sorting but not enough for next block,
it will not flush row_block_arr which data in memory and continue to alloc next block
so it can't alloc the memory and return directly.
And if it can't alloc the memory for block, it need to flush row_block_arr and
try it again unless row_block_arr is empty.
yiguolei added a commit that referenced this pull request Aug 16, 2022
…11813)

In row mode schema change, it will fail sometime because memory exceeded.
When the left memory is enough for sorting but not enough for next block,
it will not flush row_block_arr which data in memory and continue to alloc next block
so it can't alloc the memory and return directly.
And if it can't alloc the memory for block, it need to flush row_block_arr and
try it again unless row_block_arr is empty.

Co-authored-by: Lightman <31928846+Lchangliang@users.noreply.github.com>
GoGoWen added a commit to GoGoWen/incubator-doris that referenced this pull request Aug 31, 2022
[fix](schema change) fix memory exceeded when schema change (apache#11748) …
Henry2SS pushed a commit to Henry2SS/incubator-doris that referenced this pull request Sep 14, 2022
…1748) (apache#11813)

In row mode schema change, it will fail sometime because memory exceeded.
When the left memory is enough for sorting but not enough for next block,
it will not flush row_block_arr which data in memory and continue to alloc next block
so it can't alloc the memory and return directly.
And if it can't alloc the memory for block, it need to flush row_block_arr and
try it again unless row_block_arr is empty.

Co-authored-by: Lightman <31928846+Lchangliang@users.noreply.github.com>
GoGoWen pushed a commit to GoGoWen/incubator-doris that referenced this pull request Sep 28, 2022
…1748)

In row mode schema change, it will fail sometime because memory exceeded.
When the left memory is enough for sorting but not enough for next block,
it will not flush row_block_arr which data in memory and continue to alloc next block
so it can't alloc the memory and return directly.
And if it can't alloc the memory for block, it need to flush row_block_arr and
try it again unless row_block_arr is empty.
Conflicts:
	be/src/olap/schema_change.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/merge-1.1.2 reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants