-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add locking logic to get consistent table view for upsert tables #12976
Add locking logic to get consistent table view for upsert tables #12976
Conversation
5e6acce
to
de05748
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12976 +/- ##
============================================
+ Coverage 61.75% 62.24% +0.49%
+ Complexity 207 198 -9
============================================
Files 2436 2529 +93
Lines 133233 138375 +5142
Branches 20636 21416 +780
============================================
+ Hits 82274 86132 +3858
- Misses 44911 45803 +892
- Partials 6048 6440 +392
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.../src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
Show resolved
Hide resolved
pinot-spi/src/main/java/org/apache/pinot/spi/config/table/UpsertConfig.java
Outdated
Show resolved
Hide resolved
de05748
to
1c5c503
Compare
5662b28
to
2746ddd
Compare
.../src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
Show resolved
Hide resolved
.../src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
Outdated
Show resolved
Hide resolved
2746ddd
to
9caf3c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
.../src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java
Outdated
Show resolved
Hide resolved
9caf3c7
to
97e79e7
Compare
…che#12976) * added upsert config ConsistencyMode as the feature flag
This PR tries to support consistent table view for querying upsert tables. The consistency is at table partition level, which can contain many segments. Today, updates that involve two segments' bitmaps are not atomic, thus causing queries to see inconsistent table view, e.g. to return less than expected PKs.
The high level idea is either to synchronize the query threads and upsert threads (including consuming thread or HelixTaskExecutor threads) with locks for queries to get a consistent set of segments' validDocIds bitmaps; or let upsert threads keep a consistent set (i.e. upsert view) of bitmaps and refresh the view regularly. Both modes are added in this PR, as they can be wired up using one R/W lock.
Added a new upsert config consistencyMode, which can be NONE, SYNC or SNAPSHOT