[ https://issues.apache.org/jira/browse/IGNITE-21759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexander Lapin reassigned IGNITE-21759: ---------------------------------------- Assignee: Denis Chudov > Prepare general txn vacuum logic by introducing TxnResourceVacuumTask > --------------------------------------------------------------------- > > Key: IGNITE-21759 > URL: https://issues.apache.org/jira/browse/IGNITE-21759 > Project: Ignite > Issue Type: Improvement > Reporter: Alexander Lapin > Assignee: Denis Chudov > Priority: Major > Labels: ignite-3 > > h3. Motivation > Within one of Txn cursros cleanup sub tickets cursor cleanup scheduler was > introduced. Now it's turn to generalize it to handle txn resource vacuum > task. Thus it's expected that TxnResourceVacuumTask will be introduced with > following logic inside (this logic will be adjusted later on in other jiras): > # TxnResourceVacuumTask evaluates vacuumObservationTimestamp as > System.currentTimeMillis(). There's no sense in using hybrid clock in order > not to increase the contention level on the clock. > # TxnResourceVacuumTask scans txnStateVolatileMap and for each finished > (COMMITED or ABORTED) transactions it > ## Removes it from txnStateVolatileMap if txnResourcesTTL == 0 (more details > a bit later) or if txnState.initialVacuumObservationTimestamp + > txnResourcesTTL < vacuumObservationTimestamp. > ## Updates txnState.initialVacuumObservationTimestamp by setting it to > vacuumObservationTimestamp if it's not already initialized. > txnResourcesTTL is a new cluster configuration property that defines the > *minimum* lifetime of a transaction state in milliseconds. Real > txnResourcesTTL lifetime will also depend on cleanupTimer intervals which of > course not suitable for test purposes thus we should introduce manual ability > to run TxnResourceVacuumTask immediately. At least we will use it within > tests. > h3. Definition of Done > * New configuration property txnResourceTTL is introduced with default of > 30_000 milliseconds. > * TxnResourceVacuumTask is introduced with aforementioned logic. Given task > should be tread safe. > * Cleanup scheduler is generalized and adjusted to run TxnResourceVacuumTask > on every iteration. > * Cleanup scheduler along with subclasses and helpers is renamed to > <>Vacuum<> > ** Cleanup is part of tx finish flow. > ** Vacuum is for removing obsolete resources. Let's be consistent with > naming. > * Special trigger for TxnResourceVacuumTask introduced within TxManager, at > least for testing purposes. -- This message was sent by Atlassian Jira (v8.20.10#820010)