Skip to content

fix: partition evaluator thread safety#115

Merged
Fokko merged 1 commit intoapache:mainfrom
skellys:fix/partition_evaluator_thread_safety
Nov 2, 2023
Merged

fix: partition evaluator thread safety#115
Fokko merged 1 commit intoapache:mainfrom
skellys:fix/partition_evaluator_thread_safety

Conversation

@skellys
Copy link
Copy Markdown
Contributor

@skellys skellys commented Oct 30, 2023

I found a thread safety bug where some unwanted partitions would make it past the partition filter. I found and tested this fix on a simple Iceberg table with one schema spec, 5 manifest files (so 5 threads used in the thread pool), and thousands of partitions.

I've also solved this with a thread local storage approach to create fewer _ExpressionEvaluator instances under the hood, but I didn't think that'd be worth the additional complexity, especially with per-thread cleanup.

TODO

  • discuss approach on how to test this in the test suite itself.

@rustyconover
Copy link
Copy Markdown
Contributor

Looks great to me Sean!

@Fokko Fokko added this to the PyIceberg 0.6.0 release milestone Nov 2, 2023
Copy link
Copy Markdown
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

This makes sense to me @skellys That's a great catch, and thanks for working on this 👍

@Fokko Fokko merged commit b40ee83 into apache:main Nov 2, 2023
@skellys skellys deleted the fix/partition_evaluator_thread_safety branch November 2, 2023 13:03
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.

3 participants