head 1.2; access; symbols RPM_4_2_1:1.1.1.4 RPM_4_2:1.1.1.4 RPM_4_1_1:1.1.1.4 RPM_4_1:1.1.1.3 RPM_4_0_5:1.1.1.2 RPM_4_0_4:1.1.1.1 RPM:1.1.1; locks; strict; comment @# @; 1.2 date 2008.01.02.09.52.57; author rse; state dead; branches; next 1.1; commitid z4cpSiAhOCXk5PLs; 1.1 date 2002.01.08.00.30.09; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2002.01.08.00.30.09; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2003.01.18.13.48.58; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2001.12.06.00.08.00; author rse; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 2003.01.18.14.04.57; author rse; state Exp; branches; next ; desc @@ 1.2 log @remove the ancient RPM 4.2.1 source tree copy @ text @
DB_ENV->rep_elect |
![]() ![]() |
#include <db.h>int DB_ENV->rep_elect(DB_ENV *env, int nsites, int priority, u_int32_t timeout, int *envid);
The DB_ENV->rep_elect function holds an election for the master of a replication group, returning the new master's ID in the envid parameter.
The nsites parameter indicates the number of environments that the application believes are in the replication group. This number is used by Berkeley DB to avoid having two masters active simultaneously, even in the case of a network partition. During an election, a new master cannot be elected unless more than half of nsites agree on the new master. Thus, in the face of a network partition, the side of the partition with more than half the environments will elect a new master and continue, while the environments communicating with fewer than half the other environments will fail to find a new master.
The priority parameter is the priority of this environment. It must be a positive integer, or 0 if this environment is not permitted to become a master (see Replication environment priorities for more information).
The timeout parameter specifies a timeout period for an election. If the election has not completed after timeout microseconds, the thread will return DB_REP_UNAVAIL.
The DB_ENV->rep_elect function either returns successfully, with the new master's environment ID in the memory pointed to by the envid parameter, or it will return DB_REP_UNAVAIL if the participating group members were unable to elect a new master for any reason. In the event of a successful return, the new master's ID may be the ID of the previous master, or the ID of the current environment. The application is responsible for adjusting its usage of the other environments in the replication group, including directing all database updates to the newly selected master, in accordance with the results of this election.
The thread of control that calls the DB_ENV->rep_elect function must not be the thread of control that processes incoming messages; processing the incoming messages is necessary to successfully complete an election.
The DB_ENV->rep_elect function returns a non-zero error value on failure and 0 on success.
The DB_ENV->rep_elect function may fail and return a non-zero error for the following conditions:
The DB_ENV->rep_elect function may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the DB_ENV->rep_elect function may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.
![]() ![]() |
Copyright Sleepycat Software @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @Import: RPM 4.0.4 @ text @@ 1.1.1.2 log @Import: RPM 4.0.5 @ text @d1 2 a2 2 a3 1 d29 1 a29 1
The DB_ENV->rep_elect method holds an election for the master of a replication d48 1 a48 1
The DB_ENV->rep_elect method either returns successfully, with the new d57 1 a57 1
The thread of control that calls the DB_ENV->rep_elect method must not be the d60 1 a60 1
The DB_ENV->rep_elect method returns a non-zero error value on failure and 0 on success. d62 1 a62 1
The DB_ENV->rep_elect method may fail and return a non-zero error for the following conditions: d66 4 a69 6
The DB_ENV->rep_elect method may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the DB_ENV->rep_elect method may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.
The DB_ENV->rep_elect function holds an election for the master of a replication d49 1 a49 1
The DB_ENV->rep_elect function either returns successfully, with the new d58 1 a58 1
The thread of control that calls the DB_ENV->rep_elect function must not be the d61 1 a61 1
The DB_ENV->rep_elect function returns a non-zero error value on failure and 0 on success. d63 1 a63 1
The DB_ENV->rep_elect function may fail and return a non-zero error for the following conditions: d67 6 a72 4
The DB_ENV->rep_elect function may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the DB_ENV->rep_elect function may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way. d74 1 a74 5 DB_ENV->rep_start, DB_ENV->rep_elect, DB_ENV->rep_process_message, and DB_ENV->set_rep_transport. @ 1.1.1.4 log @Import: RPM 4.1.1 @ text @d1 2 a2 2 a3 1 d29 1 a29 1
The DB_ENV->rep_elect method holds an election for the master of a replication d48 1 a48 1
The DB_ENV->rep_elect method either returns successfully, with the new d57 1 a57 1
The thread of control that calls the DB_ENV->rep_elect method must not be the d60 1 a60 1
The DB_ENV->rep_elect method returns a non-zero error value on failure and 0 on success. d62 1 a62 1
The DB_ENV->rep_elect method may fail and return a non-zero error for the following conditions: d66 4 a69 6
The DB_ENV->rep_elect method may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the DB_ENV->rep_elect method may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.