kishoreg commented on a change in pull request #4051: Fix the race condition
for real-time inverted index reader
URL: https://github.com/apache/incubator-pinot/pull/4051#discussion_r271428911
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/realtime/impl/invertedindex/RealtimeInvertedIndexReader.java
##########
@@ -60,6 +60,13 @@ public MutableRoaringBitmap getDocIds(int dictId) {
ThreadSafeMutableRoaringBitmap bitmap;
try {
_readLock.lock();
+ // NOTE: the given dict Id might not be added to the inverted index yet.
We first add the value to the dictionary.
+ // Before the value is added to the inverted index, the query might have
a predicate which matches the newly added
+ // value. In that case, the given dictionary Id does not exist in the
inverted index, and we return an empty
+ // bitmap.
+ if (_bitmaps.size() == dictId) {
Review comment:
cool.
Another thought I had was, should we even check for the _bitmaps.size() <=
dictId. What if we return empty one if the bitmap is null.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]