Skip to main content

SYS.MirrorDejournal

class SYS.MirrorDejournal extends %Library.SystemBase

Property Inventory

Method Inventory

Properties

property InCatchupDB as %Boolean;
For use in RunFilter(). True when dejournaling is occurring as part of a manual database catchup operation; false when dejournaling is occurring automatically during normal mirror operation.

Methods

method RunFilter(MirrorDBName As %String, GlobalReference As %String, RecordType As %String, Address As %Integer) as %Integer
When mirror dejournal filtering is enabled, this method is called for every record that is about to be dejournaled. To implement a dejournal filter, override this method and add the code that is to be executed when mirror journal files are dejournaled.

Arguments as follows will be passed to this method providing information about the record:

  • MirrorDBName - The mirrored database name of the journal record, in the format of :mirror:MIRRORNAME:MIRRORDBNAME
  • GlobalReference - Global reference in the form of MyGlobal(subscripts), without the leading ^
  • RecordType - Type of journal record; values are "S" for SET, "s" for SET $BIT, "K" for KILL, and "k" for ZKILL
  • Address - Offset of the record in the journal file
  • Return 1 to indicate that the record is to be dejournaled or 0 to request that it be skipped. Skipping the record in this way is only allowed if the FailoverDB flag in the database is cleared, meaning that it is a read-write mirror database. If the FailoverDB flag in the database is set, the return value is ignored, and the record is dejournaled. The RunFilter code executes for each record regardless of the state of the FailoverDB flag; it can perform any operations that do not modify the read-only mirrored databases.

    Other information about the journal record can be extracted as needed by using the value of Address in macros provided by the %syJrnRecord include file. In particular:

  • $$$JRNPID(Address) - returns the process ID, or if it is a multi-threaded callin process, returns the composite job ID.
  • $$$JRNTSTAMP(Address) - returns the timestamp of the journal record in $HOROLOG format.
  • $$$JRNNEWVAL(Address) - returns the value of the SET record for RecordType "S" only; throws an error on other record types.
  • If errors are thrown from this method (ie an error occurs and is not handled within the method itself), mirror dejournaling will abort.

    Dejournaling to mirrored databases occurs both as part of normal mirror operation and as part of manual catchup. The two types of dejournaling can occur concurrently (in different processes) and manual catchup can be working with substantially older journal records. Implementations of RunFilter that need to be sensitive to this difference can inspect the value of InCatchupDB.

    Inherited Members

    Inherited Methods

    FeedbackOpens in a new tab