Skip to main content

Config.MirrorMember

Class Config.MirrorMember Extends (%Persistent, Config.CommonSingleMethods, Config.CommonProperties, %SYSTEM.Help) [ Final, Inheritance = right, System = 4 ]

This class allows you to modify and view the [MirrorMember] section of the CPF file through programatic APIs. While properties are usually modified through the System Management portal, there may be some occasion where modifying them through the API's is best for your system. In all the Config methods, if you do not specify the CPFFile parameter, the currently active CPF file is used. If you wish to modify a CPF file which is not the currently active one, then specify the CPFFile you wish to modify in the method call.
The Flags parameter does not normally need to be specified; the defaults are usually sufficient for most cases.
You can use either the provided API's (Get/Modify) to modify the properties by passing in the correct parameters, or use Object syntax to open and directly manipulate the config objects.

EXAMPLE:

; Use class methods to modify properties %SYS>s Status=##Class(Config.MirrorMember).Get(.Properties) %SYS>i 'Status w !,"Error="$SYSTEM.Status.GetErrorText(Status) %SYS>zw Properties("SystemName") Properties("SystemName")="Mirror5" %STS>s Properties("SystemName")="Mirror6" %SYS>s Status=##Class(Config.MirrorMember).Modify(.Properties) %SYS>i 'Status w !,"Error="$SYSTEM.Status.GetErrorText(Status) ; Now use Objects to modify properties %SYS>s Obj=##Class(Config.MirrorMember).Open() %SYS>w Obj.SystemName Mirror6 %SYS>s Obj.SystemName="Mirror7" %SYS>s Status=Obj.%Save() %SYS>i 'Status w !,"Error="_$SYSTEM.Status.GetErrorText(Status)

Parameters

PROPERTIESMAYBEINCPF

Parameter PROPERTIESMAYBEINCPF = "DebugFlags,DDNSKey";

List of properties which may or may not be in the CPF file.
They have a corresponding %Boolean property to determine if they are in the file or not. For example, the property "DebugFlags" has a %Boolean "DebugFlagsPresent" property associated with it.

EMSSERVICE

Parameter EMSSERVICE [ Internal ] = "Mirror";

Properties

AgentAddress

Property AgentAddress As %NetworkAddress;

AsyncMemberGUID

Property AsyncMemberGUID As %String;

AsyncMemberType

Property AsyncMemberType As %Integer(MAXVAL = 2, MINVAL = 0) [ InitialExpression = 0 ];

AsyncMemberType indicates the async member is a disaster recovery (DR), read-only reporting or read-write reporting async member.
0 - Disaster Recovery (DR). This is a disaster recovery async member, all its mirrored databases are read-only mirrored databases.
1 - Read-Only Reporting. This is a reporting async member, all its mirrored databases could be read-only or read-write databases, the default is read-only when the database is created.
2 - Read-Write Reporting. This is a reporting async member, all its mirrored databases could be read-only or read-write databases, the default is read-write when the database is created.

AsyncUseSystemPurgeInterval

Property AsyncUseSystemPurgeInterval As %Boolean [ InitialExpression = 0 ];

AsyncUseSystemPurgeInterval when set indicates that the async member should purge mirror journal files according to the same criteria it uses for purging local journal files (eg. after a certain number of days or a certain number of backups). When this parameter is missing, or clear, the default state, mirror journal files are purged as soon as they are no longer needed because they have been replayed to the local databases.

DebugFlags

Property DebugFlags As %String [ Internal ];

DebugFlagsPresent

Property DebugFlagsPresent As %Boolean [ InitialExpression = 0, Internal ];

DDNSKey

Property DDNSKey As %SysPath [ Internal ];

DDNSKeyPresent

Property DDNSKeyPresent As %Boolean [ InitialExpression = 0, Internal ];

JoinMirror

Property JoinMirror As %Boolean [ InitialExpression = 0 ];

Flag indicating whether this system processes its mirror configuration at startup. When set to NO, the mirror configuration is ignored and the system is not considered a mirror member. This can be used if there is a problem in the configuration which prevents the system from starting or as part of removing a system from the mirror as if a system is the primary it needs to be restarted but we also need to block the system from joining the mirror when it restarts and becoming the primary again.

SystemName

Property SystemName As %String(MAXLEN = 32, MINLEN = 0);

