ibessonov commented on code in PR #5684:
URL: https://github.com/apache/ignite-3/pull/5684#discussion_r2059589486


##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/KeyValueStorageUtils.java:
##########
@@ -43,14 +43,20 @@ public static int indexToCompact(long[] keyRevisions, long 
compactionRevisionInc
         int i = binarySearch(keyRevisions, compactionRevisionInclusive);
 
         if (i < 0) {
-            if (i == -1) {
+            i = ~i;
+
+            if (i == 0) {
                 return NOT_FOUND;
             }
 
-            i = -(i + 2);
+            i--;
         }
 
-        if (i == keyRevisions.length - 1 && 
!isTombstone.test(keyRevisions[i])) {
+        if (!isTombstone.test(keyRevisions[i])) {

Review Comment:
   > we would return the index of the first element that is greater 
compactionRevisionInclusive.
   
   I don't see how you got this conclusion, can you please elaborate?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to