Question
· May 6, 2021

Install ZMIRROR Routine

Hi,

Question about ZMIRROR routine.

I analyze a problem with the label NotifyBecomePrimary. It seems not performed after a switch.

After installing ZMIRROR routine in %SYS, is a restart required?
If It's required, It could be explain my problem.

Thank you.

Product version: HealthShare 2018.1
Discussion (4)2
Log in or sign up to continue

Hi @Scott Roth ,

The routine ZMIRROR.MAC must be installed in the namespace "%SYS" on each failover member.  It needs the IRISLIB database mounted in RW for installation.

I use ZMIRROR.MAC to execute code when a node becomes primary, in my example I just implement "NotifyBecomePrimary" label :

ZMIRROR
    Quit
    
NotifyBecomePrimary()
    New
    ; https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GHA_mirror#GHA_mirror_set_tunable_params_zmirror_routine
    Try {
        
        Set ns = "MYAPPNAMESPACE"
        If ##class(Config.Namespaces).Exists(ns) {
            JOB ##class(pkg.Class).ClassMethod():(ns):2
        }
        
    } Catch(ex) { } ; just a security
    
    Quit:$Quit 1
    Quit

There are many events available, we can see the list on this documentation page .
What event mirror are you interested in?