123 lines
6.5 KiB
HTML
123 lines
6.5 KiB
HTML
<!--$Id: rep_message.html 63573 2008-05-23 21:43:21Z trent.nelson $-->
|
|
<!--Copyright (c) 1997,2008 Oracle. All rights reserved.-->
|
|
<!--See the file LICENSE for redistribution information.-->
|
|
<html>
|
|
<head>
|
|
<title>Berkeley DB: DbEnv::rep_process_message</title>
|
|
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
|
|
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
|
|
</head>
|
|
<body bgcolor=white>
|
|
<table width="100%"><tr valign=top>
|
|
<td>
|
|
<b>DbEnv::rep_process_message</b>
|
|
</td>
|
|
<td align=right>
|
|
<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a>
|
|
<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
|
|
</tr></table>
|
|
<hr size=1 noshade>
|
|
<tt>
|
|
<b><pre>
|
|
#include <db_cxx.h>
|
|
<p>
|
|
int
|
|
DbEnv::rep_process_message(Dbt *control, Dbt *rec, int envid, DbLsn *ret_lsnp)
|
|
</pre></b>
|
|
<hr size=1 noshade>
|
|
<b>Description: DbEnv::rep_process_message</b>
|
|
<p>The DbEnv::rep_process_message method processes an incoming replication message sent
|
|
by a member of the replication group to the local database environment.</p>
|
|
<p>The DbEnv::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.</p>
|
|
<p>For implementation reasons, all incoming replication messages must be
|
|
processed using the same <a href="../api_cxx/env_class.html">DbEnv</a> 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.</p>
|
|
<p>The DbEnv::rep_process_message method has additional return values:</p>
|
|
<br>
|
|
<b><a name="DB_REP_DUPMASTER">DB_REP_DUPMASTER</a></b><ul compact><li>
|
|
<p>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
|
|
<a href="../api_cxx/rep_start.html">DbEnv::rep_start</a> method, and then call for an election by calling
|
|
<a href="../api_cxx/rep_elect.html">DbEnv::rep_elect</a>.
|
|
</p></ul>
|
|
<b><a name="DB_REP_HOLDELECTION">DB_REP_HOLDELECTION</a></b><ul compact><li>
|
|
<p>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 <a href="../api_cxx/rep_elect.html">DbEnv::rep_elect</a>.
|
|
</p></ul>
|
|
<b><a name="DB_REP_IGNORE">DB_REP_IGNORE</a></b><ul compact><li>
|
|
<p>The DbEnv::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).
|
|
</p></ul>
|
|
<b><a name="DB_REP_ISPERM">DB_REP_ISPERM</a></b><ul compact><li>
|
|
<p>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.
|
|
</p></ul>
|
|
<b><a name="DB_REP_JOIN_FAILURE">DB_REP_JOIN_FAILURE</a></b><ul compact><li>
|
|
<p>The DbEnv::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 <a href="../api_cxx/rep_config.html#DB_REP_CONF_NOAUTOINIT">DB_REP_CONF_NOAUTOINIT</a> flag to turn-off automatic
|
|
internal initialization).
|
|
</p></ul>
|
|
<b><a name="DB_REP_NEWSITE">DB_REP_NEWSITE</a></b><ul compact><li>
|
|
<p>The DbEnv::rep_process_message method will return DB_REP_NEWSITE if the system received contact information from a new environment.
|
|
The <b>rec</b> parameter contains the opaque data specified in the
|
|
<b>cdata</b> parameter to the <a href="../api_cxx/rep_start.html">DbEnv::rep_start</a>. The application
|
|
should take whatever action is needed to establish a communication
|
|
channel with this new environment.
|
|
</p></ul>
|
|
<b><a name="DB_REP_NOTPERM">DB_REP_NOTPERM</a></b><ul compact><li>
|
|
<p>The DbEnv::rep_process_message method will return DB_REP_NOTPERM if a message carrying a <a href="../api_cxx/rep_transport.html#DB_REP_PERMANENT">DB_REP_PERMANENT</a> 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.
|
|
</p></ul>
|
|
<br>
|
|
<p>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.
|
|
</p>
|
|
<b>Parameters</b> <br>
|
|
<b>control</b><ul compact><li>The <b>control</b> parameter should reference a copy of the
|
|
<b>control</b> parameter specified by Berkeley DB on the sending
|
|
environment.</ul>
|
|
<b>envid</b><ul compact><li>The <b>envid</b> parameter should contain the local identifier that
|
|
corresponds to the environment that sent the message to be processed
|
|
(see <a href="../ref/rep/id.html">Replication environment IDs</a> for more
|
|
information).</ul>
|
|
<b>rec</b><ul compact><li>The <b>rec</b> parameter should reference a copy of the <b>rec</b>
|
|
parameter specified by Berkeley DB on the sending environment.</ul>
|
|
<b>ret_lsnp</b><ul compact><li>If DbEnv::rep_process_message method returns DB_REP_NOTPERM then the <b>ret_lsnp</b>
|
|
parameter will contain the log sequence number of this permanent log
|
|
message that could not be written to disk. If DbEnv::rep_process_message method
|
|
returns DB_REP_ISPERM then the <b>ret_lsnp</b> parameter will contain
|
|
largest log sequence number of the permanent records that are now
|
|
written to disk as a result of processing this message. In all other
|
|
cases the value of <b>ret_lsnp</b> is undefined.</ul>
|
|
<br>
|
|
<hr size=1 noshade>
|
|
<br><b>Class</b>
|
|
<a href="../api_cxx/env_class.html">DbEnv</a>
|
|
<br><b>See Also</b>
|
|
<a href="../api_cxx/rep_list.html">Replication and Related Methods</a>
|
|
</tt>
|
|
<table width="100%"><tr><td><br></td><td align=right>
|
|
<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
|
|
</td></tr></table>
|
|
<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font>
|
|
</body>
|
|
</html>
|