denis-chudov commented on code in PR #3591:
URL: https://github.com/apache/ignite-3/pull/3591#discussion_r1569190398
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/VolatileTxStateMetaStorage.java:
##########
@@ -118,35 +129,56 @@ public Collection<TxStateMeta> states() {
* @param vacuumObservationTimestamp Timestamp of the vacuum attempt.
* @param txnResourceTtl Transactional resource time to live in
milliseconds.
*/
- public void vacuum(long vacuumObservationTimestamp, long txnResourceTtl) {
+ public void vacuum(
+ long vacuumObservationTimestamp,
+ long txnResourceTtl,
+ Function<Map<TablePartitionId, Set<UUID>>,
CompletableFuture<IgniteBiTuple<Set<UUID>, Integer>>> beforeVacuum
+ ) {
LOG.info("Vacuum started [vacuumObservationTimestamp={},
txnResourceTtl={}].", vacuumObservationTimestamp, txnResourceTtl);
AtomicInteger vacuumizedTxnsCount = new AtomicInteger(0);
AtomicInteger markedAsInitiallyDetectedTxnsCount = new
AtomicInteger(0);
AtomicInteger alreadyMarkedTxnsCount = new AtomicInteger(0);
AtomicInteger skippedFotFurtherProcessingUnfinishedTxnsCount = new
AtomicInteger(0);
+ Map<TablePartitionId, Set<UUID>> txIds = new HashMap<>();
+ Map<UUID, Long> timestamps = new HashMap<>();
+
txStateMap.forEach((txId, meta) -> {
txStateMap.computeIfPresent(txId, (txId0, meta0) -> {
if (TxState.isFinalState(meta0.txState())) {
- if (txnResourceTtl == 0) {
Review Comment:
it's not like skipped, I moved it to `shouldBeVacuumized` for the sake of
better readability
--
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]