You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Mirza Aliev (Jira)" <ji...@apache.org> on 2023/05/12 09:05:00 UTC
[jira] [Updated] (IGNITE-19467) Remove redundant zones' iteration on DistributionManager.start and optimize usage of cfg.change in the DistributionManager
[ https://issues.apache.org/jira/browse/IGNITE-19467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mirza Aliev updated IGNITE-19467:
---------------------------------
Description:
*Motivation:*
It DistributionManager.start we have call of initDataNodesFromVaultManager, which contains the following code
{noformat}
zonesConfiguration.distributionZones().value().forEach(zone -> {
int zoneId = zone.zoneId();
saveDataNodesAndUpdateTriggerKeysInMetaStorage(
zoneId,
appliedRevision,
logicalTopology
);
});
{noformat}
This logic is redundant, because we have the same logic on a zone creation ({{DistributionZoneManager.ZonesConfigurationListener#onCreate}}), and when node is restarted, all configuration changes are applied again, meaning that {{DistributionZoneManager.ZonesConfigurationListener#onCreate}} will be called. Also we can review the possibility to remove the same code for a default zone, but instead of the named list scenario with the user's zones, {{onCreate}} for the default zone is not triggered after restart.
Also there are several places in the code, which we use such constructions:
{noformat}
change = zonesConfiguration.change(zonesChange -> zonesChange.changeDistributionZones(zonesListChange -> {
{noformat}
This code could be optimised and redundant {{zonesChange.changeDistributionZones(zonesListChange -> }} closure can be eliminated
was:
*Motivation:*
It DistributionManager.start we have call of initDataNodesFromVaultManager, which contains the following code
{noformat}
zonesConfiguration.distributionZones().value().forEach(zone -> {
int zoneId = zone.zoneId();
saveDataNodesAndUpdateTriggerKeysInMetaStorage(
zoneId,
appliedRevision,
logicalTopology
);
});
{noformat}
This logic is redundant, because we have the same logic on a zone creation ({{DistributionZoneManager.ZonesConfigurationListener#onCreate}}), and when node is restarted, all configuration changes are applied again, meaning that {{DistributionZoneManager.ZonesConfigurationListener#onCreate}} will be called.
Also there are several places in the code, which we use such constructions:
{noformat}
change = zonesConfiguration.change(zonesChange -> zonesChange.changeDistributionZones(zonesListChange -> {
{noformat}
This code could be optimised and redundant {{zonesChange.changeDistributionZones(zonesListChange -> }} closure can be eliminated
> Remove redundant zones' iteration on DistributionManager.start and optimize usage of cfg.change in the DistributionManager
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: IGNITE-19467
> URL: https://issues.apache.org/jira/browse/IGNITE-19467
> Project: Ignite
> Issue Type: Bug
> Reporter: Mirza Aliev
> Priority: Major
> Labels: ignite-3
>
> *Motivation:*
> It DistributionManager.start we have call of initDataNodesFromVaultManager, which contains the following code
> {noformat}
> zonesConfiguration.distributionZones().value().forEach(zone -> {
> int zoneId = zone.zoneId();
> saveDataNodesAndUpdateTriggerKeysInMetaStorage(
> zoneId,
> appliedRevision,
> logicalTopology
> );
> });
> {noformat}
> This logic is redundant, because we have the same logic on a zone creation ({{DistributionZoneManager.ZonesConfigurationListener#onCreate}}), and when node is restarted, all configuration changes are applied again, meaning that {{DistributionZoneManager.ZonesConfigurationListener#onCreate}} will be called. Also we can review the possibility to remove the same code for a default zone, but instead of the named list scenario with the user's zones, {{onCreate}} for the default zone is not triggered after restart.
> Also there are several places in the code, which we use such constructions:
> {noformat}
> change = zonesConfiguration.change(zonesChange -> zonesChange.changeDistributionZones(zonesListChange -> {
> {noformat}
> This code could be optimised and redundant {{zonesChange.changeDistributionZones(zonesListChange -> }} closure can be eliminated
--
This message was sent by Atlassian Jira
(v8.20.10#820010)