You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "korlov42 (via GitHub)" <gi...@apache.org> on 2024/10/16 06:27:10 UTC
Re: [PR] IGNITE-22975 Improve detection of minimum catalog version required by active transactions [ignite-3]
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-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org