bruno-roustant commented on code in PR #2021: URL: https://github.com/apache/solr/pull/2021#discussion_r1364249747
########## solr/core/src/java/org/apache/solr/update/VersionInfo.java: ########## @@ -205,9 +215,59 @@ public VersionBucket bucket(int hash) { // Make sure high bits are moved down, since only the low bits will matter. // int h = hash + (hash >>> 8) + (hash >>> 16) + (hash >>> 24); // Assume good hash codes for now. + int slot = hash & (numBuckets - 1); + if (bucketMap != null) { + return getBucketFromMap(slot); + } + return getBucketFromArray(slot); + } - int slot = hash & (buckets.length - 1); - return buckets[slot]; + private VersionBucket getBucketFromMap(int slot) { + VersionBucket bucket = bucketMap.get(slot); + if (bucket == null) { + synchronized (bucketsSync) { + int index = bucketMap.indexOf(slot); Review Comment: Yes, good catch. -- 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. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org