[ 
https://issues.apache.org/jira/browse/IGNITE-21106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-21106:
-------------------------------------
    Description: 
h3. Motivation

Occurred that obsolete leases (expired leases for removed replication groups) 
aren't dropped themselves. Despite the fact that it's generally a leak and thus 
incorrect, some tests like ItSqlLogicTest may suffer from this.
h3. Definition of Done

Obsolete leases are removed from the meta storage and thus no longer processed.
h3. Implementation Notes

I believe that

```

            // Remove all expired leases that are no longer present in 
assignments.
            renewedLeases.entrySet().removeIf(e -> 
e.getValue().getExpirationTime().before(now)
                    && 
!currentAssignmentsReplicationGroupIds.contains(e.getKey()));

```

in 
`org.apache.ignite.internal.placementdriver.LeaseUpdater.Updater#updateLeaseBatchInternal`

should do the trick.

> Remove obsolete leases
> ----------------------
>
>                 Key: IGNITE-21106
>                 URL: https://issues.apache.org/jira/browse/IGNITE-21106
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Alexander Lapin
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> h3. Motivation
> Occurred that obsolete leases (expired leases for removed replication groups) 
> aren't dropped themselves. Despite the fact that it's generally a leak and 
> thus incorrect, some tests like ItSqlLogicTest may suffer from this.
> h3. Definition of Done
> Obsolete leases are removed from the meta storage and thus no longer 
> processed.
> h3. Implementation Notes
> I believe that
> ```
>             // Remove all expired leases that are no longer present in 
> assignments.
>             renewedLeases.entrySet().removeIf(e -> 
> e.getValue().getExpirationTime().before(now)
>                     && 
> !currentAssignmentsReplicationGroupIds.contains(e.getKey()));
> ```
> in 
> `org.apache.ignite.internal.placementdriver.LeaseUpdater.Updater#updateLeaseBatchInternal`
> should do the trick.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to