Add task memory related session properties #14016
Conversation
|
One question is whether these should be called |
fa0526c to
67c3e9a
Compare
|
The commit subject looks too long, here is the 7 rules: https://chris.beams.io/posts/git-commit/ Note sometimes it's too difficult to limit the subject line to 50 characters, but we still want to keep as short as possible (e.g. 60 characters ) What about |
85c62da to
9b4dc18
Compare
|
I would call them max_memory_per_node for consistency. In general our session properties are snake case versions of the config properties. Naming them differently makes it hard to reason about what configuration properties are being overridden. |
presto-main/src/main/java/com/facebook/presto/execution/SqlTaskManager.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/testing/LocalQueryRunner.java
Outdated
Show resolved
Hide resolved
|
Please make sure the tests pass |
5b9d5de to
4928880
Compare
|
@rschlussel made the requested changes, tests are passing. |
swapsmagic
left a comment
There was a problem hiding this comment.
Currently, we do consider max-query-memory and max-query-total-memory in ClusterMemoryManager to kill a query when it uses more memory. Do we want to do the same with this new session properties as well?
Also don't we need the default value for this session properties?
There was a problem hiding this comment.
do we want to mention task here? or just
Maximum amount of total (user + system) memory a query can use
There was a problem hiding this comment.
Yes otherwise the description makes it seem like this a distributed memory setting.
swapsmagic
left a comment
There was a problem hiding this comment.
Ignore the default value comment, realized it does have a default value.
Per node memory limits are enforced at the node as the memory is claimed. Why does ClusterMemoryManager need to be involved? Also you are quoting max-query-memory and max-query-total-memory, these are pre-existing session properties that already work and are consulted by ClusterMemoryManager. Did you mean the per-node variants. |
|
Yes i meant the new per node memory properties. Didn't know that we already have some checks at node level. If it's already been done then it's fine. |
|
A couple questions
|
Where would be the appropriate place to query the session?
Absolutely! Good catch. |
I mean that it looks like we set maxQueryUserMemoryPerNode in the query context directly from the config here: We shouldn't need that anymore since when we need that information we get it from the session property Also, the nodeMemoryConfig that's getting passed in to createQueryContext isn't ever used. |
4928880 to
dc97d4d
Compare
So the problem with removing the initial values from the query context construction is that we can technically construct the query context using only a task ID (no session). It seems safer to have an initial value for those based on the configuration rather then 0 or something hard coded. (We talked about this in person just copying it here for posterity). I removed |
Add query_max_task_memory and query_max_total_task_memory session properties
dc97d4d to
cd50167
Compare
query_max_total_memory_per_nodeis required for a specific memory constrained use cases.query_max_memory_per_nodeis added for completeness.