DbEnv::rep_process_message |
#include <db_cxx.h>int DbEnv::rep_process_message(Dbt *control, Dbt *rec, int *envid, DbLsn *ret_lsnp)
The DbEnv::rep_process_message method processes an incoming replication message sent by a member of the replication group to the local database environment.
For implementation reasons, all incoming replication messages must be processed using the same DbEnv 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 DbEnv::rep_process_message method has additional return values:
The DbEnv::rep_process_message method will either return DB_REP_DUPMASTER or throw an exception that encapsulates DB_REP_DUPMASTER if the replication group has more than one master. The application should reconfigure itself as a client by calling the DbEnv::rep_start method, and then call for an election by calling DbEnv::rep_elect.
The DbEnv::rep_process_message method will either return DB_REP_HOLDELECTION or throw an exception that encapsulates DB_REP_HOLDELECTION if an election is needed. The application should call for an election by calling DbEnv::rep_elect.
The DbEnv::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 DbEnv::rep_process_message method will return DB_REP_NEWMASTER if a new master has been elected. The envid parameter contains the environment ID of the new master. If the recipient of this error return has been made master, it is the application's responsibility to begin acting as the master environment.
The DbEnv::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 DbEnv::rep_start. The application should take whatever action is needed to establish a communication channel with this new environment.
The DbEnv::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.
The DbEnv::rep_process_message method will either return DB_REP_OUTDATED or throw an exception that encapsulates DB_REP_OUTDATED if the current environment's logs are too far out of date with respect to the master to be automatically synchronized. The application should copy over a hot backup of the environment, run recovery, and restart the client.
Unless otherwise specified, the DbEnv::rep_process_message method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.
Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.