The mi_hdr_status() function

The mi_hdr_status() function returns the high-availability cluster replication status of the current server.

Syntax

    mi_integer mi_hdr_status(void)
Valid in client LIBMI application? Valid in user-defined routine?
No Yes

Usage

The mi_hdr_status() function returns information about:
  • the server type, such as primary server, SD secondary server, RS secondary server, or HDR secondary server,
  • HDR status,
  • the ability to update data on a secondary server (also known as proxy writes).

When C UDRs are executing as a part of SELECT, execute function, or execute procedure statements, they can call mi_hdr_status() to determine the mode of the current server.

The return value of mi_hdr_status() is of type mi_integer, which is interpreted as a bitmap. The meaning of each bit is defined in the milib.h file.

For more information about High-Availability Data Replication and high-availability cluster environments, see the Informix® Administrator's Guide.

Return values

MI_HDR_ON
The HDR environment is configured and is working.
MI_HDR_PRIMARY
The current server is a primary server.
MI_HDR_SECONDARY
This value indicates whether the server is any type of secondary server. Current® secondary server types include HDR, SD secondary, and RS secondary servers. This return code has been preserved for compatibility with earlier versions. The return code MI_SECONDARY has the same return code as MI_HDR_SECONDARY. Use MI_SECONDARY instead of MI_HDR_SECONDARY for new application development. Use MI_HDR_SEC_NODE to determine whether the server is an HDR secondary server.
MI_SECONDARY
The current server is a secondary server.
MI_HDR_SEC_NODE
The current server is an HDR secondary server.
MI_RSS_SECONDARY
The current server is an RS (Remote Standalone) secondary server.
MI_SDS_SECONDARY
The current server is an SD (Shared Disk) secondary server.
MI_UPDATABLE_SECONDARY
The current server is a secondary server that is configured to accept updates.