1<!--$Id: event.so,v 1.2 2007/05/14 16:03:56 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB Reference Guide: Release 4.6: replication events</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></b></td> 13<td align=right><a href="/upgrade.4.6/memp_fset.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/upgrade.4.6/full_election.html"><img src="/images/next.gif" alt="Next"></a> 14</td></tr></table> 15<p align=center><b>Release 4.6: replication events</b></p> 16<p>It is now guaranteed the <a href="/api_c/env_event_notify.html#DB_EVENT_REP_STARTUPDONE">DB_EVENT_REP_STARTUPDONE</a> event will be 17presented to the application after the corresponding 18<a href="/api_c/env_event_notify.html#DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> event, even in the face of extreme 19thread-scheduling anomalies. (In previous releases, if the thread 20processing the NEWMASTER message was starved, and STARTUPDONE occurred 21soon after, the order might have been reversed.)</p> 22<p>In addition, the <a href="/api_c/env_event_notify.html#DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> event is now presented 23to all types of replication applications: users of either the 24Replication Framework or the Base Replication API. In both cases, the 25<a href="/api_c/env_event_notify.html#DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> event always means that a site other than 26the local environment has become master.</p> 27<p>The <b>envid</b> parameter to <a href="/api_c/rep_message.html">DB_ENV->rep_process_message</a> has been changed to 28be of type "int" rather than "int *", and the environment ID of a new 29master is presented to the application along with the 30<a href="/api_c/env_event_notify.html#DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> event. Replication applications should 31be modified to use the <a href="/api_c/env_event_notify.html#DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> event to determine 32the ID of the new master.</p> 33<p>The <b>envid</b> parameter has been removed from the <a href="/api_c/rep_elect.html">DB_ENV->rep_elect</a> 34method and a new event type has been added. The 35<a href="/api_c/env_event_notify.html#DB_EVENT_REP_ELECTED">DB_EVENT_REP_ELECTED</a> event is presented to the application at 36the site which wins an election. In the Berkeley DB 4.6 release, the normal 37result of a successful election is either the 38<a href="/api_c/env_event_notify.html#DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> event (with the winner's environment ID), 39or the <a href="/api_c/env_event_notify.html#DB_EVENT_REP_ELECTED">DB_EVENT_REP_ELECTED</a> event. Only one of the two events 40will ever be delivered.</p> 41<p>The DB_REP_NEWMASTER return code has been removed from the 42<a href="/api_c/rep_message.html">DB_ENV->rep_process_message</a> method. Replication applications should be modified to 43use the <a href="/api_c/env_event_notify.html#DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> and <a href="/api_c/env_event_notify.html#DB_EVENT_REP_ELECTED">DB_EVENT_REP_ELECTED</a> 44events to determine the existence of a new master.</p> 45<table width="100%"><tr><td><br></td><td align=right><a href="/upgrade.4.6/memp_fset.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/upgrade.4.6/full_election.html"><img src="/images/next.gif" alt="Next"></a> 46</td></tr></table> 47<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 48</body> 49</html> 50