[SPARK-55510][SS] Fix deleteRange of Rocksdb state store to call changelogWriter#54298
Open
zeruibao wants to merge 3 commits intoapache:masterfrom
Open
Conversation
liviazhu
reviewed
Feb 13, 2026
Contributor
liviazhu
left a comment
There was a problem hiding this comment.
I'm not too familiar with RocksDBStateStoreChangeDataReader, can you get @eason-yuchen-liu 's review?
...rc/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateStoreProvider.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala
Show resolved
Hide resolved
| } | ||
| val nextRecord = reader.next() | ||
| if (nextRecord._1 == RecordType.DELETE_RANGE_RECORD) { | ||
| logWarning(log"Skipping DELETE_RANGE_RECORD in state change data feed " + |
Contributor
There was a problem hiding this comment.
I don't know if a warning is enough. Should we not fail the query?
Contributor
Author
There was a problem hiding this comment.
I don't have preference. you guys can make a call.
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 adds changelog writer support for deleteRange in the RocksDB state store. Previously, deleteRange only performed the RocksDB native range deletion but did not record the operation in the changelog file. The changes include:
Why are the changes needed?
When changelog checkpointing is enabled, the state store recovers by replaying changelog files rather than loading full snapshots. Since deleteRange was not recorded in the changelog, any range deletions were silently lost during changelog-based recovery, leading to data inconsistency -- keys that should have been deleted would reappear after a restart.
Does this PR introduce any user-facing change?
No
How was this patch tested?
UT
Was this patch authored or co-authored using generative AI tooling?
Yes, co-authored with Cursor