⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comm.so

📁 berkeley db 4.6.21的源码。berkeley db是一个简单的数据库管理系统
💻 SO
字号:
m4_comment([$Id: comm.so,v 1.19 2007/03/20 20:20:27 alanb Exp $])m4_ref_title(m4_db Replication,    Building the communications infrastructure,, rep/base_meth, rep/newsite)m4_p([dnlReplication Manager provides a built-in communicationsinfrastructure.])m4_p([dnlFor applications that use the Base replication API, which must providetheir own communications infrastructure, it is typically written with oneor more threads of control looping on one or more communicationchannels, receiving and sending messages.  These threads accept messagesfrom remote environments for the local database environment, and acceptmessages from the local environment for remote environments.  Messagesfrom remote environments are passed to the local database environmentusing the m4_refT(rep_message).  Messages from the local environment arepassed to the application for transmission using the callback functionspecified to the m4_refT(rep_set_transport).])m4_p([dnlProcesses establish communication channels by calling them4_refT(rep_set_transport), regardless of whether they are running inclient or server environments.  This method specifies the m4_arg(send)function, a callback function used by m4_db for sending messages toother database environments in the replication group.  The m4_arg(send)function takes an environment ID and two opaque data objects. It is theresponsibility of the m4_arg(send) function to transmit the informationin the two data objects to the database environment corresponding to theID, with the receiving application then calling the m4_refT(rep_message)to process the message.])m4_p([dnlThe details of the transport mechanism are left entirely to theapplication; the only requirement is that the data buffer and size ofeach of the control and rec m4_ref(Dbt)s passed to the m4_arg(send)function on the sending site be faithfully copied and delivered to thereceiving site by means of a call to m4_ref(rep_message) withcorresponding arguments.  Messages that are broadcast (whether bybroadcast media or when directed by setting them4_refT(rep_set_transport)'s envid parameter DB_EID_BROADCAST), shouldnot be processed by the message sender.  In all cases, the application'stransport media or software must ensure that m4_ref(rep_message) isnever called with a message intended for a different databaseenvironment or a broadcast message sent from the same environment onwhich m4_ref(rep_message) will be called.  The m4_refT(rep_message) isfree-threaded; it is safe to deliver any number of messagessimultaneously, and from any arbitrary thread or process in the m4_dbenvironment.])m4_p([dnlThere are a number of informational returns from them4_refT(rep_message):])m4_tagbeginm4_tag([m4_ref(DB_REP_DUPMASTER)], [dnlWhen m4_ref(rep_message) returns m4_ref(DB_REP_DUPMASTER), it means thatanother database environment in the replication group also believesitself to be the master.  The application should complete all activetransactions, close all open database handles, reconfigure itself asa client using the m4_refT(rep_start), and then call for an election bycalling the m4_refT(rep_elect).])m4_tag([m4_ref(DB_REP_HOLDELECTION)], [dnlWhen m4_ref(rep_message) returns m4_ref(DB_REP_HOLDELECTION), it meansthat another database environment in the replication group has calledfor an election.  The application should call the m4_refT(rep_elect).])m4_tag([m4_ref(DB_REP_IGNORE)], [dnlWhen m4_ref(rep_message) returns m4_ref(DB_REP_IGNORE), it means thatthis message cannot be processed.This is normally an indication that this messageis irrelevant to the current replication state, such as a messagefrom an old generation that arrived late.])m4_tag([m4_ref(DB_REP_ISPERM)], [dnlWhen m4_ref(rep_message) returns m4_ref(DB_REP_ISPERM), it means apermanent record, perhaps a message previously returned asm4_ref(DB_REP_NOTPERM) was successfullywritten to disk.  This record may have filled a gap in the log record thatallowed additional records to be written.  The m4_arg(ret_lsnp)contains the maximum LSN of the permanent records written.])m4_tag([m4_ref(DB_REP_NEWSITE)], [dnlWhen m4_ref(rep_message) returns m4_ref(DB_REP_NEWSITE), it means thata message from a previously unknown member of the replication group hasbeen received.  The application should reconfigure itself as necessaryso it is able to send messages to this site.])m4_tag([m4_ref(DB_REP_NOTPERM)], [dnlWhen m4_ref(rep_message) returns m4_ref(DB_REP_NOTPERM), it means amessage marked as m4_ref(DB_REP_PERMANENT) was processed successfullybut was not written to disk.  This is normally an indication that oneor more messages, which should have arrived before this message, havenot yet arrived.  This operation will be written to disk when themissing messages arrive.  The m4_arg(ret_lsnp) argument will containthe LSN of this record.  The application should take whatever actionis deemed necessary to retain its recoverability characteristics.])m4_tagendm4_page_footer

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -