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_r271131213
##########
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:
I don’t understand this check. This is still prone to error rt. Imagine two
new dict ids added
Also just thinking out loud. the previous behavior was probably better than
returning empty bitmap? What happens in Not In case.
----------------------------------------------------------------
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]