[SPARK-55728][SS] Introduce RocksDB conf for file checksum threadpool size#54529
Open
gnanda wants to merge 3 commits intoapache:masterfrom
Open
[SPARK-55728][SS] Introduce RocksDB conf for file checksum threadpool size#54529gnanda wants to merge 3 commits intoapache:masterfrom
gnanda wants to merge 3 commits intoapache:masterfrom
Conversation
micheal-o
reviewed
Feb 27, 2026
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Outdated
Show resolved
Hide resolved
micheal-o
reviewed
Feb 27, 2026
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Outdated
Show resolved
Hide resolved
...a/org/apache/spark/sql/execution/streaming/checkpointing/ChecksumCheckpointFileManager.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StateStoreConf.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBSuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBSuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBSuite.scala
Outdated
Show resolved
Hide resolved
8a7db3b to
8167c56
Compare
ericm-db
reviewed
Mar 2, 2026
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala
Outdated
Show resolved
Hide resolved
holdenk
reviewed
Mar 3, 2026
Comment on lines
+136
to
+137
| * If file manager is shared by multiple threads, set it to | ||
| * number of concurrent callers * 2. |
Contributor
There was a problem hiding this comment.
Should this go over in the doc config? Also how would a user figure out how many threads are going to be accessing it?
holdenk
reviewed
Mar 3, 2026
Comment on lines
+304
to
+305
| threadPool.foreach { pool => | ||
| pool.shutdown() |
Contributor
There was a problem hiding this comment.
Maybe silly but would it make sense to do this first foreach and then the subsequent blocking checkin? It's only during shutdown so not a big deal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR introduces a new configuration, spark.sql.streaming.stateStore.fileChecksumThreadPoolSize (internal), that controls the number of threads used by ChecksumCheckpointFileManager when concurrently writing/reading the main checkpoint file
and its .crc sidecar.
Key changes:
hardcoded Some(4) in RocksDB.
Internally, Future scheduling is unified through a scheduleOrRun helper that dispatches to the pool or runs synchronously. close() is a no-op when no pool was created.
Why are the changes needed?
The thread pool size was previously hardcoded to 4 inside RocksDB. There was no way to tune it for environments where the default is either wasteful (e.g. single-threaded test scenarios) or insufficient (e.g. high-concurrency deployments). In
particular, setting numThreads = 0 provides a clean sequential mode useful for unit tests and for deployments that do not need concurrent file I/O.
Does this PR introduce any user-facing change?
No. The new config is marked internal(). Behavior is unchanged at the default value of 4.
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code 2.1.58