DB_ENV->rep_process_message |
#include <db.h>int DB_ENV->rep_process_message(DB_ENV *env, DBT *control, DBT *rec, int envid, DB_LSN *ret_lsnp)
The DB_ENV->rep_process_message method processes an incoming replication message sent by a member of the replication group to the local database environment.
The DB_ENV->rep_process_message method is not called by most replication applications. It should only be called by applications implementing their own network transport layer, explicitly holding replication group elections and handling replication messages outside of the replication manager framework.
For implementation reasons, all incoming replication messages must be processed using the same DB_ENV handle. It is not required that a single thread of control process all messages, only that all threads of control processing messages use the same handle.
The DB_ENV->rep_process_message method has additional return values:
The DB_ENV->rep_process_message method will return DB_REP_DUPMASTER if the replication group has more than one master. The application should reconfigure itself as a client by calling the DB_ENV->rep_start method, and then call for an election by calling DB_ENV->rep_elect.
The DB_ENV->rep_process_message method will return DB_REP_HOLDELECTION if an election is needed. The application should call for an election by calling DB_ENV->rep_elect.
The DB_ENV->rep_process_message method will return DB_REP_IGNORE if this message cannot be processed. This is an indication that this message is irrelevant to the current replication state (for example, an old message from a previous generation arrives and is processed late).
The DB_ENV->rep_process_message method will return DB_REP_ISPERM if processing this message results in the processing of records that are permanent. The maximum LSN of the permanent records stored is returned.
The DB_ENV->rep_process_message method will return DB_REP_JOIN_FAILURE if a new master has been chosen but the client is unable to synchronize with the new master (possibly because the client has been configured with the DB_REP_CONF_NOAUTOINIT flag to turn-off automatic internal initialization).
The DB_ENV->rep_process_message method will return DB_REP_NEWSITE if the system received contact information from a new environment. The rec parameter contains the opaque data specified in the cdata parameter to the DB_ENV->rep_start. The application should take whatever action is needed to establish a communication channel with this new environment.
The DB_ENV->rep_process_message method will return DB_REP_NOTPERM if a message carrying a DB_REP_PERMANENT flag was processed successfully, but was not written to disk. The LSN of this record is returned. The application should take whatever action is deemed necessary to retain its recoverability characteristics.
Unless otherwise specified, the DB_ENV->rep_process_message method returns a non-zero error value on failure and 0 on success.
ParametersCopyright (c) 1996,2008 Oracle. All rights reserved.