<p>It is now guaranteed the <ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_STARTUPDONE"class="olink">DB_EVENT_REP_STARTUPDONE</a> event will be
presented to the application after the corresponding
<ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_NEWMASTER"class="olink">DB_EVENT_REP_NEWMASTER</a> event, even in the face of extreme
thread-scheduling anomalies. (In previous releases, if the thread
processing the NEWMASTER message was starved, and STARTUPDONE occurred
soon after, the order might have been reversed.)</p>
<p>In addition, the <ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_NEWMASTER"class="olink">DB_EVENT_REP_NEWMASTER</a> event is now presented
to all types of replication applications: users of either the
Replication Framework or the Base Replication API. In both cases, the
<ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_NEWMASTER"class="olink">DB_EVENT_REP_NEWMASTER</a> event always means that a site other than
the local environment has become master.</p>
<p>The <spanclass="bold"><strong>envid</strong></span> parameter to <ahref="../api_reference/C/repmessage.html"class="olink">DB_ENV->rep_process_message()</a> has been changed to
be of type "int" rather than "int *", and the environment ID of a new
master is presented to the application along with the
<ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_NEWMASTER"class="olink">DB_EVENT_REP_NEWMASTER</a> event. Replication applications should
be modified to use the <ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_NEWMASTER"class="olink">DB_EVENT_REP_NEWMASTER</a> event to determine
the ID of the new master.</p>
<p>The <spanclass="bold"><strong>envid</strong></span> parameter has been removed from the <ahref="../api_reference/C/repelect.html"class="olink">DB_ENV->rep_elect()</a>
method and a new event type has been added. The
<ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_ELECTED"class="olink">DB_EVENT_REP_ELECTED</a> event is presented to the application at
the site which wins an election. In the Berkeley DB 4.6 release, the normal
result of a successful election is either the
<ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_NEWMASTER"class="olink">DB_EVENT_REP_NEWMASTER</a> event (with the winner's environment ID),
or the <ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_ELECTED"class="olink">DB_EVENT_REP_ELECTED</a> event. Only one of the two events
will ever be delivered.</p>
<p>The DB_REP_NEWMASTER return code has been removed from the
<ahref="../api_reference/C/repmessage.html"class="olink">DB_ENV->rep_process_message()</a> method. Replication applications should be modified to
use the <ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_NEWMASTER"class="olink">DB_EVENT_REP_NEWMASTER</a> and <ahref="../api_reference/C/envevent_notify.html#event_notify_DB_EVENT_REP_ELECTED"class="olink">DB_EVENT_REP_ELECTED</a>
events to determine the existence of a new master.</p>