神通数据库管理系统v7.0企业版-4详细设计说明书_第1页
神通数据库管理系统v7.0企业版-4详细设计说明书_第2页
神通数据库管理系统v7.0企业版-4详细设计说明书_第3页
神通数据库管理系统v7.0企业版-4详细设计说明书_第4页
神通数据库管理系统v7.0企业版-4详细设计说明书_第5页
已阅读5页,还剩22页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

目目 ..-背景.....................................................................................................................................-定义、首字母缩写词和缩略语..........................................................................................---- LSN(LogSequence ..-- Slave与 ..--一致性 ..-Raft..................................................................................................................................-Leader(者)..........................................................................................................-Follower(跟随者).......................................................................................................-Candidate(侯选者).....................................................................................................-.............................................................................................................................-RPC(RemoteProcedureCallProtocol)........................................................................-参考资料.............................................................................................................................-启动集群节点.....................................................................................................................-输入.............................................................................................................................-流程描述.....................................................................................................................-输出.............................................................................................................................-优先级.........................................................................................................................-集群节点请求.............................................................................................................--------------- 简 .-1 输入 2- 实现流 3- 流程描 3- 输出 3- 结构与算法 3- 优先 3- 补充说 3- 增加集群结点.....................................................................................................................3- 输入 3- 实现流 3- 流程描 3- 输出 4- 结构与算法 4- 优先 4- 补充说 4- 删除集群结点.....................................................................................................................4- 流程描 4- 优先 4- 主机线程启 ..4- 流程描 4-输 .-4结构与算法.................................................................................................................-4优先级.........................................................................................................................-5补充说明.....................................................................................................................-5主机日志发送.....................................................................................................................-5输入.............................................................................................................................-5实现流程.....................................................................................................................-5流程描述.....................................................................................................................-5输出.............................................................................................................................-5结构与算法.................................................................................................................-5优先级.........................................................................................................................-5补充说明.....................................................................................................................-5备机线程启动.....................................................................................................................-5输入.............................................................................................................................-5实现流程.....................................................................................................................-6流程描述.....................................................................................................................-6输出.............................................................................................................................-6结构与算法.................................................................................................................-6优先级.........................................................................................................................-6补充说明.....................................................................................................................-6备机日志接收.....................................................................................................................-6输入.............................................................................................................................-6实现流程.....................................................................................................................-6流程描述.....................................................................................................................-6输出.............................................................................................................................-7结构与算法.................................................................................................................-7优先级.........................................................................................................................-7补充说明.....................................................................................................................-7备机日志重做.....................................................................................................................-7输入.............................................................................................................................-7实现流程.....................................................................................................................-7流程描述.....................................................................................................................-7输出.............................................................................................................................-7结构与算法.................................................................................................................-7优先级.........................................................................................................................-7补充说明.....................................................................................................................-7数据结构设计........................................................................................................................-8外存数据结构设计.............................................................................................................-8DatabaseDesc_t...............................................................................................................-8RaftDesc_t.......................................................................................................................-8CRFBlock_t.......................................................................................................................-8内存数据结构设计.............................................................................................................-9msg_requestvote_t..........................................................................................................-9msg_requestvote_response_t..........................................................................................-9 .-9msg_appendentries_response_t....................................................................................-10RaftMsg_t......................................................................................................................-10Raft_server_t.................................................................................................................-11SlaveReportPacket.........................................................................................................-13SlaveStartPacket............................................................................................................-13MasterSendPacket.........................................................................................................-14数据结构与子模块的关系...............................................................................................-14接口设计.............................................................................................................................-15用户接口...........................................................................................................................-15配置参数...................................................................................................................-15语法支持...................................................................................................................-16新增视图...................................................................................................................-17软件接口...........................................................................................................................-17需要其它模块提供的接口.......................................................................................-17对外提供的接口.......................................................................................................-22模块内部接口...........................................................................................................-22其它接口...........................................................................................................................-22性能设计.............................................................................................................................-22数据容量...........................................................................................................................-22数据精确度.......................................................................................................................-22时间特性...........................................................................................................................-22吞吐量...............................................................................................................................-22安全性...............................................................................................................................-22跨平台...............................................................................................................................-22可靠性...............................................................................................................................-22可测试性...........................................................................................................................-22可性...........................................................................................................................-22出错处理设计......................................................................................................................-23主机网络中断...................................................................................................................-23备机网络中断...................................................................................................................-23备机的容错处理...............................................................................................................-23语句执行报错...........................................................................................................-23查询不到主机写操作...............................................................................................-24简目背采用日志传输技术的集群方案是通过在多台神通数据库服务器间进行日志传输来实现数据的高可用性,器即ar以动务的外供据服务同数库份务(即s)务进主器日步作。对用户执行的SQL定义、首字母缩写词和缩略语LSN(LogSequenceMaster(主服务器,也称为主机),写操作都只能一致性Raft是一种为了管理日志的一致性算法。它提供了和Paxos算法相同的功能和性能,但是它的算法结构和Paxos不同,且更加容易理解并且更容易构建实际的系统。Leader(者Follower(跟随者Candidate(侯选者FollowerLeaderLeaderRPC(RemoteProcedureCall参考资启动集群节点输流程描输优先高集群节点请求输无实现流无流程描输无结构与算法无优先高补充说无增加集群结输无实现流无流程描集群当前节点数为0时:输无结构与算法无优先高补充说无删除集群结流程描优先高主机线程启流程描输结构与算法无优先高补充说无主机日志发输实现流与备机连接成功的流程描如果是启动包,需要验证字节序、参数、请求的日志LSN,验证通过的话,机发送来的report包reportredo、回刷到的日志lsn记录下来,并输无结构与算法无优先高补充说无备机线程启输实现流无流程描输无结构与算法无优先高补充说无备机日志接输无实现流无流程描证不通过,根据返回的错误,调整请求的日志LSN或者报错。1.12.41.12.4输出无结构与算法无优先高补充说无备机日志重收日志线程从Master端取回的日志记录重做。输无实现流无流程描redo起始位置的日志输无结构与算法无优先高补充说无数据结构设计外存数据结构设typedefstruct //数据库恢复起点(内部设置) //数据库归档起点(内部设置) lwVerifyCode;//数据库(内部设置) //数据库的当前日志版本号(内部设置) rentLVN;//数据库的父日志版本号(内部设置) //数据库的Seq# //数据库创建时间(内部设置) szName[DB_MAX_NAME+1];//数据库名称 szArchivePath[DB_MAX_PATH1];// byNeedArchiving;//数据库是否需要归档 //数据库是否正在运行(内部设置) //数据库对应的回滚表空间ID byUnused[4]; //Raftcommitlsn }DatabaseDesc_t,typedefstruct //Raft lsnRaftLsns[RAFT_TERM_COUNT];//和对应的起始lsn //本节点的id号 //生成当前配置的日志的lsnRaftNodeDesc_tnodes[SLAVE_MAX_NUM];//节点信息}RaftDesc_t,typedefstruct lwCRC;//CRC(必须位于块头) byType;//该块的类型 by //对齐保留字union dbDesc;//数据库描述信息 dfDesc;//数据文件描述信息 lgDesc;//日志组描述信息 RaftDesc;//Raft分布式协议描述信息}CRFBlock_t,内存数据结构设typedef{/*candidate'sterm*/Id64_tterm;/*candidaterequestingvote*/Int_tcandidate_id;/*idxofcandidate'slastlogentry*/Lsn_tlast_log_idx;/*termofcandidate'slastlogentry*/Id64_tlast_log_term;}typedef{/*currentTerm,forcandidatetoupdateitself*/Id64_tterm;/*truemeanscandidatereceivedvote*/Bool8_tvote_granted;Bool8_t}typedef{Id64_tLsn_t Lsn_tlsnConfig;Id64_tprev_log_term;Id32_tdwMasterIp;Int32_tn_entries;msg_entry_t*entries;}typedef{/*currentTerm,forleadertoupdateitself*/Id64_tterm;/*successtrueiffollowercontainedentryprevLogidxandprevLogTerm*/Int64_tsuccess;/*Non-Raftfieldsfollow:/*HavingthefollowingfieldsallowsustodolessbookkeeregardstofullfledgedRPC/*ThisisthehighestlogIDXwe'vereceivedandappendedtoourlog*/Lsn_tlsnSlaveFlushNext;Bool32_tbReadable;}typedefstruct{ byUnused[5]; unionmsg_requestvote_trequestvote;msg_requestvote_response_trequestvote_response;msg_appendentries_tappendentries;msg_appendentries_response_tappendentires_response;msg_test_ip_ttest_ip;msg_test_ip_response_ttest_ip_response;msg_remove_node_tremove_node;typedefstruct/*Persistentstate:/*theserver'sbestguessofwhatthecurrentterm*startsatzeroId64_tcurrent_term;//当前Raft lsnRaftLsns[RAFT_TERM_COUNT];//和对应的起始lsn dwMaxLsnTermPos;//lsnRaftLsns中最大lsn的位置/*Thecandidatetheservervotedforinitscurrent*orNilifithasn'tvotedforany.*/Int_tvoted_for;/*idxofhighestlogentryknowntobecommitted*/Lsn_tcommit_idx;Lsn_t //redo完成的同步/*idxofhighestlogentryappliedtostatemachine*/Int_tlast_applied_idx;/*follower/leader/candidateindicator*/Int_tstate;/*mostrecentlyappendidx,alsoindicatessizeoflog*/Lsn_tcurrent_idx;/*whohasvotedforme.ThisisanarraywithN=' odeCount'elements*/Int_t*votes_for_me; Count64_t //Count64_tlwStar //election_timeout_orig计算出来的随机超时时Count64_tdwHeartbeatPeri

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论