Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-19467

Remove redundant zones' iteration on DistributionManager.start and optimize usage of cfg.change in the DistributionManager

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None

    Description

      Motivation:
      It DistributionManager.start we have call of initDataNodesFromVaultManager, which contains the following code

                      zonesConfiguration.distributionZones().value().forEach(zone -> {
                          int zoneId = zone.zoneId();
      
                          saveDataNodesAndUpdateTriggerKeysInMetaStorage(
                                  zoneId,
                                  appliedRevision,
                                  logicalTopology
                          );
                      });
      

      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:

      change = zonesConfiguration.change(zonesChange -> zonesChange.changeDistributionZones(zonesListChange -> {
      

      This code could be optimised and redundant {{zonesChange.changeDistributionZones(zonesListChange -> }} closure can be eliminated

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              maliev Mirza Aliev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: