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

Ignoring of memory-pool limits & OOM on large cartesian-product join #5162

Closed
DDtKey opened this issue Feb 2, 2023 · 7 comments · Fixed by #5339
Closed

Ignoring of memory-pool limits & OOM on large cartesian-product join #5162

DDtKey opened this issue Feb 2, 2023 · 7 comments · Fixed by #5339
Labels
bug Something isn't working

Comments

@DDtKey
Copy link
Contributor

DDtKey commented Feb 2, 2023

Describe the bug
There is an issue with possible OOM instead of ResourcesExhausted
Probably related to usage of unbounded channels (I believe it should be avoided actually)

To Reproduce

MRE to achieve ignoring of memory-pool with large Cartesian product:

CSV File example (250mb): GDrive link - it's random file and column to join by has the same value for all records (so it's cartesian product)

Memory pool limit: FairSpillPool::new(4 * 1024 * 1024 * 1024)

SQL:
SELECT * FROM rnd rnd1 JOIN rnd rnd2 ON rnd1."s3_drive" = rnd2."s3_drive"

Expected behavior

It should returnResourcesExhausted error with configured MemoryPool

Additional context
Add any other context about the problem here.

A part of this was described in the discussion here: #5108 (comment), but there was mentioned the regression.
This example isn't regression and it's reproducible for old versions

@DDtKey DDtKey added the bug Something isn't working label Feb 2, 2023
@DDtKey DDtKey changed the title Regression: ignoring of memory-pool limits & OOM on join-repartitions Ignoring of memory-pool limits & OOM on large cartesian-product join Feb 2, 2023
@DDtKey
Copy link
Contributor Author

DDtKey commented Feb 2, 2023

I've changed the description, because this case isn't regression like one that was mentioned in #5108 by me. And probably more related to/part of #3941.

@alamb
Copy link
Contributor

alamb commented Feb 2, 2023

I've changed the description, because this case isn't regression like one that was mentioned in #5108 by me. And probably more related to/part of #3941.

Thank you @DDtKey -- I agree this is a feature gap (limiting memory usage by joins)

@korowa
Copy link
Contributor

korowa commented Feb 28, 2023

It seems I was wrong about #5339 closing this issue, my bad 😞 . This query shouldn't produce CROSS JOIN, and memory limitation for hash join required to fix this issue.

@DDtKey
Copy link
Contributor Author

DDtKey commented Feb 28, 2023

It seems I was wrong about #5339 closing this issue, my bad 😞 . This query shouldn't produce CROSS JOIN, and memory limitation for hash join required to fix this issue.

Yes, I think so, because this query produces hash-join in plan (or sort merge if enable preference) , but results in Cartesian product actually due to the same values in columns

But anyway it's great that one of the joins is covered 🙂

@korowa
Copy link
Contributor

korowa commented Feb 28, 2023

I guess I'll fix Hash Join using the same approach in a couple of days then 🙃

@alamb alamb reopened this Feb 28, 2023
@alamb
Copy link
Contributor

alamb commented Feb 28, 2023

Thank you @korowa

@Dandandan Dandandan reopened this Mar 14, 2023
@Dandandan
Copy link
Contributor

Closed by #5564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants