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

Mirza Aliev updated IGNITE-20199:
---------------------------------
    Description: 
After IGNITE-19506 was merged, it added the regression. 

Previously we haven't returned future, that updates rebalance pending keys, in 
{{{}DistributionZoneRebalanceEngine#onUpdateReplicas{}}}. It was done because 
otherwise we would block configuration notification thread until all partitions 
would updates theirs rebalance assignments keys in metastorage. 

 

Unfortunately, IGNITE-19506 has brought this blockage

 
{code:java}
private CompletableFuture<?> 
onUpdateReplicas(ConfigurationNotificationEvent<Integer> replicasCtx) {
...
...

        return distributionZoneManager.dataNodes(replicasCtx.storageRevision(), 
zoneCfg.zoneId())
                .thenCompose(dataNodes -> {
...

                    for (TableView tableCfg : tableViews) {
                       ...
                        CompletableFuture<?>[] partitionFutures = 
RebalanceUtil.triggerAllTablePartitionsRebalance(...);

                        tableFutures.add(allOf(partitionFutures));
                    }

                    return 
allOf(tableFutures.toArray(CompletableFuture[]::new));
                });
...
} {code}

  was:
After IGNITE-19506 was merged, it added the regression. 

Previously we haven't returned future, that updates rebalance pending keys, in 
{{{}DistributionZoneRebalanceEngine#onUpdateReplicas{}}}. It was done because 
otherwise we would block configuration notification thread until all partitions 
would updates theirs rebalance assignments keys in metastorage. 

 

Unfortunately, IGNITE-19506 has brought this blockage

 
{code:java}
private CompletableFuture<?> 
onUpdateReplicas(ConfigurationNotificationEvent<Integer> replicasCtx) {
...
...

        return distributionZoneManager.dataNodes(replicasCtx.storageRevision(), 
zoneCfg.zoneId())
                .thenCompose(dataNodes -> {
...

                    for (TableView tableCfg : tableViews) {
                       ...
                        CompletableFuture<?>[] partitionFutures = 
RebalanceUtil.triggerAllTablePartitionsRebalance(...);

                        tableFutures.add(allOf(partitionFutures));
                    }

                    return 
allOf(tableFutures.toArray(CompletableFuture[]::new));
                });
    } finally {
        busyLock.leaveBusy();
    }
} {code}


> Do not chain updating rebalance assignments future in 
> DistributionZoneRebalanceEngine#onUpdateReplicas 
> -------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-20199
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20199
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Mirza Aliev
>            Priority: Major
>              Labels: ignite-3
>
> After IGNITE-19506 was merged, it added the regression. 
> Previously we haven't returned future, that updates rebalance pending keys, 
> in {{{}DistributionZoneRebalanceEngine#onUpdateReplicas{}}}. It was done 
> because otherwise we would block configuration notification thread until all 
> partitions would updates theirs rebalance assignments keys in metastorage. 
>  
> Unfortunately, IGNITE-19506 has brought this blockage
>  
> {code:java}
> private CompletableFuture<?> 
> onUpdateReplicas(ConfigurationNotificationEvent<Integer> replicasCtx) {
> ...
> ...
>         return 
> distributionZoneManager.dataNodes(replicasCtx.storageRevision(), 
> zoneCfg.zoneId())
>                 .thenCompose(dataNodes -> {
> ...
>                     for (TableView tableCfg : tableViews) {
>                        ...
>                         CompletableFuture<?>[] partitionFutures = 
> RebalanceUtil.triggerAllTablePartitionsRebalance(...);
>                         tableFutures.add(allOf(partitionFutures));
>                     }
>                     return 
> allOf(tableFutures.toArray(CompletableFuture[]::new));
>                 });
> ...
> } {code}



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

Reply via email to