Skip to content

fix: warn about the deprecated memoryPool.fraction when it is set on the session - #7567

Draft
tlfua wants to merge 1 commit into
apache:mainfrom
tlfua:tlfua/docs/6187-memory-pool-docs
Draft

tlfua wants to merge 1 commit into
apache:mainfrom
tlfua:tlfua/docs/6187-memory-pool-docs

Conversation

@tlfua

@tlfua tlfua commented Nov 8, 2026 •

Copy link
Copy Markdown

Which issue does this PR close?

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

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?

  • 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?

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.

…the session

The deprecation warning for spark.comet.exec.memoryPool.fraction only
checked the SparkConf in the driver plugin, but the value is read 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,
got no warning. CometExecRule now checks the session conf too, and the
warning is logged once per JVM.

Also state in the memory tuning guide that fair_unified limits each task
to the fraction times spark.memory.offHeap.size.

Part of apache#6187

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 1da6c065-9ae0-4ad5-a84d-12fe9e45d920
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant