korlov42 commented on code in PR #4554:
URL: https://github.com/apache/ignite-3/pull/4554#discussion_r1802434065


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexNodeFinishedRwTransactionsChecker.java:
##########
@@ -148,17 +151,28 @@ public <T> T inUpdateRwTxCountLock(Supplier<T> supplier) {
     }
 
     @Override
-    public HybridTimestamp minimumBeginTime() {
+    public long minimumRequiredTime() {
         readWriteLock.writeLock().lock();
 
+        int minRequiredVer;
+
         try {
-            // TODO https://issues.apache.org/jira/browse/IGNITE-22975 Improve 
minimum begin time determination
-            return txCatalogVersionByBeginTxTs.keySet().stream()
-                    .min(HybridTimestamp::compareTo)
-                    .orElse(clock.now());
+            Entry<Integer, Long> entry = txCountByCatalogVersion.lastEntry();

Review Comment:
   `txCountByCatalogVersion` is initialized as `new ConcurrentSkipListMap<>()` 
(mind the lack of external comparator), what means all entries will be sorted 
naturally in ascending order. Here you get _last_ entry, given the ascending 
order this results in the biggest version used so far. But this method must 
return minimal required time.
   
   The fact that all tests have passed freaks me out tbh 



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to