Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-24537

Use Mpack Instance Manager To Switch Component Instance Version on Upgrade

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0
    • Component/s: None

      Description

      Mpacks will not continue use the stack-select tools which have been used by various stacks over the past few years. Previously, each stack shipped a tool which would manipulate the symlinks on the file system in order to both report versions for components and to change versions during an upgrade.

      The following pieces were required for this old framework:

      • A file, such as stack_packages.json which provided a mapping between Ambari's component name and the symlink name on the file system.
      • Each component's Python file would need code which flips the version before restarting during an upgrade:
          def pre_upgrade_restart(self, env, upgrade_type=None):
            if params.version and check_stack_feature(StackFeature.ROLLING_UPGRADE, format_stack_version(params.version)):
              stack_select.select_packages(params.version)
        

      Mpacks v2 will instead use the mpack instance manager to change the pointer on the file system:

      /usr/hwx/mpacks
      └── hdpcore
          ├── 1.0.0-b575
          │   ├── zookeeper_client -> /usr/hwx/modules/zookeeper_clients/3.4.0.0-b42
          │   └── zookeeper_server -> /usr/hwx/modules/zookeeper/3.4.0.0-b42
          └── 1.0.0-b580
              ├── zookeeper_client -> /usr/hwx/modules/zookeeper_clients/3.4.0.0-b43
              └── zookeeper_server -> /usr/hwx/modules/zookeeper_clients/3.4.0.0-b43
      
      /usr/hwx/instances
      └── hdpcore
          └── HDPCORE
              └── default
                  ├── zookeeper
                  │   └── zookeeper_server
                  │       └── ZK-1
                  │           ├── current -> /usr/hwx/mpacks/hdpcore/1.0.0-b575/zookeeper_server
                  └── zookeeper_client
                      ├── current -> /usr/hwx/mpacks/hdpcore/1.0.0-b575/zookeeper_client
      

      For each instance of a component, there is a current pointer which references the mpack (and indirectly) the module version. However, Ambari knows all of this information up front since it's all based on metadata contained with the mpack.json. Therefore, it is possible for Ambari to do all of this version linking inside of its own framework during the upgrade. The individual Python scripts will no longer have to perform these actions.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jonathanhurley Jonathan Hurley
                Reporter:
                jonathanhurley Jonathan Hurley
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m