mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
The admission request may contain the lineage graphs and other stuff that the admission control service doesn't need. For example, currently the admission controller service would hold onto the full TQueryExecRequest object for the entire lifetime of a query, even after the admission decision was complete. This led to unnecessary memory consumption. This commit introduces two optimizations for reducing the memory footprint: 1. A lightweight copy of TQueryExecRequest is now created on the client side before sending to the admission control service. Fields that are not required for admission decisions (e.g., query_plan, lineage_graph) are cleared from this copy. 2. The AdmissionState now uses a unique_ptr to manage the TQueryExecRequest. This allows the object's memory to be explicitly released as soon as the query schedule is generated and the request object is no longer needed. During a customized high concurrent TPCDS run, without the change, the peak memory usage in admissiond was around 2GB. With this change, it required less than half that memory. Tests: Passed exhaustive tests. Change-Id: I1ba5e8818336bd1fc3ad604a0acee5eb7a1116c4 Reviewed-on: http://gerrit.cloudera.org:8080/23546 Reviewed-by: Michael Smith <michael.smith@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Reviewed-by: Abhishek Rawat <arawat@cloudera.com>