Salesforce

Hot Swapping of Project (Magic xpi 4.14)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Hot Swapping of Project (Magic xpi 4.14)

Project downtime has always been concern when upgrading an xpi project as it requires shutdown and restart of the project. The HotSwap feature of xpi eliminates this problem and helps in achieving near zero downtime. By deploying the xpi project using the HotSwap deployment method, the traffic on the triggers in the project seamlessly transfers from the current deployed version to the swapped version of the project. With this approach none of the business events are lost while retaining the integrity of data as well as business logic.

To achieve this, HotSwap mechanism runs the updated project with a temporary name in IMM. Once the temporary project is deployed, the metadata in IMM grid is refreshed with the swapped project. The triggers in the original project will be stalled and the triggers in the swapped project will start accepting the requests. Once all the pending jobs in the original project complete, the original project will be stopped. The newly deployed swapped project will replace the original project.

HotSwap States

The Hotswap of a project goes through the following transitional states:

Step

Original Project State

Swapped Project State

Original Project is deployed to IMM

Running

NA

Business Logic in Project modified

Running

Not deployed

Rebuild the project and deployed using the hotswap command

Running

Deployment started

Swap project in successfully deployed

Stalled (No new requests accepted)

Running

Original project completes the running jobs

Stopped

Running

Swap project replaces the original project

Replaced with swapped project

Running

Running HotSwap

  1. Build the project.

This will create a 'hotswap.lnk' shortcut in the project folder. In addition to this, a new folder with the name as 'hotswap' will get created and it will have the start.xml and ifs.ini files.

  1. To initiate the HotSwap process, execute the hotswap.lnk shortcut.

  2. Go to Magic Monitor and verify the status of the swapped project.

HotSwap on Linux

To enable the HotSwap feature for the Magic xpi project on the Linux environment, provide an additional parameter swap to the mgxpisetup command when building the project as below:

mgxpisetup swap

On executing this command, it will prompt for the project directory and project name. Here enter the appropriate values as required. Once the command execution is complete, it will create the mgxpistart_swap.<project_name> script to swap the project in the installation’s sbin directory. Run this script to swap the project.

Limitations and Best Practices

  1. The HotSwap project will generate the start.xml with the recommended values and use those when starting the swapped project. The recommended settings will include setting the scheduler and auto start values to false.

  2. If you are removing any triggers before swapping the project, do make sure that it is completely deprecated and the original project is not using it. Otherwise if any trigger is deleted, the existing jobs will always be seen as pending in the swapped project.

  3. During the swapping period, the activity logs of the project will not be available. The missing activity log, can be manually accessed from the database under a different project key, usually <ProjectName_swap>.

  4. The HotSwap mechanism will start the swapped project as new project and then it will replace the existing project. Due to this the following objects in the project will be reinitialized and their values will not be carried forward from the original project.

· Scheduler

· Global Variables

· PSS

· UDS and converter data

· Data for xpa memory related activities

  1. Any kind of iniput() function which are used by end user cannot be used in the swapped project as they are new xpa instances.

  2. On Demand instances created for the projects from Magic Monitor will not be hot-swapped. HotSwap will only honour the values in start.xml and replace the instances which are listed in the start.xml

  3. It is recommended to have distinct project names for the projects to be HotSwapped.
    If two Magic xpi projects are being HotSwapped simultaneously and their project names share the first 25 characters, the HotSwap operation could fail.

  4. Any flow enable/disable changes done in the Magic Monitor will be overridden after the project is hot-swapped.

See Also

· SwapShutdownTime

· Setting Up the Windows Project on UNIX

(Since version: 4.13.5)

Reference
Attachment 
Attachment