This is the name by which the system is known in the mirror (the mirror member name). The name is converted to uppercase before storing. The following characters are not permitted in mirror system names:
: # , ; = ^ ~ "
The following character sequences are not allowed in mirror system names:
// /*
Mirror system names must be unique across all mirror members as some mirror members (eg. async members) may participate in multiple mirrors and they will have the same system name in all of the mirrors.

ValidatedMember

Property ValidatedMember As %Boolean [ InitialExpression = 0, Internal ];

ValidatedMember is set when a node joins an existing mirror and has verified that it is listed in the [MirrorSetMembers] list of all the other (Validated) mirror members. Until ValidatedMember is set a node cannot become the primary. This is important because the existing mirror members don't know to look for this node (yet) when deciding whether they should be the primary or not because generally a node is configured to be a mirror member before it is added to the existing nodes.

VirtualAddressInterface

Property VirtualAddressInterface As %String(MAXLEN = 255);

When the mirror is configured to keep a virtual ip address assigned to the primary, this is the local interface which hosts the IP address.

Consult the documentation for the format specific to the operating system.

Methods

isAsyncMember

ClassMethod isAsyncMember(ByRef CPFFile As %String = "") As %Boolean

Returns TRUE/FALSE for whether this node is configured as an async member in the configuration.

SystemNameSet

Method SystemNameSet(Val) As %Status [ Internal ]

Load

ClassMethod Load(Obj As %ObjectHandle = "", Flags As %Integer = 1) As %Status [ Internal ]

Load the MirrorMember info.
Currently this can only be called once, during STU. STU kills off the ^SYS("MIRRORSET") tree and if there's data there when we're called, we exit.
Load the parameters into memory and activate.
Parameters:
Obj = Handle to the object which caused the load. If "", then load everything, only called from STU.
Flags = Type of modification.
0 - Modify
1 - Create/Insert
2 - Delete

CheckSecurity

ClassMethod CheckSecurity(ByRef enabled As %Boolean) As %Status

Check the required security settings
Returns $$$ERROR(reason) if we fail to look up the security setting. Otherwise returns $$$OK and sets the passed 'enabled' variable to True/False.

%OnValidateObject

Method %OnValidateObject() As %Status [ Internal ]

This is called from %Save().
Any error returned from this will cause the object to not be saved.

EMSAllowEdit

Method EMSAllowEdit(insert As %Boolean) As %Boolean [ Internal ]

Called from %OnBeforeSave. Provides a way for a specific class to override the EMS.Restricted() check when the Instance is managed. Used when a few properties in a class (like Config.SQL.JDBCGatewayPort) are not managed by EMS.

GetAsyncMemberGUID

Method GetAsyncMemberGUID() As %String

Returns AsyncMemberGUID of the async member

AllowClearFailoverDBFlag

ClassMethod AllowClearFailoverDBFlag(ByRef CPFFile As %String = "") As %Boolean

Check if this mirror member allow user to clear the FailoverDB flag in mirrored databases.
Only the non-DR async member allow user to clear the FailverDB flag in mirrored databases.

IsDRMember

ClassMethod IsDRMember(ByRef CPFFile As %String = "") As %Boolean

Check if this mirror member is a Disaster Recovery (DR) async member.

IsReadOnlyReportingMember

ClassMethod IsReadOnlyReportingMember(ByRef CPFFile As %String = "") As %Boolean

Check if this mirror member is a read-only reporting async member.

IsReadWriteReportingMember

ClassMethod IsReadWriteReportingMember(ByRef CPFFile As %String = "") As %Boolean

Check if this mirror member is a read-write reporting async member.

ClearFailoverDBForNonDRAsyncMember

ClassMethod ClearFailoverDBForNonDRAsyncMember() As %Status [ Internal ]

Subroutine of this class and ^MIRROR when the "type" of a mirror being tracked by an async member is changed from read-only to read-write. This scans through all the mounted databases looking for mirrored databases and clears the FailoverDB flag so that they can be mounted read/write locally. This should be done with care as once this flag is cleared these databases can no longer be activated for use in the mirror. This means that they cannot be moved, even within the async member, as a moved mirrored db needs to be activated before it can be used. A new copy would have to be made off of a failover node in order to be activated. The mirrored databases have not been activated will be skipped, they could be cleared when they are activated.

AllowNewMirrorSet

ClassMethod AllowNewMirrorSet(ByRef CPFFile As %String = "") As %Boolean

Return whether the async member is allowed to add a new mirror set to be tracked.

ValidateMemberName

ClassMethod ValidateMemberName(Name As %String) As %Status [ Internal ]

Validate Mirror Member Name.