Identify a Mirror member status
I want to write some code differently to run on Primary, Backup and DR depending upon their status.
If its Primary then do something, if Backup then something else and if DR then do something different from both Primary and Backup.
This can identified whether a system is Primary or Not Primary by calling below method
w $SYSTEM.Mirror.IsPrimary()
1 means Primary and 0 means Not Primary. But a Not Primary member may be a backup or a Async DR or a Async Reporting.
How to identify if a system is a DR or Backup or Reporting?
Product version: HealthShare 2017.2
$ZV: Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2017.2.2 (Build 865_3_20144U) Mon Aug 17 2020 13:28:18 EDT
Are any of the other methods useful to you?
https://cedocs.intersystems.com/ens20172/csp/documatic/%25CSP.Documatic....
I think the function you might be looking for may be:
W $SYSTEM.Mirror.GetMemberType()
The return values are: Indeterminate, Not Member, Failover, Async, Disaster Recovery, Read-Only Reporting or Read-Write Reporting.
You can also get a lot more info than just if it's a primary or not from:
W $SYSTEM.Mirror.GetStatus()
Hope this helps!
Thanks Roger.. this is what I was looking for.
Thanks