tlfua opened a new pull request, #7567:
URL: https://github.com/apache/datafusion-comet/pull/7567
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases. You can
link an issue to this PR using the GitHub syntax. For example `Closes #123`
indicates that this PR will close issue #123.
-->
Part of #6187. This addresses item 2 and the remaining wording in item 1.
Item 3 (tests that use the fraction to force spills) is left open; see the note
below.
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in
the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your
changes and offer better suggestions for fixes.
-->
The deprecation warning for `spark.comet.exec.memoryPool.fraction` only
checks the SparkConf in the driver plugin, but
`CometExecIterator.getMemoryConfig` reads the value from the session conf for
each query. A value set with `SET` or `spark.conf.set`, or in an application
that registers the session extension without the plugin, takes effect without a
warning.
Item 1 is mostly resolved by #7096 and the guide rewrites that followed it.
The `fair_unified` pool now limits each task to `min(spark.memory.offHeap.size
/ running_tasks, pool_size)`, and both guides and the config doc already
describe the fraction as a per-task cap. The user guide still did not say what
the cap is.
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is
sometimes worth providing a summary of the individual changes in this PR.
-->
- `CometDriverPlugin.warnIfMemoryPoolFractionSet` takes the value to check
and logs the warning at most once per JVM.
- The driver plugin passes the SparkConf value, as before. `CometExecRule`
passes the session conf value of each query, so `SET`, `spark.conf.set` and
extension-only sessions are covered too. Because of the once-per-JVM flag, a
session that sets the fraction after it has already been warned about gets no
second warning.
- The memory tuning guide states that `fair_unified` limits each task to the
fraction times `spark.memory.offHeap.size`.
The migration guide is unchanged: the 1.1.0 note that the driver logs a
warning still holds, and this change adds no behavior change.
Item 3 is not addressed here. The fraction is set to force spills in more
places than `CometTaskMetricsSuite`: `CometAggregateSuite`, `CometExecSuite`,
`CometNativeSuite`, `CometParquetWriterSuite`, `CometIcebergWriteActionSuite`
and `CometExecIteratorLifecycleSuite` use it too. Whether to move the config to
the testing category or replace it in tests is still open in the issue.
## How are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are
they covered by existing tests)?
-->
`CometPluginsMemoryPoolFractionWarningSuite` gains a test that sets the
fraction with `withSQLConf`, runs two queries and asserts the warning is logged
exactly once. It fails without this change because only the SparkConf was
checked. The existing tests now reset the once-per-JVM flag first.
- `make format` (Maven `compile test-compile`, scalafix and spotless):
passed locally.
- `npx prettier --check docs/source/user-guide/latest/tuning/memory.md`:
passed.
- The JVM test suites were not run locally; they run in the fork CI:
https://github.com/tlfua/datafusion-comet/actions/runs/42432188048
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]