Skip to content

[SS][SPARK-52637] Fix version ID mismatch issue for RocksDB compaction leading to incorrect file mapping #51520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

liviazhu
Copy link
Contributor

What changes were proposed in this pull request?

We found a bug leading to checkpoint corruption with RocksDB VersionID Mismatch error due to local file mappings not being cleared correctly when native RocksDB does a compaction resulting in the original SST file not being deleted. This resulted in the DFS file UUID being reused for 2 SST files that were not the same, leading the version ID mismatch.

This change purges from the local file mappings any mapping that was created by a version equal or greater than the one loaded.

Why are the changes needed?

The described bug fails streaming queries.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

New unit test

Was this patch authored or co-authored using generative AI tooling?

No

Copy link
Contributor

@anishshri-db anishshri-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm pending green CI

@anishshri-db
Copy link
Contributor

@liviazhu - can you check if the failure is related ?

@liviazhu
Copy link
Contributor Author

liviazhu commented Jul 17, 2025

@liviazhu - can you check if the failure is related ?

@anishshri-db I ran it locally and it passed. Retriggered the run.

haoyangeng-db pushed a commit to haoyangeng-db/apache-spark that referenced this pull request Jul 22, 2025
…n leading to incorrect file mapping

### What changes were proposed in this pull request?

We found a bug leading to checkpoint corruption with RocksDB VersionID Mismatch error due to local file mappings not being cleared correctly when native RocksDB does a compaction resulting in the original SST file not being deleted. This resulted in the DFS file UUID being reused for 2 SST files that were not the same, leading the version ID mismatch.

This change purges from the local file mappings any mapping that was created by a version equal or greater than the one loaded.

### Why are the changes needed?

The described bug fails streaming queries.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

New unit test

### Was this patch authored or co-authored using generative AI tooling?

No

Closes apache#51520 from liviazhu/liviazhu-db/versionid-mismatch.

Authored-by: Livia Zhu <[email protected]>
Signed-off-by: Anish Shrigondekar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants