forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Master Fork] Add deep copy to RocksDBFileManager #1
Draft
riyaverm-db
wants to merge
5
commits into
master
Choose a base branch
from
add-deep-copy-to-RocksDBFileManager
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
riyaverm-db
changed the title
Add deep copy to rocks db file manager
Add deep copy to RocksDBFileManager
Jun 4, 2024
github-actions
bot
added
INFRA
BUILD
DOCS
EXAMPLES
CORE
PYTHON
PANDAS API ON SPARK
KUBERNETES
WINDOWS
CONNECT
labels
Jun 7, 2024
riyaverm-db
force-pushed
the
add-deep-copy-to-RocksDBFileManager
branch
2 times, most recently
from
June 7, 2024 00:37
ea663fd
to
892a607
Compare
github-actions
bot
removed
INFRA
BUILD
DOCS
EXAMPLES
CORE
PYTHON
PANDAS API ON SPARK
labels
Jun 7, 2024
riyaverm-db
changed the title
Add deep copy to RocksDBFileManager
[Master Fork] Add deep copy to RocksDBFileManager
Jun 11, 2024
riyaverm-db
pushed a commit
that referenced
this pull request
Aug 9, 2024
…rtition data results should return user-facing error ### What changes were proposed in this pull request? Create an example parquet table with partitions and insert data in Spark: ``` create table t(col1 string, col2 string, col3 string) using parquet location 'some/path/parquet-test' partitioned by (col1, col2); insert into t (col1, col2, col3) values ('a', 'b', 'c'); ``` Go into the `parquet-test` path in the filesystem and try to copy parquet data file from path `col1=a/col2=b` directory into `col1=a`. After that, try to create new table based on parquet data in Spark: ``` create table broken_table using parquet location 'some/path/parquet-test'; ``` This query errors with internal error. Stack trace excerpts: ``` org.apache.spark.SparkException: [INTERNAL_ERROR] Eagerly executed command failed. You hit a bug in Spark or the Spark plugins you use. Please, report this bug to the corresponding communities or vendors, and provide the full stack trace. SQLSTATE: XX000 ... Caused by: java.lang.AssertionError: assertion failed: Conflicting partition column names detected: Partition column name list #0: col1 Partition column name list #1: col1, col2For partitioned table directories, data files should only live in leaf directories. And directories at the same level should have the same partition column name. Please check the following directories for unexpected files or inconsistent partition column names: file:some/path/parquet-test/col1=a file:some/path/parquet-test/col1=a/col2=b at scala.Predef$.assert(Predef.scala:279) at org.apache.spark.sql.execution.datasources.PartitioningUtils$.resolvePartitions(PartitioningUtils.scala:391) ... ``` Fix this by changing internal error to user-facing error. ### Why are the changes needed? Replace internal error with user-facing one for valid sequence of Spark SQL operations. ### Does this PR introduce _any_ user-facing change? Yes, it presents the user with regular error instead of internal error. ### How was this patch tested? Added checks to `ParquetPartitionDiscoverySuite` which simulate the described scenario by manually breaking parquet table in the filesystem. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47668 from nikolamand-db/SPARK-49163. Authored-by: Nikola Mandic <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
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?
The changes include adding a
deepCopy()
method to RocksDBFileManager, and adding respective test case to check if private concurrent hash maps defined in the class were deep copied successfully.Why are the changes needed?
The changes are part of a larger task to fix lock contention between query processing tasks and state maintenance thread. Instead of acquiring RocksDB lock in maintenance thread, race condition between query tasks and maintenance threads can be avoided by ensuring RocksDBFileManager has a linear history without divergence. This is possible by making a deep copy of RocksDB file manager every time a previous version is loaded.
Does this PR introduce any user-facing change?
No
How was this patch tested?
A unit test was added
Was this patch authored or co-authored using generative AI tooling?
No