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

Kirill Tkalenko updated IGNITE-23716:
-------------------------------------
    Description: 
IGNITE-23303 addressed some of condended lock usages, but not all.

1. 
{noformat}
public Executor executorFor(short executorIndex, int stripeIndex) {
    assert executorIndex >= 0 : "Executor index is negative: " + executorIndex;

    if (!busyLock.enterBusy()) {
        return NO_OP_EXECUTOR;
    }

    try {
        return stripedExecutorFor(executorIndex).stripeExecutor(stripeIndex);
    } finally {
        busyLock.leaveBusy();
    }
}{noformat}
??is called on every incoming message, and they might be millions.?? - Done on 
ticket IGNITE-23796.

2. ClockWaiter's busyLock can be removed, because it delegates to tracker which 
already has (already optimized) busy locks.
 
3. IgniteAttachmentLock writes to shared location both for sync and async paths 
- it should be striped in some way.

4. StripedRWLock used in PendingComparableValuesTracker and ReplicaManager 
doesn't check if write lock is already held

5. IgniteSpinBusyLock duplicates VersatileReadWriteLock in many aspects and 
vice versa. I believe ISBL can be replaces with VRWL.

See for example org.apache.ignite.internal.util.IgniteUtils#inBusyLockAsync

NOTE: don't forget to check results with UpsertKvBenchmark

 
 

  was:
IGNITE-23303 addressed some of condended lock usages, but not all.

1. 
{noformat}
public Executor executorFor(short executorIndex, int stripeIndex) {
    assert executorIndex >= 0 : "Executor index is negative: " + executorIndex;

    if (!busyLock.enterBusy()) {
        return NO_OP_EXECUTOR;
    }

    try {
        return stripedExecutorFor(executorIndex).stripeExecutor(stripeIndex);
    } finally {
        busyLock.leaveBusy();
    }
}{noformat}
is called on every incoming message, and they might be millions.

2. ClockWaiter's busyLock can be removed, because it delegates to tracker which 
already has (already optimized) busy locks.
 
3. IgniteAttachmentLock writes to shared location both for sync and async paths 
- it should be striped in some way.

4. StripedRWLock used in PendingComparableValuesTracker and ReplicaManager 
doesn't check if write lock is already held

5. IgniteSpinBusyLock duplicates VersatileReadWriteLock in many aspects and 
vice versa. I believe ISBL can be replaces with VRWL.

See for example org.apache.ignite.internal.util.IgniteUtils#inBusyLockAsync

NOTE: don't forget to check results with UpsertKvBenchmark

 
 


> Improve contented locks usage
> -----------------------------
>
>                 Key: IGNITE-23716
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23716
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Alexey Scherbakov
>            Assignee: Kirill Tkalenko
>            Priority: Major
>              Labels: ignite-3
>
> IGNITE-23303 addressed some of condended lock usages, but not all.
> 1. 
> {noformat}
> public Executor executorFor(short executorIndex, int stripeIndex) {
>     assert executorIndex >= 0 : "Executor index is negative: " + 
> executorIndex;
>     if (!busyLock.enterBusy()) {
>         return NO_OP_EXECUTOR;
>     }
>     try {
>         return stripedExecutorFor(executorIndex).stripeExecutor(stripeIndex);
>     } finally {
>         busyLock.leaveBusy();
>     }
> }{noformat}
> ??is called on every incoming message, and they might be millions.?? - Done 
> on ticket IGNITE-23796.
> 2. ClockWaiter's busyLock can be removed, because it delegates to tracker 
> which already has (already optimized) busy locks.
>  
> 3. IgniteAttachmentLock writes to shared location both for sync and async 
> paths - it should be striped in some way.
> 4. StripedRWLock used in PendingComparableValuesTracker and ReplicaManager 
> doesn't check if write lock is already held
> 5. IgniteSpinBusyLock duplicates VersatileReadWriteLock in many aspects and 
> vice versa. I believe ISBL can be replaces with VRWL.
> See for example org.apache.ignite.internal.util.IgniteUtils#inBusyLockAsync
> NOTE: don't forget to check results with UpsertKvBenchmark
>  
>  



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

Reply via email to