[
https://issues.apache.org/jira/browse/IGNITE-13284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexey Scherbakov updated IGNITE-13284:
---------------------------------------
Description:
Currently GridDhtPartitionsReservation holds a last server topology version,
but compares it with a current version in _reserve_, causing unnecessary
eviction attempts.
The fix looks easy:
{code}
/**
* Releases all the registered partitions.
*/
@Override public void release() {
for (;;) {
int r = reservations.get();
if (r <= 0)
throw new IllegalStateException("Method 'reserve' must be
called before 'release'.");
if (reservations.compareAndSet(r, r - 1)) {
// If it was the last reservation and topology version changed
-> attempt to evict partitions.
if (r == 1 && !cctx.kernalContext().isStopping() &&
!topVer.equals(cctx.shared().exchange().lastAffinityChangedTopologyVersion(cctx.topology().readyTopologyVersion())))
tryEvict(parts.get());
return;
}
}
}
{code}
was:
Currently GridDhtPartitionsReservation holds a last server topology version,
but compares it with a current version in reserve, causing unnecessary eviction
attempts.
The fix looks easy:
{code}
/**
* Releases all the registered partitions.
*/
@Override public void release() {
for (;;) {
int r = reservations.get();
if (r <= 0)
throw new IllegalStateException("Method 'reserve' must be
called before 'release'.");
if (reservations.compareAndSet(r, r - 1)) {
// If it was the last reservation and topology version changed
-> attempt to evict partitions.
if (r == 1 && !cctx.kernalContext().isStopping() &&
!topVer.equals(cctx.shared().exchange().lastAffinityChangedTopologyVersion(cctx.topology().readyTopologyVersion())))
tryEvict(parts.get());
return;
}
}
}
{code}
> Incorrect version check in GridDhtPartitionsReservation#release
> ---------------------------------------------------------------
>
> Key: IGNITE-13284
> URL: https://issues.apache.org/jira/browse/IGNITE-13284
> Project: Ignite
> Issue Type: Bug
> Reporter: Alexey Scherbakov
> Priority: Major
> Fix For: 2.10
>
>
> Currently GridDhtPartitionsReservation holds a last server topology version,
> but compares it with a current version in _reserve_, causing unnecessary
> eviction attempts.
> The fix looks easy:
> {code}
> /**
> * Releases all the registered partitions.
> */
> @Override public void release() {
> for (;;) {
> int r = reservations.get();
> if (r <= 0)
> throw new IllegalStateException("Method 'reserve' must be
> called before 'release'.");
> if (reservations.compareAndSet(r, r - 1)) {
> // If it was the last reservation and topology version
> changed -> attempt to evict partitions.
> if (r == 1 && !cctx.kernalContext().isStopping() &&
>
> !topVer.equals(cctx.shared().exchange().lastAffinityChangedTopologyVersion(cctx.topology().readyTopologyVersion())))
> tryEvict(parts.get());
> return;
> }
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)