-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Set TrackConsumersPool
as default in datafusion-cli
#16081
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
datafusion-cli/tests/snapshots/cli_top_memory_consumers@no_track.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: datafusion-cli/tests/cli_integration.rs | ||
info: | ||
program: datafusion-cli | ||
args: | ||
- "--memory-limit" | ||
- 10M | ||
- "--command" | ||
- "select * from generate_series(1,500000) as t1(v1) order by v1;" | ||
- "--top-memory-consumers" | ||
- "0" | ||
--- | ||
success: false | ||
exit_code: 1 | ||
----- stdout ----- | ||
[CLI_VERSION] | ||
Error: Not enough memory to continue external sort. Consider increasing the memory limit, or decreasing sort_spill_reservation_bytes | ||
caused by | ||
Resources exhausted: Failed to allocate | ||
|
||
----- stderr ----- |
24 changes: 24 additions & 0 deletions
24
datafusion-cli/tests/snapshots/cli_top_memory_consumers@top2.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
source: datafusion-cli/tests/cli_integration.rs | ||
info: | ||
program: datafusion-cli | ||
args: | ||
- "--memory-limit" | ||
- 10M | ||
- "--command" | ||
- "select * from generate_series(1,500000) as t1(v1) order by v1;" | ||
- "--top-memory-consumers" | ||
- "2" | ||
--- | ||
success: false | ||
exit_code: 1 | ||
----- stdout ----- | ||
[CLI_VERSION] | ||
Error: Not enough memory to continue external sort. Consider increasing the memory limit, or decreasing sort_spill_reservation_bytes | ||
caused by | ||
Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: | ||
Consumer(can spill: bool) consumed XB, | ||
Consumer(can spill: bool) consumed XB. | ||
Error: Failed to allocate | ||
|
||
----- stderr ----- |
23 changes: 23 additions & 0 deletions
23
datafusion-cli/tests/snapshots/cli_top_memory_consumers@top3_default.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
source: datafusion-cli/tests/cli_integration.rs | ||
info: | ||
program: datafusion-cli | ||
args: | ||
- "--memory-limit" | ||
- 10M | ||
- "--command" | ||
- "select * from generate_series(1,500000) as t1(v1) order by v1;" | ||
--- | ||
success: false | ||
exit_code: 1 | ||
----- stdout ----- | ||
[CLI_VERSION] | ||
Error: Not enough memory to continue external sort. Consider increasing the memory limit, or decreasing sort_spill_reservation_bytes | ||
caused by | ||
Resources exhausted: Additional allocation failed with top memory consumers (across reservations) as: | ||
Consumer(can spill: bool) consumed XB, | ||
Consumer(can spill: bool) consumed XB, | ||
Consumer(can spill: bool) consumed XB. | ||
Error: Failed to allocate | ||
|
||
----- stderr ----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,9 @@ OPTIONS: | |
--mem-pool-type <MEM_POOL_TYPE> | ||
Specify the memory pool type 'greedy' or 'fair', default to 'greedy' | ||
|
||
--top-memory-consumers <TOP_MEMORY_CONSUMERS> | ||
ding-young marked this conversation as resolved.
Show resolved
Hide resolved
|
||
The number of top memory consumers to display when query fails due to memory exhaustion. To disable memory consumer tracking, set this value to 0 [default: 3] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Description updated |
||
|
||
-d, --disk-limit <DISK_LIMIT> | ||
Available disk space for spilling queries (e.g. '10g'), default to None (uses DataFusion's default value of '100g') | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[nitpick] The logic for wrapping Fair and Greedy pools with TrackConsumersPool is duplicated. Consider refactoring this common functionality into a helper function to reduce code duplication.
Copilot uses AI. Check for mistakes.
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.
@2010YOUY01 I ended up keeping the match statement as is since
TrackConsumersPool::new()
requires a concrete type implementingMemoryPool
, and we can't wrap adyn MemoryPool
directly. 😢