-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Improve configuration and resource use of MemoryManager and DiskManager
#1668
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
| self | ||
| } | ||
|
|
||
| /// Use an an existing [MemoryManager] |
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.
Here is the new public API
| Ok(()) | ||
|
|
||
| #[tokio::test] | ||
| #[should_panic(expected = "invalid max_memory. Expected greater than 0, got 0")] |
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.
previously such config errors would panic
datafusion/src/execution/context.rs
Outdated
|
|
||
| let ctx2 = ExecutionContext::with_config(config); | ||
|
|
||
| assert!(std::ptr::eq(Arc::as_ptr(&memory_manager), Arc::as_ptr(&ctx1.runtime_env().memory_manager))); |
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.
Here is the tests for the primary usecase we have in IOx -- sharing DiskManager and MemoryManagers across plans
dfbd077 to
87c541a
Compare
yjshen
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.
Great config design! I really like the introduced enum configs.
|
Thanks @yjshen -- I think since this basically only affects you and I for the time being I will update this PR and merge it in |
Which issue does this PR close?
Resolves #1636
Rationale for this change
Creation of an
RuntimeEnvcreates a temporary directory, even when it is not used. This is unecessary per-query overheadAlso, since there is no way to share
MemoryMangerandDiskManagers acrossRuntimeEnv'sit is not possible to get a "global" view of memory / disk use across multiple queries running concurrently.Also, certain invalid memory configuration values will panic, rather than error when set incorrectly
What changes are included in this PR?
Changes:
DiskManagerConfigandMemoryManagerConfigfor configuring how disk and memory are managedMemoryManagerandDiskManagerrather than always creating them newAre there any user-facing changes?
Will be a change to anyone who was using the RuntimeConfig but since it was introduced recently I don't think that is very many