bruno-roustant commented on code in PR #2021:
URL: https://github.com/apache/solr/pull/2021#discussion_r1366612855


##########
solr/core/src/java/org/apache/solr/update/VersionInfo.java:
##########
@@ -284,11 +297,20 @@ public Long getMaxVersionFromIndex(IndexSearcher 
searcher) throws IOException {
   }
 
   public void seedBucketsWithHighestVersion(long highestVersion) {
-    for (int i = 0; i < buckets.length; i++) {
-      // should not happen, but in case other threads are calling 
updateHighest on the version
-      // bucket
-      synchronized (buckets[i]) {
-        if (buckets[i].highest < highestVersion) buckets[i].highest = 
highestVersion;
+    if (buckets == null) {
+      synchronized (bucketsSync) {
+        if (buckets == null) {
+          // Update the highest version seed to use if/when buckets are 
created.
+          highestVersionSeed = Math.max(highestVersion, highestVersionSeed);
+          return;
+        }
+      }
+    }
+    for (VersionBucket bucket : buckets) {

Review Comment:
   An "else" on which "if" block?



-- 
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

Reply via email to