npawar commented on a change in pull request #4602: First pass of GROUP BY with ORDER BY support URL: https://github.com/apache/incubator-pinot/pull/4602#discussion_r330840780
########## File path: pinot-core/src/main/java/org/apache/pinot/core/data/table/ConcurrentIndexedTable.java ########## @@ -61,25 +92,41 @@ public boolean upsert(@Nonnull Record newRecord) { Key key = newRecord.getKey(); Preconditions.checkNotNull(key, "Cannot upsert record with null keys"); - Record existingRecord = _lookupMap.putIfAbsent(key, newRecord); - if (existingRecord != null) { - _lookupMap.compute(key, (k, v) -> { + if (_noMoreNewRecords.get()) { // allow only existing record updates + _lookupMap.computeIfPresent(key, (k, v) -> { Review comment: Why is that necessary? computeIfPresent will lock the necessary buckets, ensuring same key is not operated on concurrently ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org