CN111290714A - Data reading method and device - Google Patents
Data reading method and device Download PDFInfo
- Publication number
- CN111290714A CN111290714A CN202010081830.7A CN202010081830A CN111290714A CN 111290714 A CN111290714 A CN 111290714A CN 202010081830 A CN202010081830 A CN 202010081830A CN 111290714 A CN111290714 A CN 111290714A
- Authority
- CN
- China
- Prior art keywords
- page
- data page
- data
- node
- lsn
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0619—Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0652—Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本申请实施例涉及计算机技术,尤其涉及一种分布式存储技术。The embodiments of the present application relate to computer technologies, and in particular, to a distributed storage technology.
背景技术Background technique
在云计算技术和服务的支持下,业务规模快速扩大,这对构建于云端的核心基础设施服务—数据库服务提出了更高的要求,于是出现了新一代云原生数据库架构,极大提升了云数据库的服务能力。With the support of cloud computing technology and services, the scale of business has expanded rapidly, which has put forward higher requirements for the core infrastructure service built on the cloud - database service, so a new generation of cloud-native database architecture has emerged, which has greatly improved the cloud. Database service capabilities.
云原生数据库架构包括主计算节点、从计算节点和存储节点,主计算节点负责读写数据,从计算节点只能读取数据。其中,数据不再被直接写入到存储节点,而是主计算节点产生redo日志,并将redo日志传送到存储节点,存储节点将redo日志回放成数据。同时redo日志被传送至从计算节点,在需要时,从计算节点将redo日志回放成数据,以使从计算节点缓存中的数据保持最新。The cloud native database architecture includes master computing nodes, slave computing nodes, and storage nodes. The master computing node is responsible for reading and writing data, and the slave computing nodes can only read data. Among them, the data is no longer directly written to the storage node, but the main computing node generates the redo log, and transmits the redo log to the storage node, and the storage node replays the redo log into data. At the same time, the redo log is transmitted to the slave computing node, and when needed, the slave computing node replays the redo log into data to keep the data in the slave computing node cache up-to-date.
由于存储节点和从计算节点各自独立回放redo日志来生成数据,所以有可能在某段时间相同的数据页的更新进度不一致,比如从计算节点需要读取某一父数据页的子数据页,而由于存储节点和从计算节点数据页的更新进度不一致,可能存在如下的情况:仅在存储节点或从计算节点中发生了与子数据页相关的页分裂,这样从计算节点从存储节点读取到的子数据页可能与从计算节点中的父数据页不匹配,即从计算节点可能读取到错误的数据。Since the storage node and the slave computing node play back redo logs independently to generate data, the update progress of the same data page may be inconsistent at a certain period of time. For example, the slave computing node needs to read the child data page of a parent data page. Since the update progress of the data pages between the storage node and the slave computing node is inconsistent, there may be the following situations: a page split related to child data pages occurs only in the storage node or the slave computing node, so that the slave computing node reads from the storage node to The child data pages may not match the parent data pages in the slave compute node, that is, the slave compute node may read incorrect data.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种数据读取方法和装置,可以使得从计算节点中的父数据页与子数据页相匹配,即保证从计算节点从存储节点读取到正确的数据。The embodiments of the present application provide a data reading method and apparatus, which can make the parent data page in the slave computing node match the child data page, that is, ensure that the computing node reads correct data from the storage node.
第一方面,本申请实施例提供一种数据读取方法,应用于存储节点,所述方法包括:从计算节点接收数据页读取请求,所述数据页读取请求包括第一标识;确定在所述存储节点中标识为所述第一标识的第一数据页对应有页分裂过程;根据所述页分裂过程的发生时机,向所述计算节点发送目标数据页,所述目标数据页为所述第一数据页或者第二数据页。可选地,所述第一标识是所述计算节点确定的待读取数据页的标识,待读取数据页为所述计算节点中的第一父数据页的子数据页。In a first aspect, an embodiment of the present application provides a data reading method, which is applied to a storage node. The method includes: receiving a data page reading request from a computing node, where the data page reading request includes a first identifier; The first data page identified as the first identifier in the storage node corresponds to a page splitting process; according to the occurrence timing of the page splitting process, a target data page is sent to the computing node, and the target data page is the target data page. the first data page or the second data page. Optionally, the first identifier is an identifier of a data page to be read determined by the computing node, and the data page to be read is a child data page of a first parent data page in the computing node.
本方面中,计算节点为从计算节点。本方案中在从计算节点需要读取某一数据页的子数据页时,可根据分裂信息确定该子数据页是否对应有页分裂过程,以在该子数据页对应有页分裂过程的情况下,根据页分裂过程的发生时机,确定正确的读取数据页,以使从计算节点中的父数据页和子数据页相互匹配,即从计算节点能够读取到正确的数据。In this aspect, the computing node is a slave computing node. In this solution, when a sub-data page of a certain data page needs to be read from the computing node, it can be determined whether the sub-data page corresponds to a page-splitting process according to the split information, so that if the sub-data page corresponds to a page-splitting process , according to the occurrence timing of the page splitting process, determine the correct read data page, so that the parent data page and the child data page in the slave computing node match each other, that is, the slave computing node can read correct data.
在一种可能的实施方式中,所述存储节点存储有部分分裂信息;所述部分分裂信息包括部分页分裂过程所对应的分裂数据页的标识以及触发页分裂过程的日志的日志序列号LSN,所述部分页分裂过程所对应的分裂数据页存储在所述存储节点中;确定在所述存储节点中标识为所述第一标识的第一数据页对应有页分裂过程,包括:确定所述部分分裂信息包括的分裂数据页的标识中存在所述第一标识。In a possible implementation manner, the storage node stores partial split information; the partial split information includes the identifier of the split data page corresponding to the partial page split process and the log sequence number LSN of the log that triggers the page split process, The split data pages corresponding to the partial page splitting process are stored in the storage node; and determining that the first data page identified as the first identifier in the storage node corresponds to a page splitting process includes: determining the The first identifier exists in the identifier of the split data page included in the partial split information.
本方案中通过分裂信息确定数据页是否对应有页分裂过程的具体实现,使得确定数据页是否对应有页分裂过程简单易实现。In this solution, the specific implementation of determining whether a data page corresponds to a page splitting process through splitting information makes it simple and easy to implement determining whether a data page corresponds to a page splitting process.
在一种可能的实施方式中,所述数据页读取请求还包括所述第一父数据页的第三LSN;在所述根据所述页分裂过程的发生时机,向所述计算节点发送所述目标数据页之前,还包括:根据触发所述页分裂过程的日志的第一LSN、存储节点中的所述第一数据页的第二LSN以及所述第三LSN,确定所述页分裂过程的发生时机。In a possible implementation manner, the data page read request further includes a third LSN of the first parent data page; when the page splitting process occurs, the data page is sent to the computing node. Before the target data page, the method further includes: determining the page splitting process according to the first LSN of the log that triggers the page splitting process, the second LSN and the third LSN of the first data page in the storage node time of occurrence.
本方案给出了确定页分裂过程的发生时机的具体实现,即通过相应日志的LSN确定,由于数据均是由日志回放得到的,因此根据相应的日志的LSN的大小判断页分裂过程的发生时机较准确。This solution provides a specific implementation for determining the occurrence timing of the page splitting process, that is, it is determined by the LSN of the corresponding log. Since the data is obtained from the log playback, the occurrence timing of the page splitting process is determined according to the size of the LSN of the corresponding log. more accurate.
在一种可能的实施方式中,所述确定所述页分裂过程的发生时机,包括:若所述第三LSN小于所述第一LSN且所述第一LSN小于或等于所述第二LSN,则确定所述页分裂过程发生在所述存储节点得到所述第一父数据页之后;若所述第一LSN小于所述第二LSN且所述第一LSN小于所述第三LSN,则确定所述页分裂过程发生在所述存储节点得到所述第一父数据页之前;若所述第二LSN小于所述第一LSN且所述第一LSN小于或等于所述第三LSN,则确定所述存储节点的数据回放速度慢于所述计算节点的数据回放速度且在所述存储节点中所述页分裂过程待发生。In a possible implementation manner, the determining when the page splitting process occurs includes: if the third LSN is smaller than the first LSN and the first LSN is smaller than or equal to the second LSN, then determine that the page splitting process occurs after the storage node obtains the first parent data page; if the first LSN is smaller than the second LSN and the first LSN is smaller than the third LSN, then determine The page splitting process occurs before the storage node obtains the first parent data page; if the second LSN is less than the first LSN and the first LSN is less than or equal to the third LSN, determine The data playback speed of the storage node is slower than the data playback speed of the computing node and the page splitting process is pending in the storage node.
在一种可能的实施方式中,所述页分裂过程的发生在所述存储节点得到所述第一父数据页之后;向所述计算节点发送目标数据页之前,还包括:向所述计算节点发送第一信息,所述第一信息用于所述计算节点确定目标数据页;接收来自所述计算节点的所述目标数据页的读取请求。In a possible implementation manner, the page splitting process occurs after the storage node obtains the first parent data page; before sending the target data page to the computing node, the method further includes: sending the computing node to the computing node Send first information, where the first information is used by the computing node to determine a target data page; and receive a read request of the target data page from the computing node.
本实施例中给出了在第一数据页对应的页分裂过程的发生在所述存储节点得到所述第一父数据页之后,如何触发从计算节点确定正确的待读取数据页的具体实现。This embodiment provides a specific implementation of how to trigger the determination of the correct data page to be read from the computing node when the page splitting process corresponding to the first data page occurs after the storage node obtains the first parent data page .
在一种可能的实施方式中,所述第一信息包括:触发所述页分裂过程的日志的第一LSN和指示信息,所述指示信息指示所述页分裂过程发生在所述存储节点得到所述第一父数据页之后。In a possible implementation manner, the first information includes: a first LSN of a log that triggers the page splitting process and indication information, where the indication information indicates that the page splitting process occurs when the storage node obtains the after the first parent data page.
在一种可能的实施方式中,所述页分裂过程发生在所述存储节点得到所述第一父数据页之前,所述目标数据页为所述存储节点中的所述第一数据页。In a possible implementation manner, the page splitting process occurs before the storage node obtains the first parent data page, and the target data page is the first data page in the storage node.
在一种可能的实施方式中,所述存储节点的数据回放速度慢于所述计算节点的数据回放速度且在所述存储节点中所述页分裂过程待发生,所述目标数据页为所述存储节点中的所述第一数据页;在向所述计算节点发送标识为所述第一标识的所述第一数据页之前,还包括:确定所述存储节点对LSN为所述第一LSN的日志回放完毕。In a possible implementation manner, the data playback speed of the storage node is slower than the data playback speed of the computing node, and the page splitting process is to occur in the storage node, and the target data page is the the first data page in a storage node; before sending the first data page identified as the first identifier to the computing node, further comprising: determining that the pair of storage nodes is the LSN as the first LSN The log playback is complete.
第二方面,本申请实施例提供一种数据读取方法,应用于计算节点,所述方法包括:确定待读取数据页的标识为第一标识,所述待读取数据页为所述计算节点中的第一父数据页的子数据页;向存储节点发送数据页读取请求,所述数据页读取请求包括第一标识,所述第一标识用于所述存储节点确定标识为第一标识的第一数据页对应的页分裂过程的发生时机以及根据所述发生时机向所述计算节点发送目标数据页;从所述存储节点接收目标数据页,所述目标数据页为所述存储节点的所述第一数据页或者第二数据页。In a second aspect, an embodiment of the present application provides a data reading method, which is applied to a computing node. The method includes: determining an identifier of a data page to be read as a first identifier, and the data page to be read is the computing node. A child data page of the first parent data page in the node; send a data page read request to the storage node, where the data page read request includes a first identifier, and the first identifier is used by the storage node to determine that the identifier is the first identifier The occurrence timing of the page splitting process corresponding to the identified first data page and sending the target data page to the computing node according to the occurrence timing; receiving the target data page from the storage node, the target data page is the storage node the first data page or the second data page of the node.
本方面中,计算节点为从计算节点。本方案中,在从计算节点需要读取某一数据页的子数据页时,可根据分裂信息确定该子数据页是否对应有页分裂过程,以在该子数据页对应有页分裂过程的情况下,根据页分裂过程的发生时机,确定正确的读取数据页,以使从计算节点中的父数据页和子数据页相互匹配,即从计算节点能够读取到正确的数据。In this aspect, the computing node is a slave computing node. In this solution, when the sub-data page of a certain data page needs to be read from the computing node, it can be determined whether the sub-data page corresponds to a page-splitting process according to the split information, so that there is a page-splitting process corresponding to the sub-data page Next, according to the occurrence timing of the page splitting process, determine the correct read data page, so that the parent data page and the child data page in the slave computing node match each other, that is, the slave computing node can read correct data.
在一种可能的实施方式中,在从所述存储节点接收目标数据页之前,还包括:接收来自所述存储节点的第一信息,所述第一信息包括:触发所述页分裂过程的日志的第一日志序列号LSN和指示信息,所述指示信息指示所述页分裂过程发生在所述存储节点得到所述第一父数据页之后;根据所述第一信息,确定目标数据页;向所述存储节点发送读取所述目标数据页的请求。In a possible implementation manner, before receiving the target data page from the storage node, the method further includes: receiving first information from the storage node, where the first information includes: a log for triggering the page splitting process the first log sequence number LSN and indication information, the indication information indicates that the page splitting process occurs after the storage node obtains the first parent data page; according to the first information, determine the target data page; The storage node sends a request to read the target data page.
本方案给出了如何触发计算节点确定目标数据页的方案。This solution gives a solution on how to trigger the computing node to determine the target data page.
在一种可能的实施方式中,所述根据所述第一信息,确定目标数据页,包括:根据所述第一信息,确定在所述存储节点中所述第一父数据页未对应有页分裂过程;从所述存储节点读取第二父数据页,所述第二父数据页为所述页分裂过程发生之后被更新的第一父数据页;根据所述第二父数据页确定所述目标数据页。In a possible implementation manner, the determining the target data page according to the first information includes: determining, according to the first information, that there is no page corresponding to the first parent data page in the storage node splitting process; read a second parent data page from the storage node, the second parent data page is the first parent data page updated after the page splitting process occurs; Describe the target data page.
本方案可以使得从计算节点得到由于第一数据页对应的页分裂过程导致的第一父数据页更新后的数据页—第二父数据页,以能够根据第二父数据页确定正确的待读取数据页—目标数据页,进而使得从计算节点中的父数据页和子数据页相互匹配,从计算节点能够读取到正确的数据。This solution can obtain the updated data page of the first parent data page—the second parent data page caused by the page splitting process corresponding to the first data page from the computing node, so that the correct to-be-read data page can be determined according to the second parent data page Take the data page—the target data page, so that the parent data page and the child data page in the slave computing node are matched with each other, and the correct data can be read from the computing node.
在一种可能的实施方式中,所述根据所述第一信息,确定目标数据页,包括:根据所述第一信息确定在所述存储节点中所述第一父数据页对应有页分裂过程;从存储节点读取第二父数据页至目标父数据页的各数据页,其中,所述目标父数据页未对应有页分裂过程且位于根数据页和所述第二父数据页之间或者所述目标父数据页为所述根数据页,所述第二父数据页为所述第一父数据页分裂后的数据页且所述第二父数据页为所述第一数据页的父数据页;根据所述第二父数据页至所述目标父数据页的各数据页,确定所述目标数据页。可以理解的是,第二父数据页的标识也为第二标识。In a possible implementation manner, the determining the target data page according to the first information includes: determining, according to the first information, that there is a page splitting process corresponding to the first parent data page in the storage node ; Read each data page from the second parent data page to the target parent data page from the storage node, wherein the target parent data page does not correspond to a page splitting process and is located between the root data page and the second parent data page Or the target parent data page is the root data page, the second parent data page is the split data page of the first parent data page, and the second parent data page is the first data page. A parent data page; determining the target data page according to each data page from the second parent data page to the target parent data page. It can be understood that the identifier of the second parent data page is also the second identifier.
本方案可以使得从计算节点得到由于第一数据页对应的页分裂过程导致的更新的各数据页—所述第二父数据页至所述目标父数据页的各数据页,以能够根据第二父数据页至目标父数据页的各数据页确定正确的待读取数据页—目标数据页,进而使得从计算节点中的父数据页和子数据页相互匹配,从计算节点能够读取到正确的数据。This solution can make each data page updated due to the page splitting process corresponding to the first data page obtained from the computing node - each data page from the second parent data page to the target parent data page, so that the data pages can be obtained according to the second data page. Each data page from the parent data page to the target parent data page determines the correct data page to be read—the target data page, so that the parent data page and the child data page in the slave computing node match each other, and the correct data page can be read from the computing node. data.
在一种可能的实施方式中,所述计算节点中存储有全量分裂信息,所述全量分裂信息包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;所述根据所述第一信息,确定在所述存储节点中所述第一父数据页对应有页分裂过程,包括:根据所述指示信息,确定所述全量分裂信息包括的分裂数据页的标识中存在所述第二标识且触发相应的页分裂过程的LSN为所述第一LSN,所述第二标识为所述第一父数据页的标识。In a possible implementation manner, the computing node stores full amount of split information, and the full amount of split information includes the identifier of the split data page corresponding to each page split process and the LSN of the log that triggers each page split process; Determining, according to the first information, that there is a page splitting process corresponding to the first parent data page in the storage node, comprising: determining, according to the indication information, among the identifiers of the split data pages included in the full split information The LSN that has the second identifier and triggers the corresponding page splitting process is the first LSN, and the second identifier is the identifier of the first parent data page.
本方案给出了确定在所述存储节点中所述第一父数据页对应有页分裂过程的一种具体实现,该方案中网络开销较少。This solution provides a specific implementation for determining that the first parent data page in the storage node corresponds to a page splitting process, and the network overhead in this solution is less.
在一种可能的实施方式中,所述计算节点中未存储有全量分裂信息,管理节点中存储有所述全量分裂信息;所述全量分裂信息包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;所述根据所述第一信息,确定在所述存储节点中所述第一父数据页对应有页分裂过程,包括:根据所述指示信息,向管理节点发送查询请求,所述查询请求包括所述第一LSN和所述第二标识,所述查询请求指示所述管理节点根据所述全量分裂信息确定在所述存储节点中所述第一父数据页是否对应有页分裂过程;接收来自所述管理节点的查询结果,所述查询结果指示在所述存储节点中所述第一父数据页对应有页分裂过程。In a possible implementation manner, the computing node does not store the full amount of split information, and the management node stores the full amount of split information; the full amount of split information includes the identifier of the split data page corresponding to each page split process and the LSN of the log that triggers each page splitting process; the determining, according to the first information, that the first parent data page in the storage node corresponds to a page splitting process, including: according to the indication information, reporting to the management The node sends a query request, the query request includes the first LSN and the second identifier, the query request instructs the management node to determine the first parent data in the storage node according to the full split information Whether a page corresponds to a page splitting process; receiving a query result from the management node, the query result indicating that the first parent data page in the storage node corresponds to a page splitting process.
本方案给出了确定在所述存储节点中所述第一父数据页对应有页分裂过程的另一种具体实现,该方案中可以节省从计算节点的存储空间。This solution provides another specific implementation of determining that the first parent data page in the storage node corresponds to a page splitting process. In this solution, the storage space of the slave computing node can be saved.
第三方面,本申请实施例提供一种数据读取方法,应用于计算节点,所述方法包括:确定待读取数据页的标识为第一标识,所述待读取数据页为所述计算节点中的第一父数据页的子数据页;确定存储节点中标识为所述第一标识的第一数据页对应有页分裂过程;根据所述页分裂过程的发生时机,确定目标数据页;从所述存储节点读取所述目标数据页。In a third aspect, an embodiment of the present application provides a data reading method, which is applied to a computing node. The method includes: determining an identifier of a data page to be read as a first identifier, and the data page to be read is the computing node. the child data page of the first parent data page in the node; determine that the first data page marked as the first identifier in the storage node corresponds to a page splitting process; determine the target data page according to the occurrence timing of the page splitting process; The target data page is read from the storage node.
本方面中,计算节点为从计算节点。本方案中,在从计算节点需要读取某一数据页的子数据页时,可根据分裂信息确定该子数据页是否对应有页分裂过程,以在该子数据页对应有页分裂过程的情况下,根据页分裂过程的发生时机,确定正确的读取数据页,以使从计算节点中的父数据页和子数据页相互匹配,即从计算节点能够读取到正确的数据。In this aspect, the computing node is a slave computing node. In this solution, when the sub-data page of a certain data page needs to be read from the computing node, it can be determined whether the sub-data page corresponds to a page-splitting process according to the split information, so that there is a page-splitting process corresponding to the sub-data page Next, according to the occurrence timing of the page splitting process, determine the correct read data page, so that the parent data page and the child data page in the slave computing node match each other, that is, the slave computing node can read correct data.
在一种可能的实施方式中,所述计算节点中存储有全量分裂信息,所述全量分裂信息中包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;确定存储节点中标识为所述第一标识的第一数据页对应有页分裂过程,包括:确定所述全量分裂信息包括的分裂数据页的标识中存在所述第一标识。In a possible implementation manner, the computing node stores full split information, and the full split information includes the identifier of the split data page corresponding to each page split process and the LSN of the log that triggers each page split process; Determining that the first data page identified as the first identification in the storage node corresponds to a page splitting process includes: determining that the first identification exists in the identification of the split data page included in the full amount of splitting information.
本方案中通过分裂信息确定存储节点中标识为第一标识的第一数据页对应有页分裂过程,简单易实现,且网络开销少。In this solution, it is determined by the split information that the first data page marked as the first identifier in the storage node corresponds to a page splitting process, which is simple and easy to implement, and has low network overhead.
在一种可能的实施方式中,所述计算节点中未存储有全量分裂信息,所述管理节点中存储有全量分裂信息,所述全量分裂信息中包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;In a possible implementation manner, the computing node does not store the full amount of split information, the management node stores the full amount of split information, and the full amount of split information includes the split data pages corresponding to each page split process. The LSN of the log that identifies and triggers the splitting process of each page;
本方案中通过分裂信息确定存储节点中标识为第一标识的第一数据页对应有页分裂过程,简单易实现。In this solution, it is determined through the split information that the first data page identified as the first identifier in the storage node corresponds to a page split process, which is simple and easy to implement.
在一种可能的实施方式中,在所述根据所述页分裂过程的发生时机,确定目标数据页之前,还包括:根据触发所述页分裂过程的日志的第一LSN、存储节点中的所述第一数据页的第二LSN以及所述计算节点中的第一父数据页的第三LSN,确定所述页分裂过程的发生时机。In a possible implementation manner, before determining the target data page according to the occurrence timing of the page splitting process, the method further includes: according to the first LSN of the log that triggers the page splitting process, all the data in the storage node The second LSN of the first data page and the third LSN of the first parent data page in the computing node are used to determine the occurrence timing of the page splitting process.
本方案给出了确定页分裂过程的发生时机的具体实现,即通过相应日志的LSN确定,由于数据均是由日志回放得到的,因此根据相应的日志的LSN的大小判断页分裂过程的发生时机较准确。This solution provides a specific implementation for determining the occurrence timing of the page splitting process, that is, it is determined by the LSN of the corresponding log. Since the data is obtained from the log playback, the occurrence timing of the page splitting process is determined according to the size of the LSN of the corresponding log. more accurate.
在一种可能的实施方式中,所述确定所述页分裂过程的发生时机,包括:若所述第三LSN小于所述第一LSN且所述第一LSN小于或等于所述第二LSN,则确定所述页分裂过程发生在所述存储节点得到所述第一父数据页之后;若所述第一LSN小于所述第二LSN且所述第一LSN小于所述第三LSN,则确定所述页分裂过程发生在所述存储节点得到所述第一父数据页之前;若所述第二LSN小于所述第一LSN,所述第一LSN小于或等于所述第三LSN,则确定所述存储节点的数据回放速度慢于所述计算节点的数据回放速度且在所述存储节点中所述页分裂过程待发生。In a possible implementation manner, the determining when the page splitting process occurs includes: if the third LSN is smaller than the first LSN and the first LSN is smaller than or equal to the second LSN, then determine that the page splitting process occurs after the storage node obtains the first parent data page; if the first LSN is smaller than the second LSN and the first LSN is smaller than the third LSN, then determine The page splitting process occurs before the storage node obtains the first parent data page; if the second LSN is smaller than the first LSN, and the first LSN is smaller than or equal to the third LSN, determine The data playback speed of the storage node is slower than the data playback speed of the computing node and the page splitting process is pending in the storage node.
在一种可能的实施方式中,若所述页分裂过程发生在所述存储节点得到所述第一父数据页之后,则所述确定所述目标数据页,包括:确定在所述存储节点中所述第一父数据页未对应有页分裂过程;从存储节点读取第二父数据页,所述第二父数据页为所述页分裂发生后被更新的第一父数据页;根据所述第二父数据页确定目标数据页。In a possible implementation manner, if the page splitting process occurs after the storage node obtains the first parent data page, the determining the target data page includes: determining that the storage node is in the storage node The first parent data page does not correspond to a page splitting process; the second parent data page is read from the storage node, and the second parent data page is the first parent data page updated after the page split occurs; The second parent data page determines the target data page.
本方案可以使得从计算节点得到由于第一数据页对应的页分裂过程导致的更新的数据页—第二父数据页,以能够根据第二父数据页确定正确的待读取数据页—目标数据页,进而使得从计算节点中的父数据页和子数据页相互匹配,从计算节点能够读取到正确的数据。This solution enables to obtain the updated data page—the second parent data page caused by the page splitting process corresponding to the first data page from the computing node, so that the correct data page to be read—target data can be determined according to the second parent data page page, so that the parent data page and the child data page in the slave computing node match each other, and the slave computing node can read correct data.
在一种可能的实施方式中,若所述页分裂过程发生在所述存储节点得到第一父数据页之后,则根据所述页分裂过程的发生时机,确定所述目标数据页,包括:确定在所述存储节点中所述第一父数据页对应有页分裂过程;从存储节点读取第二父数据页至目标父数据页的各数据页,其中,所述目标父数据页未对应有页分裂过程且位于根数据页和所述第二父数据页之间或者所述目标父数据页为所述根数据页,所述第二父数据页为所述第一父数据页分裂后的数据页且所述第二父数据页为所述第一数据页的父数据页;根据所述第二父数据页至所述目标父数据页的各数据页,确定所述目标数据页。In a possible implementation manner, if the page splitting process occurs after the storage node obtains the first parent data page, determining the target data page according to the occurrence timing of the page splitting process includes: determining In the storage node, the first parent data page corresponds to a page splitting process; each data page from the second parent data page to the target parent data page is read from the storage node, wherein the target parent data page does not correspond to a page splitting process; Page splitting process and located between the root data page and the second parent data page or the target parent data page is the root data page, and the second parent data page is the split of the first parent data page A data page and the second parent data page is a parent data page of the first data page; the target data page is determined according to each data page from the second parent data page to the target parent data page.
本方案可以使得从计算节点得到由于第一数据页对应的页分裂过程导致的更新的各数据页—所述第二父数据页至所述目标父数据页的各数据页,以能够根据第二父数据页至目标父数据页的各数据页确定正确的待读取数据页—目标数据页,进而使得从计算节点中的父数据页和子数据页相互匹配,从计算节点能够读取到正确的数据。This solution can make each data page updated due to the page splitting process corresponding to the first data page obtained from the computing node - each data page from the second parent data page to the target parent data page, so that the data pages can be obtained according to the second data page. Each data page from the parent data page to the target parent data page determines the correct data page to be read—the target data page, so that the parent data page and the child data page in the slave computing node match each other, and the correct data page can be read from the computing node. data.
在一种可能的实施方式中,若所述页分裂过程发生在所述存储节点得到所述第一父数据页之前,则所述确定所述目标数据页,包括:确定存储节点中的所述第一数据页为目标数据页。In a possible implementation manner, if the page splitting process occurs before the storage node obtains the first parent data page, the determining the target data page includes: determining the The first data page is the target data page.
在一种可能的实施方式中,若存储节点的数据回放速度慢于计算节点的数据回放速度且存储节点中所述页分裂过程待发生,则所述确定目标数据页包括:确定所述存储节点对所述第一LSN的日志回放完毕;确定存储节点中的所述第一数据页为目标数据页。In a possible implementation manner, if the data playback speed of the storage node is slower than the data playback speed of the computing node and the page splitting process in the storage node is about to occur, the determining the target data page includes: determining the storage node The log playback of the first LSN is completed; the first data page in the storage node is determined as the target data page.
第四方面,本申请实施例提供一种数据读取装置,包括:收发模块,用于从计算节点接收数据页读取请求,所述数据页读取请求包括第一标识;处理模块,用于确定在数据读取装置中标识为所述第一标识的第一数据页对应有页分裂过程;收发模块,还用于根据所述页分裂过程的发生时机,向所述计算节点发送目标数据页,所述目标数据页为所述第一数据页或者第二数据页。In a fourth aspect, an embodiment of the present application provides a data reading device, including: a transceiver module for receiving a data page reading request from a computing node, where the data page reading request includes a first identifier; a processing module for It is determined that the first data page marked as the first identifier in the data reading device corresponds to a page splitting process; the transceiver module is further configured to send the target data page to the computing node according to the occurrence timing of the page splitting process , the target data page is the first data page or the second data page.
在一种可能的实施方式中,所述数据读取装置中存储有部分分裂信息;所述部分分裂信息包括部分页分裂过程所对应的分裂数据页的标识以及触发页分裂过程的日志的日志序列号LSN,且所述部分页分裂过程所对应的分裂数据页均存储在所述数据读取装置中;所述处理模块,具体用于确定所述部分分裂信息包括的分裂数据页的标识中存在所述第一标识。In a possible implementation manner, the data reading device stores partial split information; the partial split information includes an identifier of a split data page corresponding to a partial page split process and a log sequence of a log that triggers the page split process number LSN, and the split data pages corresponding to the partial page splitting process are all stored in the data reading device; the processing module is specifically configured to determine that the split data pages included in the partial split information exist in the identifiers the first identifier.
在一种可能的实施方式中,所述第一标识是所述计算节点确定的待读取数据页的标识,待读取数据页为所述计算节点中的第一父数据页的子数据页。In a possible implementation manner, the first identifier is an identifier of the data page to be read determined by the computing node, and the data page to be read is a child data page of the first parent data page in the computing node .
在一种可能的实施方式中,所述数据页读取请求包括所述第一标识和所述计算点中的所述第一父数据页的第三LSN;在所述收发模块根据所述页分裂过程的发生时机,向所述计算节点发送所述目标数据页之前,所述处理模块还用于:根据触发所述页分裂过程的日志的第一LSN、数据读取装置中所述第一数据页的第二LSN以及所述第三LSN,确定所述页分裂过程的发生时机。In a possible implementation manner, the data page read request includes the first identifier and the third LSN of the first parent data page in the calculation point; The occurrence timing of the splitting process, before sending the target data page to the computing node, the processing module is further configured to: according to the first LSN of the log triggering the page splitting process, the first LSN in the data reading device The second LSN and the third LSN of the data page determine the occurrence timing of the page splitting process.
在一种可能的实施方式中,所述处理模块具体用于:若所述第三LSN小于所述第一LSN且所述第一LSN小于或等于所述第二LSN,则确定所述页分裂过程发生在所述数据读取装置得到所述第一父数据页之后;若所述第一LSN小于所述第二LSN且所述第一LSN小于所述第三LSN,则确定所述页分裂过程发生在所述数据读取装置得到所述第一父数据页之前;若所述第二LSN小于所述第一LSN且所述第一LSN小于或等于所述第三LSN,则确定所述数据读取装置的数据回放速度慢于所述计算节点的数据回放速度且在所述数据读取装置中所述页分裂过程待发生。In a possible implementation manner, the processing module is specifically configured to: determine the page split if the third LSN is smaller than the first LSN and the first LSN is smaller than or equal to the second LSN The process occurs after the data reading device obtains the first parent data page; if the first LSN is less than the second LSN and the first LSN is less than the third LSN, then the page is determined to be split The process occurs before the data reading device obtains the first parent data page; if the second LSN is less than the first LSN and the first LSN is less than or equal to the third LSN, determining the The data playback speed of the data reading device is slower than the data playback speed of the computing node and the page splitting process is to take place in the data reading device.
在一种可能的实施方式中,所述页分裂过程的发生在所述数据读取装置得到所述第一父数据页之后;在所述收发模块向所述计算节点发送目标数据页之前,所述收发模块还用于:向所述计算节点发送第一信息,所述第一信息用于所述计算节点确定待读取的所述目标数据页;接收来自所述计算节点的所述目标数据页的读取请求。In a possible implementation manner, the page splitting process occurs after the data reading device obtains the first parent data page; before the transceiver module sends the target data page to the computing node, the The transceiver module is further configured to: send first information to the computing node, where the first information is used by the computing node to determine the target data page to be read; receive the target data from the computing node page read request.
在一种可能的实施方式中,所述第一信息包括:触发所述页分裂过程的日志的第一LSN和指示信息,所述指示信息指示所述页分裂过程发生在所述数据读取装置得到第一父数据页之后。In a possible implementation manner, the first information includes: a first LSN of a log that triggers the page splitting process and indication information, where the indication information indicates that the page splitting process occurs in the data reading device After getting the first parent data page.
在一种可能的实施方式中,所述页分裂过程发生在所述数据读取装置得到所述第一父数据页之前,所述目标数据页为所述数据读取装置中的所述第一数据页。In a possible implementation manner, the page splitting process occurs before the data reading device obtains the first parent data page, and the target data page is the first parent data page in the data reading device data page.
在一种可能的实施方式中,所述数据读取装置的数据回放速度慢于所述计算节点的数据回放速度且在所述数据读取装置中所述页分裂过程待发生,所述目标数据页为所述数据读取装置中的所述第一数据页。在所述收发模块向所述计算节点发送所述第一数据页之前,所述处理模块还用于:确定所述数据读取装置对LSN为所述第一LSN的日志回放完毕。In a possible implementation, the data playback speed of the data reading device is slower than the data playback speed of the computing node and the page splitting process is to occur in the data reading device, the target data The page is the first data page in the data reading device. Before the transceiver module sends the first data page to the computing node, the processing module is further configured to: determine that the data reading device has finished playing back the log whose LSN is the first LSN.
第五方面,本申请实施例提供一种数据读取装置,包括:处理模块,用于确定待读取数据页的标识为第一标识,所述待读取数据页为所述数据读取装置中的第一父数据页的子数据页;收发模块,用于向存储节点发送数据页读取请求,所述数据页读取请求包括所述第一标识,所述第一标识用于所述存储节点确定标识为第一标识的第一数据页对应的页分裂过程的发生时机以及根据所述发生时机向所述数据读取装置发送目标数据页;所述收发模块,还用于从所述存储节点接收目标数据页,所述目标数据页为第二数据页或者所述第一数据页。In a fifth aspect, an embodiment of the present application provides a data reading device, comprising: a processing module configured to determine an identifier of a data page to be read as a first identifier, and the data page to be read is the data reading device The child data page of the first parent data page in the data page; the transceiver module is configured to send a data page read request to the storage node, where the data page read request includes the first identifier, and the first identifier is used for the The storage node determines the occurrence timing of the page splitting process corresponding to the first data page identified as the first identification, and sends the target data page to the data reading device according to the occurrence timing; The storage node receives a target data page, where the target data page is the second data page or the first data page.
在一种可能的实施方式中,在所述收发模块从所述存储节点接收目标数据页之前:所述收发模块,还用于接收来自所述存储节点的第一信息,所述第一信息包括:触发所述页分裂过程的日志的第一日志序列号LSN和指示信息,所述指示信息指示所述页分裂过程发生在所述存储节点得到所述第一父数据页之后;所述处理模块,还用于根据所述第一信息,确定目标数据页;所述收发模块,还用于向所述存储节点发送读取所述目标数据页的请求。In a possible implementation manner, before the transceiver module receives the target data page from the storage node: the transceiver module is further configured to receive first information from the storage node, where the first information includes : the first log sequence number LSN and indication information of the log that triggers the page splitting process, the indication information indicates that the page splitting process occurs after the storage node obtains the first parent data page; the processing module is further configured to determine a target data page according to the first information; the transceiver module is further configured to send a request for reading the target data page to the storage node.
在一种可能的实施方式中,所述处理模块具体用于:根据所述第一信息,确定在所述存储节点中第一父数据页未对应有页分裂过程;从所述存储节点读取第二父数据页,所述第二父数据页为所述页分裂过程发生之后被更新的第一父数据页;根据所述第二父数据页确定所述目标数据页。In a possible implementation manner, the processing module is specifically configured to: determine, according to the first information, that the first parent data page in the storage node does not correspond to a page splitting process; read from the storage node A second parent data page, the second parent data page is the first parent data page updated after the page splitting process occurs; the target data page is determined according to the second parent data page.
在一种可能的实施方式中,所述处理模块具体用于:根据所述第一信息确定在所述存储节点中所述第一父数据页对应有页分裂过程;从存储节点读取第二父数据页至目标父数据页的各数据页,其中,所述目标父数据页未对应有页分裂过程且位于根数据页和所述第二父数据页之间或者所述目标父数据页为所述根数据页,所述第二父数据页为所述第一父数据页分裂后的数据页且所述第二父数据页为所述第一数据页的父数据页;根据所述第二父数据页至所述目标父数据页的各数据页,确定所述目标数据页。In a possible implementation manner, the processing module is specifically configured to: determine, according to the first information, that there is a page splitting process corresponding to the first parent data page in the storage node; read the second data page from the storage node Each data page from the parent data page to the target parent data page, wherein the target parent data page does not correspond to a page splitting process and is located between the root data page and the second parent data page or the target parent data page is the root data page, the second parent data page is a split data page of the first parent data page, and the second parent data page is a parent data page of the first data page; Each data page from two parent data pages to the target parent data page is determined to determine the target data page.
在一种可能的实施方式中,所述数据存储装置中存储有全量分裂信息,所述全量分裂信息包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;所述处理模块,具体用于:根据所述第一信息,确定所述全量分裂信息包括的分裂数据页的标识中存在所述第二标识且触发相应的页分裂过程的LSN为所述第一LSN,所述第二标识为所述第一父数据页的标识。In a possible implementation manner, the data storage device stores full amount of split information, and the full amount of split information includes an identifier of a split data page corresponding to each page split process and an LSN of a log that triggers each page split process; The processing module is specifically configured to: determine, according to the first information, that the second identifier exists in the identifier of the split data page included in the full split information and the LSN that triggers the corresponding page splitting process is the first identifier LSN, the second identifier is the identifier of the first parent data page.
在一种可能的实施方式中,所述数据存储装置中未存储有全量分裂信息,管理节点中存储有所述全量分裂信息;所述全量分裂信息包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;所述处理模块具体用于:根据所述指示信息,控制所述收发模块向管理节点发送查询请求,所述查询请求包括所述第一LSN和所述第二标识,所述查询请求指示所述管理节点根据所述全量分裂信息确定在所述存储节点中所述第一父数据页是否对应有页分裂过程;根据所述收发模块接收的来自所述管理节点的查询结果,确定所述在所述存储节点中所述第一父数据页对应有页分裂过程,所述查询结果指示在所述存储节点中所述第一父数据页对应有页分裂过程。In a possible implementation manner, the data storage device does not store the full amount of split information, and the management node stores the full amount of split information; the full amount of split information includes the split data pages corresponding to each page split process. an LSN that identifies and triggers the log of each page splitting process; the processing module is specifically configured to: control the transceiver module to send a query request to the management node according to the indication information, where the query request includes the first LSN and all the second identifier, the query request instructs the management node to determine whether there is a page splitting process corresponding to the first parent data page in the storage node according to the full split information; The query result of the management node, it is determined that the first parent data page in the storage node corresponds to a page splitting process, and the query result indicates that the first parent data page in the storage node corresponds to a page splitting process.
第六方面,本申请实施例提供一种数据读取装置,包括:处理模块,用于确定待读取数据页的标识为第一标识,所述待读取数据页为所述数据读取装置中的第一父数据页的子数据页;确定存储节点中标识为所述第一标识的第一数据页对应有页分裂过程;根据所述页分裂过程的发生时机,确定目标数据页;从所述存储节点读取所述目标数据页。In a sixth aspect, an embodiment of the present application provides a data reading device, comprising: a processing module configured to determine an identifier of a data page to be read as a first identifier, and the data page to be read is the data reading device The child data page of the first parent data page in the storage node; determine that the first data page marked as the first identifier in the storage node corresponds to a page splitting process; according to the occurrence timing of the page splitting process, determine the target data page; from The storage node reads the target data page.
在一种可能的实施方式中,所述数据读取装置中存储有全量分裂信息,所述全量分裂信息中包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;所述处理模块,具体用于:确定所述全量分裂信息包括的分裂数据页的标识中存在所述第一标识。In a possible implementation manner, the data reading device stores full split information, and the full split information includes an identifier of a split data page corresponding to each page split process and an identifier of a log that triggers each page split process. LSN; the processing module is specifically configured to: determine that the first identifier exists in the identifiers of the split data pages included in the full split information.
在一种可能的实施方式中,还包括收发模块;所述数据读取装置中未存储有全量分裂信息,所述管理节点中存储有全量分裂信息,所述全量分裂信息中包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;所述处理模块,具体用于控制收发模块向所述管理节点发送查询请求,所述查询请求包括所述第一标识,所述查询请求指示所述管理节点根据所述全量分裂信息确定所述第一数据页在所述存储节点中对应有页分裂过程;以及根据收发模块接收的来自所述管理节点的查询结果确定所述第一数据页在所述存储节点中对应有页分裂过程,所述查询结果指示所述第一数据页在所述存储节点中对应有页分裂过程。In a possible implementation manner, it further includes a transceiver module; the data reading device does not store full split information, the management node stores full split information, and the full split information includes each page split process The identifier of the corresponding split data page and the LSN of the log that triggers the splitting process of each page; the processing module is specifically configured to control the transceiver module to send a query request to the management node, and the query request includes the first identifier, The query request instructs the management node to determine, according to the full split information, that the first data page corresponds to a page splitting process in the storage node; The first data page corresponds to a page splitting process in the storage node, and the query result indicates that the first data page corresponds to a page splitting process in the storage node.
在一种可能的实施方式中,在所述处理模块根据所述页分裂过程的发生时机,确定目标数据页之前,所述处理模块还用于:根据触发所述页分裂过程的日志的第一LSN、存储节点中的所述第一数据页的第二LSN以及所述数据读取装置中的第一父数据页的第三LSN,确定所述页分裂过程的发生时机。In a possible implementation manner, before the processing module determines the target data page according to the occurrence timing of the page splitting process, the processing module is further configured to: according to the first log of triggering the page splitting process The LSN, the second LSN of the first data page in the storage node, and the third LSN of the first parent data page in the data reading device determine the occurrence timing of the page splitting process.
在一种可能的实施方式中,所述处理模块具体用于:若所述第三LSN小于所述第一LSN且所述第一LSN小于或等于所述第二LSN,则确定所述页分裂过程发生在所述存储节点得到所述第一父数据页之后;若所述第一LSN小于所述第二LSN且所述第一LSN小于所述第三LSN,则确定所述页分裂过程发生在所述存储节点得到所述第一父数据页之前;若所述第二LSN小于所述第一LSN,所述第一LSN小于或等于所述第三LSN,则确定所述存储节点的数据回放速度慢于所述数据读取装置的数据回放速度且在所述存储节点中所述页分裂过程待发生。In a possible implementation manner, the processing module is specifically configured to: determine the page split if the third LSN is smaller than the first LSN and the first LSN is smaller than or equal to the second LSN The process occurs after the storage node obtains the first parent data page; if the first LSN is smaller than the second LSN and the first LSN is smaller than the third LSN, it is determined that the page splitting process occurs Before the storage node obtains the first parent data page; if the second LSN is less than the first LSN, and the first LSN is less than or equal to the third LSN, determine the data of the storage node The playback speed is slower than the data playback speed of the data reading device and the page splitting process is to take place in the storage node.
在一种可能的实施方式中,若所述页分裂过程发生在所述存储节点得到所述第一父数据页之后,则所述处理模块具体用于:确定在所述存储节点中所述第一父数据页未对应有页分裂过程;从存储节点读取第二父数据页,所述第二父数据页为所述页分裂发生后被更新的第一父数据页;根据所述第二父数据页确定目标数据页。In a possible implementation manner, if the page splitting process occurs after the storage node obtains the first parent data page, the processing module is specifically configured to: determine the first parent data page in the storage node. A parent data page does not correspond to a page splitting process; the second parent data page is read from the storage node, and the second parent data page is the first parent data page updated after the page split occurs; according to the second The parent data page determines the target data page.
在一种可能的实施方式中,若所述页分裂过程发生在所述存储节点得到第一父数据页之后,则所述处理模块具体用于:确定在所述存储节点中所述第一父数据页对应有页分裂过程;从存储节点读取第二父数据页至目标父数据页的各数据页,其中,所述目标父数据页未对应有页分裂过程且位于根数据页和所述第二父数据页之间或者所述目标父数据页为所述根数据页,所述第二父数据页为所述第一父数据页分裂后的数据页且所述第二父数据页为所述第一数据页的父数据页;根据所述第二父数据页至所述目标父数据页的各数据页,确定所述目标数据页。In a possible implementation manner, if the page splitting process occurs after the storage node obtains the first parent data page, the processing module is specifically configured to: determine the first parent data page in the storage node The data page corresponds to a page splitting process; each data page from the second parent data page to the target parent data page is read from the storage node, wherein the target parent data page does not correspond to a page splitting process and is located between the root data page and the Between second parent data pages or the target parent data page is the root data page, the second parent data page is a split data page of the first parent data page, and the second parent data page is The parent data page of the first data page; the target data page is determined according to each data page from the second parent data page to the target parent data page.
在一种可能的实施方式中,若所述页分裂过程发生在所述存储节点得到所述第一父数据页之前,则所述处理模块具体用于:确定存储节点中的所述第一数据页为目标数据页。In a possible implementation manner, if the page splitting process occurs before the storage node obtains the first parent data page, the processing module is specifically configured to: determine the first data in the storage node page is the target data page.
在一种可能的实施方式中,若存储节点的数据回放速度慢于数据读取装置的数据回放速度且存储节点中所述页分裂过程待发生,则所述处理模块具体用于:确定所述存储节点对所述第一LSN的日志回放完毕;确定存储节点中的所述第一数据页为目标数据页。In a possible implementation manner, if the data playback speed of the storage node is slower than the data playback speed of the data reading device and the page splitting process in the storage node is about to occur, the processing module is specifically configured to: determine the The storage node finishes replaying the log of the first LSN; the first data page in the storage node is determined as the target data page.
第七方面,本申请实施例提供一种一种电子设备,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行第一方面以及第一方面任一可能设计中所述的方法或者执行第二方面以及第二方面任一可能设计中所述的方法或者执行第三方面以及第三方面任一可能设计中所述的方法。In a seventh aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores data that can be processed by the at least one processor instructions executed by a processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the first aspect and the method described in any possible design of the first aspect or to perform the second aspect and the The method described in any possible design of the second aspect or perform the method described in the third aspect and any possible design of the third aspect.
第八方面,本申请提供一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使所述计算机执行第一方面以及第一方面任一可能设计中所述的方法或者执行第二方面以及第二方面任一可能设计中所述的方法或者执行第三方面以及第三方面任一可能设计中所述的方法。In an eighth aspect, the present application provides a non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to cause the computer to execute the method described in the first aspect and any possible design of the first aspect or Perform the method described in the second aspect and any possible design of the second aspect or perform the method described in the third aspect and any possible design of the third aspect.
上述申请中的一个实施例具有如下优点或有益效果:可以使得从计算节点中的父数据页与子数据页相匹配,即保证从计算节点从存储节点读取到正确的数据。因为通过确定存储节点中标识为的第一标识的第一数据页是否对应有页分裂过程(第一标识为计算节点初始确定的待读取的数据页的标识),若是,则根据该页分裂过程的时机,确定待读取的正确数据页,从存储节点中读取该正确数据页;所以克服了现有技术中由于从计算节点和存储节点将日志回放成数据的速度不一致造成的从计算节点从存储节点中读取数据时,有可能使得从计算节点中的父数据页与子数据页不匹配的技术问题,保证从计算节点中的父数据页与子数据页相匹配,即保证从计算节点从存储节点读取到正确的数据的技术效果。An embodiment in the above application has the following advantages or beneficial effects: the parent data page in the slave computing node can be matched with the child data page, that is, it is ensured that the computing node reads correct data from the storage node. Because by determining whether the first data page identified as the first identifier in the storage node corresponds to a page splitting process (the first identifier is the identifier of the data page to be read initially determined by the computing node), if so, then split according to the page The timing of the process determines the correct data page to be read, and reads the correct data page from the storage node; therefore, it overcomes the inconsistency in the speed of replaying the log into data from the computing node and the storage node in the prior art. When the node reads data from the storage node, there may be a technical problem that the parent data page in the slave computing node does not match the child data page. Ensure that the parent data page in the slave computing node matches the child data page, that is, ensure that the slave data page matches the child data page. The technical effect that the computing node reads the correct data from the storage node.
上述可选方式所具有的其他效果将在下文中结合具体实施例加以说明。Other effects of the above-mentioned optional manners will be described below with reference to specific embodiments.
附图说明Description of drawings
附图用于更好地理解本方案,不构成对本申请的限定。其中:The accompanying drawings are used for better understanding of the present solution, and do not constitute a limitation to the present application. in:
图1为本申请实施例提供的二阶B树的一种结构示意图;1 is a schematic structural diagram of a second-order B-tree provided by an embodiment of the present application;
图2为本申请实施例提供的多阶B树的一种结构示意图;2 is a schematic structural diagram of a multi-order B-tree provided by an embodiment of the present application;
图3为本申请实施例提供的B树的一种页分裂过程示意图;3 is a schematic diagram of a page splitting process of a B-tree provided by an embodiment of the present application;
图4为本申请实施例提供的B+树一种结构示意图;4 is a schematic structural diagram of a B+ tree provided in an embodiment of the present application;
图5为本申请实施例提供的B+树的一种页分裂过程示意图;5 is a schematic diagram of a page splitting process of a B+ tree provided by an embodiment of the present application;
图6为本申请实施例提供的系统架构图;FIG. 6 is a system architecture diagram provided by an embodiment of the present application;
图7为本申请实施例提供的数据读取场景示意图;7 is a schematic diagram of a data reading scenario provided by an embodiment of the present application;
图8为本申请实施例提供的数据获取方法的流程图一;FIG. 8 is a
图9为本申请实施例提供的数据获取方法的流程图二;9 is a second flowchart of a data acquisition method provided by an embodiment of the present application;
图10为本申请实施例提供的数据获取装置的结构示意图;10 is a schematic structural diagram of a data acquisition apparatus provided by an embodiment of the present application;
图11是用来实现本申请实施例的数据获取方法的电子设备的框图。FIG. 11 is a block diagram of an electronic device used to implement the data acquisition method of the embodiment of the present application.
具体实施方式Detailed ways
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present application are described below with reference to the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。本申请中术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。In this application, "at least one" means one or more, and "plurality" means two or more. "And/or", which describes the relationship of the associated objects, indicates that there can be three kinds of relationships, for example, A and/or B, it can indicate that A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the associated objects are an "or" relationship. "At least one item(s) below" or similar expressions thereof refer to any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one item (a) of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c may be single or multiple . The terms "first", "second" and the like in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
首先对本申请涉及的要素进行说明。First, the elements involved in the present application will be described.
在一些数据存储的场景中,比如分布式数据库中,数据以页的形式存放,每个数据页可以是4k byte(16k或者其他任意大小)。数据被依次添加到数据页中,直到数据填满为止。在数据以B树或者B树的变体(比如B+树、B*树)组织的数据库中,如果数据页被填满,则可能发生页分裂,即一个数据页分裂成两个数据页,新数据按照顺序被插入到相应的数据页。In some data storage scenarios, such as a distributed database, data is stored in the form of pages, and each data page can be 4k bytes (16k or any other size). Data is sequentially added to the data pages until the data fills up. In a database in which data is organized by B-tree or a variant of B-tree (such as B+ tree, B* tree), if data pages are filled, page splitting may occur, that is, a data page is split into two data pages, and new Data is inserted into the corresponding data pages in order.
在B树或者B树的变体中,包括非叶子结点和叶子结点,所有非叶子结点均拥有儿子,本实施例中称非叶子结点的“儿子”为非叶子结点的子结点,非叶子结点为其儿子的“父结点”。In a B-tree or a variant of a B-tree, it includes non-leaf nodes and leaf nodes, and all non-leaf nodes have children. In this embodiment, the "son" of a non-leaf node is called a child of a non-leaf node. Node, non-leaf node is the "parent node" of its son.
下面分别对B树、B+树进行简要的说明。The following is a brief description of the B-tree and the B+ tree.
1、二阶B树,即二叉搜索树:(1)所有非叶子结点至多拥有两个子结点(Left和Right);(2)各结点存储一个关键字;(3)非叶子结点的左指针指向小于其关键字的子结点,右指针指向大于其关键字的子结点。图1为本申请实施例提供的B树的一种结构示意图。参见图1,每个结点对应一个数据页,每个数据页被方形框框出;最下方的节点为叶子结点,其余的结点均为非叶子结点,非叶子结点最上方的节点为根结点。比如,结点101为结点102和结点103的父结点,结点102和结点103为结点101的子结点。结点101对应的数据页为结点102对应的数据页和结点103对应的数据页的父数据页,结点102对应的数据页和结点103对应的数据页为结点101对应的数据页的子数据页。1. Second-order B-tree, that is, binary search tree: (1) All non-leaf nodes have at most two child nodes (Left and Right); (2) Each node stores a keyword; (3) Non-leaf nodes The left pointer of a point points to a child node less than its key, and the right pointer points to a child node greater than its key. FIG. 1 is a schematic structural diagram of a B-tree according to an embodiment of the present application. Referring to Figure 1, each node corresponds to a data page, and each data page is framed by a square box; the bottom node is a leaf node, the rest of the nodes are non-leaf nodes, and the top node of non-leaf nodes is the root node. For example,
二阶B树的搜索,从根结点开始,如果查询的关键字与结点的关键字相等,那么就命中;否则,如果查询的关键字比结点关键字小,就进入左子结点;如果查询的关键字比结点关键字大,就进入右子结点;如果左子结点或右子结点的指针为空,则报告找不到相应的关键字。The search of the second-order B-tree starts from the root node. If the query keyword is equal to the node keyword, it will hit; otherwise, if the query keyword is smaller than the node keyword, it will enter the left child node. ; If the query keyword is larger than the node keyword, enter the right child node; if the pointer of the left child node or the right child node is empty, it will report that the corresponding keyword cannot be found.
2、多阶B树,是一种多路搜索树(并不是二叉的),对于M阶的B树:(1)任意非叶子结点最多只有M个子结点,且M>2;(2)根结点的子结点数为[2,M];(3)除根结点以外的非叶子结点的子结点数为[M/2,M];(4)每个结点存放至少M/2-1(取上整)和至多M-1个关键字;(至少2个关键字)(5)非叶子结点的关键字个数等于指向子结点的指针个数减1;(6)非叶子结点的关键字:K1,K2,…,KM-1,且Ki<Ki+1;即M阶B树中每个结点最多具有M-1个关键字;(7)非叶子结点的指针:P[1],P[2],…,P[M],其中,P[1]指向关键字小于K1的子树,P[M]指向关键字大于KM-1的子树,其它P[i]指向关键字属于(Ki-1,Ki)的子树(8)所有叶子结点位于同一层。在M=3时,多阶B树的一种结构示意图如图2所示。参见图2,每个结点对应一个数据页,每个数据页被方形框框出;最下方的节点为叶子结点,其余的结点均为非叶子结点,非叶子结点最上方的节点为根结点。比如:结点201为结点202、结点203和结点204的父结点,结点202、结点203和结点204为结点201的子结点。结点201对应的数据页为结点202对应的数据页、结点203对应的数据页和结点204的对应的数据页的父数据页,结点202对应的数据页、结点203对应的数据页和结点204对应的数据页为结点201对应的数据页的子数据页。2. Multi-order B-tree is a multi-way search tree (not binary). For M-order B-tree: (1) Any non-leaf node has at most M child nodes, and M>2; ( 2) The number of child nodes of the root node is [2, M]; (3) The number of child nodes of non-leaf nodes other than the root node is [M/2, M]; (4) Each node stores at least M/2-1 (rounded up) and at most M-1 keywords; (at least 2 keywords) (5) The number of keywords of non-leaf nodes is equal to the number of pointers to child nodes minus 1; (6) Keywords of non-leaf nodes: K 1 , K 2 ,...,K M-1 , and K i <K i+1 ; that is, each node in the M-order B-tree has at most M-1 keys Word; (7) Pointers of non-leaf nodes: P[1], P[2],...,P[M], where P[1] points to the subtree whose keyword is less than K 1 , and P[M] points to The subtree whose key is greater than K M-1 , other P[i] points to the subtree (8) whose key belongs to (K i-1 , K i ), and all leaf nodes are located at the same level. When M=3, a schematic diagram of a structure of a multi-order B-tree is shown in FIG. 2 . Referring to Figure 2, each node corresponds to a data page, and each data page is framed by a square frame; the bottom node is a leaf node, the rest of the nodes are non-leaf nodes, and the top node of non-leaf nodes is the root node. For example,
多阶B树的搜索,从根结点开始,对结点内的关键字(有序)序列进行二分查找,如果命中则结束,否则进入查询关键字所属范围的子结点;重复,直到所对应的子结点指针为空,或已经是叶子结点。The search of a multi-order B-tree starts from the root node, and performs a binary search on the (ordered) sequence of keywords in the node. If it hits, it ends, otherwise it enters the child node of the range to which the query keyword belongs; repeat until all The corresponding child node pointer is empty, or is already a leaf node.
下面以5阶B树的分裂为例,说明本申请实施例涉及的页分裂过程。The following takes the splitting of a fifth-order B-tree as an example to describe the page splitting process involved in the embodiment of the present application.
图3为本申请实施例提供的B树的一种页分裂过程示意图。FIG. 3 is a schematic diagram of a page splitting process of a B-tree according to an embodiment of the present application.
如图3中的A图所示,在空树中插入39(即插入关键字key为39的数据,插入“Y”在本申请实施例中的含义为插入关键字为Y的数据记录),此时根结点包括一个关键字,根结点也是叶子结点。参见图3中的B图,继续插入22,97和41,此时根结点包括4个关键字(即包括4条数据记录,每条数据记录对应一个关键字)。参见图3中的C图,继续插入53,插入53后超过了结点最大允许包括的关键字的数目4,以41为中心进行页分裂,分裂后如图3中的D图所示,其中,包括关键字为22和39的数据记录的数据页的标识与插入53之前包括39、22、41和97的数据记录的数据页的标识相同。As shown in Figure A in Figure 3, insert 39 in the empty tree (that is, insert data whose keyword key is 39, and insert "Y" in the embodiment of the present application to insert a data record whose keyword is Y), At this time, the root node includes a keyword, and the root node is also a leaf node. Referring to Figure B in Figure 3, continue to insert 22, 97 and 41, at this time the root node includes 4 keys (ie, includes 4 data records, each data record corresponds to a key). Referring to Figure C in Figure 3, continue to insert 53. After the insertion of 53, the maximum number of keywords allowed by the node exceeds 4, and the page is split with 41 as the center. After the split, as shown in Figure D in Figure 3, where, The identification of the data page including the data records with
依次插入13,21,40,同样会造成分裂,如图3中的E图所示,接着依次插入30、27、33、36、35、34、24、29,如图3中的F图所示。如图3中的G图所示所示,继续插入26,26所在的结点包括的关键字超过4个,需要以27为中心进行页分裂,并向父结点进位27,分裂后的结果如图3中的H图所示,其中包括关键字为24和26的页的标识与插入26之前包括24、26、29和30的数据记录的数据页的标识相同;进位后导致当前的根结点也需要进行页分裂,分裂的结果如图3中的I图所示,其中包括关键字为22和27的数据记录的数据页的标识与插入27之前包括22、33、36和41的数据记录的数据页的标识相同。Inserting 13, 21, 40 in sequence will also cause splitting, as shown in Figure E in Figure 3, and then insert 30, 27, 33, 36, 35, 34, 24, 29 in sequence, as shown in Figure F in Figure 3. Show. As shown in the G diagram in Figure 3, continue to insert 26. The node where 26 is located contains more than 4 keywords. It is necessary to split the page with 27 as the center, and carry 27 to the parent node. The result of the split As shown in the H diagram in Figure 3, the identification of the page including the
3、B+树:B+树是B树的变体,也是一种多路搜索树:其定义基本与B树相同,除了具有如下的几点区别:(1)非叶子结点的子结点指针与关键字的个数相同,非叶子结点子结点指针P[i]指向关键字属于[Ki,Ki+1]的子结点;(3)所有叶子结点增加一个链指针;(4)所有关键字都在叶子结点出现。此外,B+树还具有如下的特性:(1)所有关键字都出现在叶子结点的链表中(稠密索引),且链表中的关键字恰是有序的;(2)搜索时不可能在非叶子结点命中:这是因为非叶子结点相当于是叶子结点的索引(稀疏索引),叶子结点相当于是存储数据的数据层。3. B+ tree: B+ tree is a variant of B tree and a multi-way search tree: its definition is basically the same as that of B tree, except for the following differences: (1) Child node pointers of non-leaf nodes The same as the number of keywords, the non-leaf node child node pointer P[i] points to the child node whose keywords belong to [K i ,K i+1 ]; (3) All leaf nodes add a chain pointer; ( 4) All keywords appear in leaf nodes. In addition, the B+ tree also has the following characteristics: (1) all keywords appear in the linked list of leaf nodes (dense index), and the keywords in the linked list are just in order; (2) it is impossible to search in the Non-leaf node hit: This is because the non-leaf node is equivalent to the index (sparse index) of the leaf node, and the leaf node is equivalent to the data layer that stores data.
在本实施例中为了表述的方便,虽然B+树中的非叶子结点中未存储有数据,但是由于叶子结点中会出现所有的关键字,因此,本实施例中也认为B+树中的每个非叶子结点对应一个数据页,即每个结点对应一个数据页。In this embodiment, for the convenience of expression, although no data is stored in the non-leaf nodes in the B+ tree, since all keywords appear in the leaf nodes, in this embodiment, it is also considered that the non-leaf nodes in the B+ tree Each non-leaf node corresponds to a data page, that is, each node corresponds to a data page.
图4为本申请实施例提供的B+树的一种结构示意图,如图4所示。参见图4,最下方的节点为叶子结点,其余的结点均为非叶子结点,非叶子结点最上方的节点为根结点。比如:结点401为结点402、结点403和结点404的父结点,结点402、结点403和结点404为结点401的子结点。结点401对应的数据页为结点402对应的数据页、结点403对应的数据页和结点404的对应的数据页的父数据页,结点402对应的数据页、结点403对应的数据页和结点404对应的数据页为结点401对应的数据页的子数据页。FIG. 4 is a schematic structural diagram of a B+ tree provided by an embodiment of the present application, as shown in FIG. 4 . Referring to Figure 4, the bottom node is a leaf node, the rest of the nodes are non-leaf nodes, and the top node of the non-leaf nodes is the root node. For example,
图4中的B+树的关键字个数和子结点个数相同,为4阶的B+树。在另一种方式中,B+树的关键字个数比子结点个数小1。The B+ tree in FIG. 4 has the same number of keywords as the number of child nodes, and is a B+ tree of order 4. In another way, the number of keys of a B+ tree is one less than the number of child nodes.
下面以5阶B+树的分裂为例,说明本申请实施例涉及的页分裂过程。The following takes the splitting of a fifth-order B+ tree as an example to describe the page splitting process involved in the embodiments of the present application.
图5为本申请实施例提供的B+树的页分裂过程示意图。FIG. 5 is a schematic diagram of a page splitting process of a B+ tree provided by an embodiment of the present application.
如图5中的A图所示,在空树中插入5,此时根结点包括一个关键字,根结点也是叶子结点。参见图5中的B图,继续插入8,10和15,此时根结点包括4个关键字。参见图5中的C图,继续插入16,插入16后超过了结点最大允许包括的关键字的数目4,所以要进行页分裂。在叶子结点分裂时,分裂出来的左结点2个数据记录,右边3个数据记录,中间关键字成为索引结点中的关键字,分裂后如图5中的D图所示,其中,包括关键字为5和8的数据记录的数据页的标识与插入16之前包括5、8、10和15的数据记录的数据页的标识相同。As shown in Figure A in Figure 5, 5 is inserted into the empty tree. At this time, the root node includes a keyword, and the root node is also a leaf node. Referring to Figure B in Figure 5, continue to insert 8, 10 and 15, at this time the root node includes 4 keywords. Referring to Figure C in Figure 5, 16 is continued to be inserted. After 16 is inserted, the maximum number of keywords allowed by the node is 4, so page splitting is performed. When the leaf node is split, the split left node has 2 data records, the right 3 data records, and the middle keyword becomes the keyword in the index node. After splitting, as shown in Figure D in Figure 5, where, The identification of the data page including the data records with
如图5中的E图所示,接着插入17。如图5F所示,继续插入18,18所在的结点包括的关键字超过4个,需要进行页分裂,分裂出来的左结点2个数据记录,右结点3个数据记录,关键字16进位到父结点(索引类型)中,分裂后的结果如图5中的G图所示,其中包括关键字为10和15的数据记录的数据页的标识与插入18之前包括10、15、16和17的数据记录的数据页的标识相同。As shown in Figure E in Figure 5, 17 is then inserted. As shown in Figure 5F, continue to insert 18. The node where 18 is located contains more than 4 keywords, and page splitting is required. The split left node has 2 data records, the right node has 3 data records, and the
插入若干数据后,得到如图5中的H图所示的B+树。接着,如图5中的I图和图5中的J图所示,继续插入7,7所在的结点包括的关键字超过4个,需要进行页分裂,分裂出来的左结点2个数据记录,右结点3个数据记录,关键字7进位到父结点,其中包括关键字为5和6的数据记录的数据页的标识与插入7之前包括5、6、8和9的数据记录的数据页的标识相同;进位后导致当前的根结点也需要分裂,分裂的结果如图5中的K图所示,其中包括关键字为7和10的数据记录的数据页的标识与插入7之前包括10、16、18和20的数据记录的数据页的标识相同。After inserting some data, a B+ tree as shown in the H diagram in Figure 5 is obtained. Next, as shown in Figure I in Figure 5 and Figure J in Figure 5, continue to insert 7, the node where 7 is located contains more than 4 keywords, and page splitting needs to be performed, and the split left node 2 data record,
在对B树、B+树进行说明之后,接着对本申请涉及的系统架构进行说明。After the B-tree and the B+ tree are described, the system architecture involved in the present application will be described next.
图6为本申请实施例提供的系统架构图,参见图6,本实施例的系统架构包括计算层和分布式存储层,还可包括管理层。计算层可包括多个节点,多个节点中包括主计算节点和从计算节点,主计算节点用于读写数据,其它从计算节点可从分布式存储层读取数据。分布式存储层包括多个存储节点,用于存储数据。管理层包括一个或多个管理节点。FIG. 6 is a system architecture diagram provided by an embodiment of the present application. Referring to FIG. 6 , the system architecture of this embodiment includes a computing layer and a distributed storage layer, and may also include a management layer. The computing layer may include multiple nodes, and the multiple nodes include a master computing node and a slave computing node. The master computing node is used to read and write data, and other slave computing nodes can read data from the distributed storage layer. The distributed storage layer includes multiple storage nodes for storing data. The management layer includes one or more management nodes.
在上述系统架构中,数据不再被直接写入到主计算节点进行本地存储,也不再被直接写入到存储节点,而是主计算节点产生redo日志,并将redo日志传送到存储节点,存储节点将redo日志回放成数据。同时redo日志被传送至从计算节点,若有需要,从计算节点会将redo日志回放成数据,以使从计算节点缓存中的数据保持最新。其中,redo日志可用一个唯一的值来标识,这个值叫做日志序列号(log sequence number,简称LSN),先产生的日志的LSN小于后产生的日志的LSN。In the above system architecture, data is no longer directly written to the main computing node for local storage, nor directly written to the storage node, but the main computing node generates redo logs and transmits the redo logs to the storage nodes. The storage node replays the redo log into data. At the same time, the redo log is transmitted to the slave computing node. If necessary, the slave computing node will replay the redo log into data to keep the data in the slave computing node cache up-to-date. Among them, the redo log can be identified by a unique value, which is called the log sequence number (log sequence number, LSN for short). The LSN of the log generated first is smaller than the LSN of the log generated later.
即从计算节点和存储节点中以B树或B树的变体组织的数据页中的数据均是由redo日志回放后得到的,若数据1由redo日志1回放得到,则数据1和redo日志1对应。若数据页中包括的数据所对应的各redo日志中第一日志的LSN最大,则第一redo日志的LSN为该数据页的LSN。相应地,若触发上述页分裂过程的数据记录所对应的各redo日志中第二日志的LSN最大,则第二redo日志即为触发上述页分裂过程的redo日志。That is, the data in the data pages organized by B-tree or B-tree variants from the computing node and the storage node are all obtained by the redo log playback. If the
如上所述,存储节点和从计算节点各自独立回放redo日志来生成数据,所以有可能在某段时间相同的数据页的更新进度不一致,比如从计算节点需要读取某一父数据页的子数据页,而由于存储节点和从计算节点数据页的更新进度不一致,可能存在如下的情况:仅在存储节点或从计算节点中发生了与子数据页相关的页分裂,这样从计算节点从存储节点读取到的子数据页可能与从计算节点中的父数据页不匹配,即从计算节点可能读取到错误的数据。比如从计算节点和存储节点均是以5阶B树的形式组织数据或者数据页,如图7中的(a)图所示,从计算节点中存储有数据页601,但是未存储有数据页601的子数据页,子数据页存储在存储节点中,从计算节点需要读取数据页601的子数据页。若存储节点中的B树为图7中的(b)图所示,此时存储节点中存储的数据页601的子数据页与从计算节点存储的数据页601相匹配。但是,若存储节点的回放速度快于从计算节点的回放速度,如图7中的(c)~(e)图所示,由于26的插入,存储节点中发生了页分裂,最终存储节点中的B树如图7中的(e)图所示,此时,从计算节点无法从存储节点读取到与从计算节点中的父数据页601相匹配的子数据页,因为存储节点中的B树已经不再存在如601所示的数据页。As mentioned above, the storage node and the slave computing node play back the redo log independently to generate data, so it is possible that the update progress of the same data page is inconsistent at a certain period of time. For example, the slave computing node needs to read the child data of a parent data page. page, and due to the inconsistent update progress of data pages between the storage node and the slave computing node, there may be the following situations: a page split related to child data pages occurs only in the storage node or slave computing node, so that the slave computing node and the storage node are split. The read child data page may not match the parent data page in the slave compute node, that is, the slave compute node may read incorrect data. For example, both the slave computing node and the storage node organize data or data pages in the form of a 5th-order B-tree. As shown in (a) in Figure 7, the slave computing node
为了解决上述技术问题,提出了本实施例中的数据获取方法。下面采用具体的实施例对本申请的数据获取方法进行说明。In order to solve the above technical problems, the data acquisition method in this embodiment is proposed. The data acquisition method of the present application will be described below using specific embodiments.
首先采用具体的实施例对存储节点中存储有分裂信息,从计算节点和/或管理节点中存储有全量分裂信息所对应的数据读取方法进行说明。First, a specific embodiment is used to describe the data reading method corresponding to the split information stored in the storage node and the full amount of split information stored in the computing node and/or the management node.
图8为本申请实施例提供的数据获取方法的流程图一。参见图8,本实施例的方法包括:FIG. 8 is a
步骤S801、从计算节点确定待读取数据页的标识为第一标识,待读取数据页为从计算节点中的第一父数据页的子数据页。Step S801 , the slave computing node determines that the identifier of the data page to be read is the first identifier, and the data page to be read is the child data page of the first parent data page in the slave computing node.
从计算节点中存储有第一父数据页,在需要读取第一父数据页的子数据页,确定该子数据页的标识为第一标识。The first parent data page is stored in the computing node, and when the child data page of the first parent data page needs to be read, the identifier of the child data page is determined as the first identifier.
步骤S802、从计算节点向存储节点发送数据页读取请求,数据页读取请求包括第一标识。Step S802: Send a data page read request from the computing node to the storage node, where the data page read request includes the first identifier.
从计算节点确定其缓存中是否包括标识为第一标识的该子数据页,若包括,则从缓存中获取该子数据页,并应用该子数据页。其中,应用该子数据页比如可为发送至终端设备以显示该子数据页所对应的数据。Determine from the computing node whether the sub-data page identified as the first identification is included in its cache, and if so, obtain the sub-data page from the cache and apply the sub-data page. Wherein, the application of the sub-data page may be, for example, sent to a terminal device to display the data corresponding to the sub-data page.
若计算节点确定其缓存中不包括该子数据页,则向存储节点发送数据页读取请求,其中,数据页读取请求指示包括第一标识。在一种方式中,数据页读取请求中还包括从计算节点中的第一父数据页的LSN(为了后续表述的方便,后续称第一父数据页的LSN为第三LSN)。If the computing node determines that the sub-data page is not included in its cache, it sends a data page read request to the storage node, wherein the data page read request indication includes the first identifier. In one manner, the data page read request further includes the LSN of the first parent data page in the slave computing node (for convenience of subsequent descriptions, the LSN of the first parent data page is hereinafter referred to as the third LSN).
步骤S803、存储节点确定在存储节点中标识为第一标识的第一数据页对应有页分裂过程。Step S803, the storage node determines that the first data page identified as the first identifier in the storage node corresponds to a page splitting process.
存储节点接收来自从计算节点的数据页读取请求,确定在存储节点中标识为第一标识的第一数据页是否对应有页分裂过程,若否,则存储节点发送存储的标识为第一标识的第一数据页至从计算节点;若是,则执行步骤S804。The storage node receives the data page read request from the computing node, and determines whether the first data page marked as the first identifier in the storage node corresponds to a page splitting process, if not, the storage node sends the stored identifier as the first identifier. to the slave computing node; if yes, execute step S804.
在一种方式中:存储节点确定在存储节点中标识为第一标识的第一数据页是否对应有页分裂过程,包括:存储节点根据分裂信息,确定在存储节点中标识为第一标识的第一数据页是否对应有页分裂过程。其中,分裂信息包括页分裂过程所对应的分裂数据页的标识以及触发页分裂过程的redo日志的LSN;还可包括分裂数据页的父数据页的标识。In one way, the storage node determines whether the first data page identified as the first identifier in the storage node corresponds to a page splitting process, including: the storage node determines, according to the split information, the first data page identified as the first identifier in the storage node. Whether a data page corresponds to a page splitting process. The split information includes the identifier of the split data page corresponding to the page split process and the LSN of the redo log that triggers the page split process; and may also include the identifier of the parent data page of the split data page.
表1为分裂信息中包括的至少部分内容。Table 1 shows at least part of the content included in the split information.
表1Table 1
参见表1,页分裂过程为原数据页C分裂成新数据页C和新数据页D,原数据页C分裂成新数据页C的标识相同,新数据页C和新数据页D的父数据页为P,触发此次页分裂过程的日志的LSN为24。如图3中的D图和E图中所示,插入13、21、40(假设40是该3个关键字中最后一个插入的)后,包括关键字22、39、13和21的数据记录的数据页分裂成包括关键字13和21的数据记录的数据页以及包括关键字39和40的数据记录的数据页,包括关键字22和41的数据记录的数据页为分裂后的两个数据页的父数据页。Referring to Table 1, the page splitting process is that the original data page C is split into a new data page C and a new data page D, the original data page C is split into a new data page C with the same identifier, and the parent data of the new data page C and the new data page D The page is P, and the LSN of the log that triggers this page splitting process is 24. As shown in Figure D and Figure E in Figure 3, after inserting 13, 21, 40 (assuming 40 is the last one of the 3 keywords inserted), data
也就是说,对于一次页分裂过程,分裂信息中可包括该页分裂过程所对应的分裂数据页的标识以及触发该页分裂过程的日志的LSN,其中,该页分裂过程所对应的分裂数据页的标识可包括该页分裂过程涉及的两个数据页(如上的C和D)的标识。此外,分裂信息中还可包括该两个数据页的父数据页的标识。That is, for a page splitting process, the splitting information may include the identifier of the split data page corresponding to the page splitting process and the LSN of the log that triggers the page splitting process, wherein the split data page corresponding to the page splitting process The identification of can include the identification of the two data pages (C and D above) involved in the page splitting process. In addition, the split information may further include the identifiers of the parent data pages of the two data pages.
如果某个数据页在发生分裂之后又再次发生页分裂过程,那么分裂信息中还包括该再次发生的页分裂过程对应的分裂数据页的标识以及触发该再次发生的页分裂过程的日志的LSN,相应地分裂信息中的至少部分内容可如表2所示:If a page splitting process occurs again after a data page is split, the split information also includes the identifier of the split data page corresponding to the page splitting process that occurs again and the LSN of the log that triggers the page splitting process that occurs again. Correspondingly, at least part of the content of the split information can be shown in Table 2:
表2Table 2
参见表2,页分裂过程为原数据页C分裂成新数据页C和新数据页D,原数据页C与分裂成的新数据页C的标识相同,新数据页C和新数据页D的父数据页为P,触发此次页分裂过程的日志的LSN为24。新数据页C又分裂成更新的数据页C和新数据页D2,更新的数据页C与新数据页C的标识相同,更新的数据页C和新数据页D2的父数据页为P,触发此次页分裂过程的日志的LSN为24。Referring to Table 2, the page splitting process is that the original data page C is split into a new data page C and a new data page D. The original data page C has the same identifier as the split new data page C, and the new data page C and the new data page D have the same identifier. The parent data page is P, and the LSN of the log that triggers the page splitting process is 24. The new data page C is split into an updated data page C and a new data page D 2 . The updated data page C has the same identifier as the new data page C, and the parent data page of the updated data page C and the new data page D 2 is P , the LSN of the log that triggers this page splitting process is 24.
如果一次页分裂过程导致其父数据页也发生了分裂,那么分裂信息中还包括父数据页的页分裂过程对应的分裂数据页的标识以及触发父数据页的页分裂过程的日志的LSN。如果每次页分裂都同时导致了父数据页的分裂,那么就会一致循环到根数据页,相应的分裂信息中的至少部分内容可如表3所示:If a page splitting process causes its parent data page to also split, the splitting information also includes an identifier of the split data page corresponding to the page splitting process of the parent data page and the LSN of the log that triggers the page splitting process of the parent data page. If each page split results in the split of the parent data page at the same time, then the root data page will be uniformly cycled, and at least part of the corresponding split information can be shown in Table 3:
表3table 3
因此,若存储节点确定分裂信息包括的分裂数据页的标识中存在第一标识,则确定第一数据页对应有页分裂过程。Therefore, if the storage node determines that the identifier of the split data page included in the split information has the first identifier, it is determined that the first data page corresponds to a page splitting process.
此外,分裂信息可分为部分分裂信息和全量分裂信息。In addition, the split information can be divided into partial split information and full split information.
全量分裂信息包括:所有页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的redo日志的LSN;还可包括各分裂数据页的父数据页的标识。全量分裂信息可存储在从计算节点和/或管理节点中,还可存储在存储节点中。The full split information includes: the identifiers of the split data pages corresponding to all the page split processes and the LSN of the redo log that triggers each page split process; and may also include the identifiers of the parent data pages of each split data page. The full amount of split information may be stored in the slave computing node and/or the management node, and may also be stored in the storage node.
全量分裂信息的至少部分内容可如表4所示:At least part of the full split information can be shown in Table 4:
表4Table 4
部分分裂信息可包括部分页分裂过程所对应的分裂数据页的标识以及触发部分页分裂过程的redo日志的LSN;还可包括分裂数据页的父数据页的标识。部分分裂信息可存储在存储节点中,相应地,存储节点中存储的部分分裂信息中包括的部分页分裂过程所对应的分裂数据页存储在该存储节点中,即部分分裂信息包括的分裂数据页的标识所指示的数据页存储在该存储节点中;或者说,存储节点中存储的部分分裂信息中包括的部分页分裂过程为存储在该存储节点的数据页中的至少部分数据页的页分裂过程。The partial split information may include the identifier of the split data page corresponding to the partial page split process and the LSN of the redo log that triggers the partial page split process; and may also include the identifier of the parent data page of the split data page. The partial split information may be stored in the storage node. Accordingly, the split data pages corresponding to the partial page split process included in the partial split information stored in the storage node are stored in the storage node, that is, the split data pages included in the partial split information. The data page indicated by the identifier is stored in the storage node; in other words, the partial page splitting process included in the partial splitting information stored in the storage node is the page splitting of at least part of the data pages stored in the data pages of the storage node process.
存储节点中可存储全量分裂信息,还可存储部分分裂信息。在存储节点中存储的是部分分裂信息时,可以节省存储节点的存储空间,还可以提高确定第一数据页是否对应有页分裂过程的效率。The storage node can store the full amount of split information, and can also store part of the split information. When the partial split information is stored in the storage node, the storage space of the storage node can be saved, and the efficiency of determining whether the first data page corresponds to a page splitting process can be improved.
在全量分裂信息的至少部分内容如表4所示时,部分分裂信息可如表5和表6所示:When at least part of the full split information is shown in Table 4, the partial split information may be as shown in Table 5 and Table 6:
表5table 5
表6Table 6
步骤S804、存储节点根据第一数据页对应的页分裂过程的发生时机,向从计算节点发送目标数据页,目标数据页为存储节点中的第一数据页或者第二数据页。Step S804: The storage node sends a target data page to the slave computing node according to the occurrence timing of the page splitting process corresponding to the first data page, where the target data page is the first data page or the second data page in the storage node.
其中,存储节点在根据第一数据页对应的页分裂过程的发生时机,向从计算节点发送目标数据页之前,还包括:存储节点确定第一数据页对应的页分裂过程的发生时机。Wherein, before the storage node sends the target data page to the slave computing node according to the occurrence timing of the page splitting process corresponding to the first data page, the storage node further includes: determining the occurrence timing of the page splitting process corresponding to the first data page.
在一种方案中,存储节点确定第一数据页对应的页分裂过程的发生时机,包括:根据触发该页分裂过程的日志的第一LSN、存储节点中标识为第一标识的数据页的第二LSN以及从计算节点中的第一父数据页的第三LSN,确定第一数据页对应的页分裂过程的发生时机。In one solution, the storage node determines the occurrence timing of the page splitting process corresponding to the first data page, including: according to the first LSN of the log that triggers the page splitting process, the first LSN of the data page marked as the first identifier in the storage node The second LSN and the third LSN of the first parent data page in the computing node determine the occurrence timing of the page splitting process corresponding to the first data page.
其中,若第三LSN小于第一LSN且第一LSN小于或等于第二LSN,则确定第一数据页对应的页分裂过程发生在存储节点得到第一父数据页之后。若第一LSN小于第二LSN且第一LSN小于第三LSN,则确定第一数据页对应的页分裂过程发生在从存储节点得到第一父数据页之前。若第二LSN小于第一LSN且第一LSN小于或等于第三LSN,则确定存储节点的数据回放速度慢于计算节点的数据回放速度,在存储节点中第一数据页对应的页分裂过程待发生(即将发生)。Wherein, if the third LSN is smaller than the first LSN and the first LSN is smaller than or equal to the second LSN, it is determined that the page splitting process corresponding to the first data page occurs after the storage node obtains the first parent data page. If the first LSN is smaller than the second LSN and the first LSN is smaller than the third LSN, it is determined that the page splitting process corresponding to the first data page occurs before the first parent data page is obtained from the storage node. If the second LSN is smaller than the first LSN and the first LSN is smaller than or equal to the third LSN, it is determined that the data playback speed of the storage node is slower than the data playback speed of the computing node, and the page splitting process corresponding to the first data page in the storage node is to be happens (is about to happen).
可以理解的是,若第一数据页对应的页分裂过程发生在存储节点得到第一父数据页之前,则说明在从存储节点得到第一父数据页之后,存储节点中第一数据页并没有对应页分裂过程,即存储节点中的标识为第一标识的第一数据页是与第一父数据页匹配的子数据页,存储节点直接向从计算节点发送标识为第一标识的数据页,能够使得从计算节点得到正确的数据。即此时目标数据页为存储节点中标识为第一标识的数据页。It can be understood that if the page splitting process corresponding to the first data page occurs before the storage node obtains the first parent data page, it means that after obtaining the first parent data page from the storage node, the first data page in the storage node does not The corresponding page splitting process, that is, the first data page marked as the first identifier in the storage node is a child data page that matches the first parent data page, and the storage node directly sends the data page marked as the first identifier to the slave computing node, It is possible to obtain correct data from the computing nodes. That is, at this time, the target data page is the data page identified as the first identification in the storage node.
若第一数据页对应的页分裂过程的发生时机包括:存储节点的数据回放速度慢于从计算节点的数据回放速度,在存储节点中第一数据页对应的页分裂过程待发生,则在确定存储节点对第一LSN的日志回放完毕后,向从计算节点发送标识为第一标识的数据页。此时目标数据页为存储节点中标识为第一标识的数据页。If the occurrence timing of the page splitting process corresponding to the first data page includes: the data playback speed of the storage node is slower than the data playback speed of the slave computing node, and the page splitting process corresponding to the first data page is about to occur in the storage node, then determine After the storage node finishes replaying the log of the first LSN, it sends the data page identified as the first identification to the slave computing node. At this time, the target data page is the data page identified as the first identification in the storage node.
其中,由于第一LSN的日志为触发第一数据页对应的页分裂过程的日志,因此存储节点对第一LSN的日志回放完毕后,第一数据页对应的页分裂过程也进行完毕,此时,向从计算节点发送标识为第一标识的数据页,从计算节点可以得到与第一父数据页匹配的子数据页,也就是能够得到正确的数据。Among them, since the log of the first LSN is the log that triggers the page splitting process corresponding to the first data page, after the storage node finishes replaying the log of the first LSN, the page splitting process corresponding to the first data page is also completed. , sending the data page identified as the first identifier to the slave computing node, and the slave computing node can obtain the child data page matching the first parent data page, that is, the correct data can be obtained.
若第一数据页对应的页分裂过程的发生在存储节点得到第一父数据页之后,则在存储节点根据第一数据页对应的页分裂过程的发生时机,向从计算节点发送目标数据页之前,还包括如下的步骤S805~步骤S808:If the page splitting process corresponding to the first data page occurs after the storage node obtains the first parent data page, before the storage node sends the target data page to the slave computing node according to the occurrence timing of the page splitting process corresponding to the first data page , and also includes the following steps S805 to S808:
步骤S805、存储节点向从计算节点发送第一信息。Step S805, the storage node sends the first information to the slave computing node.
其中,第一信息可包括:触发第一数据页对应的页分裂过程的日志的第一LSN和指示信息,指示信息指示第一数据页对应的页分裂过程发生在存储节点得到第一父数据页之后。The first information may include: the first LSN of the log that triggers the page splitting process corresponding to the first data page and indication information, where the indication information indicates that the page splitting process corresponding to the first data page occurs when the storage node obtains the first parent data page after.
步骤S806、从计算节点根据第一信息,确定目标数据页。Step S806, the slave computing node determines the target data page according to the first information.
一种方案中:从计算节点根据第一信息,确定目标数据页,包括如下的a1~a3:In one solution, the slave computing node determines the target data page according to the first information, including the following a1 to a3:
a1、从计算节点根据第一信息,确定在存储节点中第一父数据页未对应有页分裂过程。a1. According to the first information, the slave computing node determines that there is no page splitting process corresponding to the first parent data page in the storage node.
若从计算节点中存储有全量分裂信息,则根据第一信息,确定在存储节点中第一父数据页未对应有页分裂过程,包括:根据指示信息的指示,判断全量分裂信息包括的分裂数据页的标识中是否存在第二标识且触发相应的页分裂过程的LSN为上述的第一LSN,第二标识为第一父数据页的标识,得到的判断结果为否。If the full amount of split information is stored from the computing node, determining, according to the first information, that the first parent data page in the storage node does not correspond to a page split process, including: according to the indication of the indication information, judging the split data included in the full amount of split information Whether there is a second identifier in the identifier of the page and the LSN that triggers the corresponding page splitting process is the above-mentioned first LSN, the second identifier is the identifier of the first parent data page, and the obtained judgment result is no.
若从计算节点中未存储有全量分裂信息,管理节点中存储有全量分裂信息,则从计算节点根据第一信息,确定在存储节点中第一父数据页未对应有页分裂过程,包括:从计算节点根据指示信息的指示,向管理节点发送查询请求,查询请求包括第一父数据页的第二标识和上述的第一LSN,查询请求指示管理节点根据全量分裂信息确定第一父数据页是否对应有页分裂过程;从计算节点接收来自管理节点的查询结果,查询结果指示第一父数据页未对应有页分裂过程。其中,管理节点接收到查询请求后,判断全量分裂信息包括的分裂数据页的标识中是否存在第二标识且触发相应的页分裂过程的LSN为上述的第一LSN,得到的判断结果为否。If the full amount of split information is not stored in the slave computing node and the full amount of split information is stored in the management node, the slave computing node determines, according to the first information, that the first parent data page in the storage node does not correspond to a page split process, including: The computing node sends a query request to the management node according to the instruction of the instruction information, the query request includes the second identifier of the first parent data page and the above-mentioned first LSN, and the query request instructs the management node to determine whether the first parent data page is based on the full split information. There is a page splitting process; the query result from the management node is received from the computing node, and the query result indicates that the first parent data page does not correspond to a page splitting process. After receiving the query request, the management node determines whether there is a second identifier in the identifiers of the split data pages included in the full split information and the LSN that triggers the corresponding page splitting process is the above-mentioned first LSN, and the obtained determination result is no.
a2、从计算节点从存储节点读取第二父数据页。第二父数据页为第一数据页对应的页分裂过程发生后被更新的第一父数据页,也就是存储节点中标识为第二标识第二父数据页,第二标识为第一父数据页的标识。可以理解的是,第二父数据页的标识也为第二标识。a2. Read the second parent data page from the storage node from the computing node. The second parent data page is the first parent data page that is updated after the page splitting process corresponding to the first data page occurs, that is, the second parent data page marked as the second identifier in the storage node, and the second identifier is the first parent data page The ID of the page. It can be understood that the identifier of the second parent data page is also the second identifier.
虽然存储节点中第一父数据页未对应有页分裂过程,但是在从存储节点得到第一父数据页之后存储节点中的第一数据页对应有页分裂过程,存储节点中在该第一数据页对应的页分裂过程未发生之前,标识为第一标识的数据页对应的父数据页为第一父数据页,在该第一数据页对应的页分裂过程发生之后,第一父数据页会更新为第二父据页,因此,计算节点需从存储节点读取第二父数据页,第二父数据页的标识和第一父数据页的标识相同。例如图5中的F图到G图中所示,插入18后,包括关键字10、15、16、17的数据记录的数据页分裂成包括关键字10和15的数据记录的数据页以及包括关键字10、16、17的数据记录的数据页,父数据页由包括关键字10的数据记录的数据页更新为包括关键字10和16的数据记录的数据页。Although there is no page splitting process corresponding to the first parent data page in the storage node, the first data page in the storage node corresponds to a page splitting process after the first parent data page is obtained from the storage node. Before the page splitting process corresponding to the page occurs, the parent data page corresponding to the data page identified as the first identifier is the first parent data page. After the page splitting process corresponding to the first data page occurs, the first parent data page will be The second parent data page is updated. Therefore, the computing node needs to read the second parent data page from the storage node, and the identifier of the second parent data page is the same as the identifier of the first parent data page. For example, as shown in Figures F to G in FIG. 5, after inserting 18, the data pages of the data records including the
其中,从计算节点从存储节点读取第二父数据页,包括:从计算节点向存储节点发送数据读取请求,该数据读取请求中包括第一父数据页的标识(即上述的第二标识),从计算节点接收来自存储节点的第二父数据页。Wherein, reading the second parent data page from the storage node from the computing node includes: sending a data read request from the computing node to the storage node, where the data read request includes the identifier of the first parent data page (that is, the above-mentioned second parent data page). identification), receiving the second parent data page from the storage node from the compute node.
a3、从计算节点根据第二父数据页确定目标数据页。a3. The slave computing node determines the target data page according to the second parent data page.
从计算节点根据第二父数据页确定的目标数据页可能为存储节点中标识为第一标识的第一数据页,也可能存储节点为不同于第一数据页的第二数据页。The target data page determined from the computing node according to the second parent data page may be the first data page identified as the first identifier in the storage node, or the storage node may be the second data page different from the first data page.
可按照目前的B树或B树的变体的搜索方法,根据第二父数据页确定目标数据页,此处不再赘述。The target data page may be determined according to the second parent data page according to the current search method of the B-tree or a variant of the B-tree, which will not be repeated here.
另一种方案中:从计算节点根据第一信息,确定目标数据页,包括如下的b1~b3:In another solution, the slave computing node determines the target data page according to the first information, including the following b1-b3:
b1、从计算节点根据第一信息,确定在存储节点中第一父数据页对应有页分裂过程。b1. According to the first information, the slave computing node determines that there is a page splitting process corresponding to the first parent data page in the storage node.
其中,第一数据页对应有页分裂过程,第一父数据页也对应有页分裂过程的一种示意图可如图3中的G图到I图所示,或者,图5中的I图到K图所示。Wherein, the first data page corresponds to a page splitting process, and the first parent data page also corresponds to a page splitting process. A schematic diagram shown in Figure G to Figure I in FIG. 3 , or, Figure I to Figure 5 in FIG. 5 K is shown in Fig.
若从计算节点中存储有全量分裂信息,则根据第一信息,确定在存储节点中第一父数据页对应有页分裂过程,包括:根据指示信息的指示,判断全量分裂信息包括的分裂数据页的标识中是否存在第二标识且触发相应的页分裂过程的LSN为上述的第一LSN,第二标识为第一父数据页的标识,得到的判断结果为是。If the full amount of split information is stored in the computing node, then according to the first information, it is determined that the first parent data page in the storage node corresponds to a page split process, including: according to the indication of the indication information, judging the split data pages included in the full amount of split information Whether there is a second identifier in the identifier of , and the LSN that triggers the corresponding page splitting process is the above-mentioned first LSN, and the second identifier is the identifier of the first parent data page, and the obtained judgment result is yes.
若从计算节点中未存储有全量分裂信息,管理节点中存储有全量分裂信息,则从计算节点根据第一信息,确定在存储节点中第一父数据页对应有页分裂过程,包括:从计算节点根据指示信息的指示,向管理节点发送查询请求,查询请求包括第一父数据页的第二标识和上述的第一LSN,查询请求指示管理节点根据全量分裂信息确定第一父数据页是否对应有页分裂过程;从计算节点接收来自管理节点的查询结果,查询结果指示第一父数据页对应有页分裂过程。其中,管理节点接收到查询请求后,判断全量分裂信息包括的分裂数据页的标识中是否存在第二标识且触发相应的页分裂过程的LSN为上述的第一LSN,得到的判断结果为是。If the full amount of splitting information is not stored in the slave computing node and the full amount of splitting information is stored in the management node, the slave computing node determines, according to the first information, that there is a page splitting process corresponding to the first parent data page in the storage node, including: The node sends a query request to the management node according to the instruction of the instruction information, the query request includes the second identifier of the first parent data page and the above-mentioned first LSN, and the query request instructs the management node to determine whether the first parent data page corresponds to the first parent data page according to the full split information There is a page splitting process; the query result from the management node is received from the computing node, and the query result indicates that the first parent data page corresponds to a page splitting process. After receiving the query request, the management node determines whether there is a second identifier in the identifiers of the split data pages included in the full split information and the LSN that triggers the corresponding page splitting process is the above-mentioned first LSN, and the obtained determination result is yes.
可以理解的是,第一父数据页对应有页分裂过程,则第一父数据页分裂成第二父数据页和第三父数据页,第二父数据页的标识和第一父数据页的标识相同,第二父数据页为第一数据页分裂后的数据页的父数据页。若在第一父数据页分裂前第一父数据页为根数据页,则在第一父数据页分裂后会生成新的根父数据页,新的根父数据页为第二父数据页和第三父数据页的父数据页。若在第一父数据页分裂前第一父数据页不为根数据页,则第二父数据页和第三父数据页的父数据页至少会发生更新,还有可能发生页分裂过程。It can be understood that the first parent data page corresponds to a page splitting process, then the first parent data page is split into a second parent data page and a third parent data page, and the identifier of the second parent data page is the same as the first parent data page. The identifiers are the same, and the second parent data page is the parent data page of the data page after the first data page is split. If the first parent data page is the root data page before the first parent data page is split, a new root parent data page will be generated after the first parent data page is split, and the new root parent data page is the second parent data page and The parent data page of the third parent data page. If the first parent data page is not the root data page before the first parent data page is split, at least the parent data pages of the second parent data page and the third parent data page will be updated, and a page splitting process may also occur.
b2、从计算节点从存储节点读取第二父数据页至目标父数据页的各数据页,其中,目标父数据页未对应有页分裂过程且位于根数据页和第二父数据页之间或者目标父数据页为根数据页,第二父数据页为第一父数据页分裂后的数据页且第二父数据页为第一数据页的父数据页。b2. Read each data page from the second parent data page to the target parent data page from the computing node from the storage node, wherein the target parent data page does not correspond to a page splitting process and is located between the root data page and the second parent data page Or the target parent data page is a root data page, the second parent data page is a split data page of the first parent data page, and the second parent data page is a parent data page of the first data page.
具体地,在从计算节点确定在存储节点中第一父数据页对应有页分裂过程之后,继续确定第一父数据页分裂成的第二父数据页的父数据页(后续称为第四父数据页)是否发生页分裂(参照确定第一父数据页是否对应有页分裂过程的方法),若第四父数据页未对应有页分裂过程,则获取第二父数据页和第四父数据页(此时第四父数据页为目标父数据页),若第四父数据页对应有页分裂过程,则继续确定第四父数据页的父数据页(后续称为第五父数据页)是否发生页分裂;重复上述过程,直至确定目标父数据页未对应有页分裂过程。可以理解的是,存在目标父数据页为根结点对应的根数据页的情况。Specifically, after determining from the computing node that there is a page splitting process corresponding to the first parent data page in the storage node, continue to determine the parent data page of the second parent data page split from the first parent data page (hereinafter referred to as the fourth parent data page). data page) whether page splitting occurs (refer to the method for determining whether the first parent data page corresponds to a page splitting process), if the fourth parent data page does not correspond to a page splitting process, obtain the second parent data page and the fourth parent data page Page (the fourth parent data page is the target parent data page at this time), if the fourth parent data page corresponds to a page splitting process, continue to determine the parent data page of the fourth parent data page (hereinafter referred to as the fifth parent data page) Whether page splitting occurs; repeat the above process until it is determined that the target parent data page does not correspond to a page splitting process. It can be understood that there is a situation in which the target parent data page is the root data page corresponding to the root node.
b3、从计算节点根据第二父数据页至目标父数据页的各数据页,确定目标数据页。b3. The computing node determines the target data page according to each data page from the second parent data page to the target parent data page.
同样的,从计算节点根据第二父数据页确定的目标数据页可能为存储节点中标识为第一标识的第一数据页,也可能存储节点为不同于第一数据页的第二数据页。Similarly, the target data page determined from the computing node according to the second parent data page may be the first data page identified as the first identifier in the storage node, or the storage node may be the second data page different from the first data page.
可按照目前的B树或B树的变体的搜索方法,根据第二父数据页至目标父数据页的各数据页,确定目标数据页,此处不再赘述。The target data page can be determined according to each data page from the second parent data page to the target parent data page according to the current search method of the B-tree or a variant of the B-tree, which will not be repeated here.
步骤S807、从计算节点向存储节点发送目标数据页的读取请求。Step S807: Send a read request of the target data page from the computing node to the storage node.
其中,目标数据页的读取请求可包括目标数据页的标识。Wherein, the read request of the target data page may include the identifier of the target data page.
步骤S808、存储节点根据读取目标数据页的请求,获取目标数据页。Step S808, the storage node acquires the target data page according to the request for reading the target data page.
存储节点根据目标数据页的标识,获取目标数据页。The storage node obtains the target data page according to the identifier of the target data page.
存储节点获取目标数据页后,向从计算节点发送目标数据页,从计算节点接收目标数据页,该目标数据页与从计算节点获取到的第二父数据页相匹配或者第二父数据页至目标父数据页的各数据页相匹配,从计算机节点可以获取到正确的数据。After the storage node obtains the target data page, it sends the target data page to the slave computing node, and receives the target data page from the computing node. The target data page matches the second parent data page obtained from the computing node or the second parent data page to Each data page of the target parent data page matches, and correct data can be obtained from the computer node.
本实施例中,在从计算节点需要读取某一数据页的子数据页时,可根据分裂信息确定该子数据页是否对应有页分裂过程,以在该子数据页对应有页分裂过程的情况下,根据页分裂过程的发生时机,确定正确的读取数据页,以使从计算节点中的父数据页和子数据页相互匹配,即从计算节点能够读取到正确的数据。In this embodiment, when the sub-data page of a certain data page needs to be read from the computing node, it can be determined whether the sub-data page corresponds to a page-splitting process according to the split information, so that the sub-data page corresponds to a page-splitting process. In this case, the correct read data page is determined according to the occurrence timing of the page splitting process, so that the parent data page and the child data page in the slave computing node match each other, that is, the slave computing node can read correct data.
其次,采用具体的实施例对存储节点中未存储有分裂信息,从计算节点和/或管理节点中存储有全量分裂信息所对应的数据读取方法进行说明。Next, a specific embodiment is used to describe a data reading method corresponding to no split information stored in the storage node but full amount of split information stored in the computing node and/or the management node.
图9为本申请实施例提供的数据读取方法的流程图二,参见图9,本实施例的方法,包括:FIG. 9 is a second flowchart of a data reading method provided by an embodiment of the present application. Referring to FIG. 9 , the method of this embodiment includes:
步骤S901、从计算节点确定待读取数据页的标识为第一标识,待读取数据页为从计算节点中的第一父数据页的子数据页。Step S901, the slave computing node determines that the identifier of the data page to be read is the first identifier, and the data page to be read is the child data page of the first parent data page in the slave computing node.
从计算节点中存储有第一父数据页,在需要读取第一父数据页的子数据页,确定该子数据页的标识为第一标识。从计算节点确定其缓存中是否包括标识为第一标识的该子数据页,若包括,则从缓存中获取该子数据页,并应用该子数据页。其中,应用该子数据页比如可为发送至终端设备以显示该子数据页所对应的数据。若从计算节点确定其缓存中不包括标识为第一标识的该子数据页,则从计算节点确定从存储节点中读取该子数据页。The first parent data page is stored in the computing node, and when the child data page of the first parent data page needs to be read, the identifier of the child data page is determined as the first identifier. Determine from the computing node whether the sub-data page identified as the first identification is included in its cache, and if so, obtain the sub-data page from the cache and apply the sub-data page. Wherein, the application of the sub-data page may be, for example, sent to a terminal device to display the data corresponding to the sub-data page. If it is determined from the computing node that the sub-data page identified as the first identifier is not included in its cache, the computing node determines to read the sub-data page from the storage node.
步骤S902、从计算节点确定在存储节点中标识为第一标识的第一数据页对应有页分裂过程。Step S902: Determine from the computing node that the first data page identified as the first identifier in the storage node corresponds to a page splitting process.
在一种方式中,从计算节点中存储有全量分裂信息。相应地,从计算节点确定在存储节点中第一数据页对应有页分裂过程,包括:确定全量分裂信息包括的分裂数据页的标识中存在第一标识。In one approach, the full amount of split information is stored from the computing node. Correspondingly, determining from the computing node that there is a page splitting process corresponding to the first data page in the storage node includes: determining that the identifier of the split data page included in the full amount of splitting information has the first identifier.
该种方式可以提高数据读取效率,减少网络开销。This method can improve data reading efficiency and reduce network overhead.
在另一种方式中,从计算节点中未存储有全量分裂信息,管理节点中存储有全量分裂信息。相应地,从计算节点确定第一数据页对应有页分裂过程,包括:从计算节点向管理节点发送查询请求,查询请求包括第一标识,查询请求指示管理节点根据全量分裂信息确定第一数据页是否对应有页分裂过程;从计算节点接收来自管理节点的查询结果,查询结果指示第一数据页对应有页分裂过程。其中,管理节点接收到查询请求后,确定全量分裂信息包括的分裂数据页的标识中是否存在第一标识,得到的确定结果为是。In another way, the slave computing node does not store the full amount of split information, and the management node stores the full amount of split information. Correspondingly, determining from the computing node that the first data page corresponds to a page splitting process includes: sending a query request from the computing node to the management node, where the query request includes a first identifier, and the query request instructs the management node to determine the first data page according to the full amount of split information. Whether there is a page splitting process; the query result from the management node is received from the computing node, and the query result indicates that the first data page corresponds to a page splitting process. Wherein, after receiving the query request, the management node determines whether there is a first identifier in the identifiers of the split data pages included in the full split information, and the obtained determination result is yes.
该种方式可以节省从计算节点的存储空间。This method can save the storage space of the slave computing nodes.
步骤S903、从计算节点根据第一数据页对应的页分裂过程的发生时机,确定目标数据页。Step S903, the slave computing node determines the target data page according to the occurrence timing of the page splitting process corresponding to the first data page.
其中,从计算节点确定第一数据页对应的页分裂过程的发生时机的具体实现参照图8所示的实施例中的存储节点确定根据第一数据页对应的页分裂过程的发生时机的具体实现。The specific implementation of determining the occurrence timing of the page splitting process corresponding to the first data page from the computing node refers to the specific implementation of determining the occurrence timing of the page splitting process corresponding to the first data page by the storage node in the embodiment shown in FIG. 8 .
若第一数据页对应的页分裂过程发生在存储节点得到第一父数据页之后,在一种方式中,则从计算节点确定目标数据页,包括:从计算节点确定在存储节点中第一父数据页未对应有页分裂过程;从存储节点读取第二父数据页,第二父数据页为第一数据页对应的页分裂过程发生之后被更新的第一父数据页;根据第二父数据页确定目标数据页。该种方式中的各步的具体实现参见图8所示的实施例中的阐述。If the page splitting process corresponding to the first data page occurs after the storage node obtains the first parent data page, in one manner, determining the target data page from the computing node includes: determining from the computing node the first parent data page in the storage node The data page does not correspond to a page splitting process; the second parent data page is read from the storage node, and the second parent data page is the first parent data page updated after the page splitting process corresponding to the first data page occurs; according to the second parent data page The data page determines the target data page. For the specific implementation of each step in this manner, refer to the description in the embodiment shown in FIG. 8 .
若第一数据页对应的页分裂过程发生在存储节点得到第一父数据页之后,第一数据页为第一父数据页的子数据页,在一种方式中,则从计算节点确定目标数据页,包括:从计算节点确定在存储节点中第一父数据页对应有页分裂过程;从存储节点读取第二父数据页至目标父数据页的各数据页,其中,目标父数据页未对应有页分裂过程且位于根数据页和第二父数据页之间或者目标父数据页为所述根数据页,第二父数据页为第一父数据页分裂后的数据页且第二父数据页为第一数据页的父数据页;根据第二父数据页至目标父数据页的各数据页,确定目标数据页。该种方式中的各步的具体实现参见图8所示的实施例中的阐述。If the page splitting process corresponding to the first data page occurs after the storage node obtains the first parent data page, and the first data page is a child data page of the first parent data page, in one method, the target data is determined from the computing node. Pages, including: determining from the computing node that the first parent data page in the storage node corresponds to a page splitting process; reading the data pages from the second parent data page to the target parent data page from the storage node, wherein the target parent data page is not There is a page splitting process and is located between the root data page and the second parent data page or the target parent data page is the root data page, and the second parent data page is the split data page of the first parent data page and the second parent data page. The data page is the parent data page of the first data page; the target data page is determined according to each data page from the second parent data page to the target parent data page. For the specific implementation of each step in this manner, refer to the description in the embodiment shown in FIG. 8 .
若第一数据页对应的页分裂过程发生在存储节点得到第一父数据页之前,则确定目标数据页,包括:确定存储节点中的第一数据页为目标数据页。If the page splitting process corresponding to the first data page occurs before the storage node obtains the first parent data page, determining the target data page includes: determining the first data page in the storage node as the target data page.
若第一数据页对应的页分裂过程的发生时机包括:存储节点的数据回放速度慢于从计算节点的数据回放速度且存储节点中第一数据页对应的页分裂过程待发生,则包括:确定存储节点对第一LSN的日志回放完毕;确定存储节点中的第一数据页为目标数据页。If the occurrence timing of the page splitting process corresponding to the first data page includes: the data playback speed of the storage node is slower than the data playback speed of the slave computing node and the page splitting process corresponding to the first data page in the storage node is about to occur, the process includes: determining The storage node finishes replaying the log of the first LSN; it is determined that the first data page in the storage node is the target data page.
步骤S904、从计算节点从存储节点读取目标数据页。Step S904, read the target data page from the computing node from the storage node.
本实施例中,在从计算节点需要读取某一数据页的子数据页时,可根据分裂信息确定该子数据页是否对应有页分裂过程,以在该子数据页对应有页分裂过程的情况下,根据页分裂过程的发生时机,确定正确的读取数据页,以使从计算节点中的父数据页和子数据页相互匹配,即从计算节点能够读取到正确的数据。In this embodiment, when the sub-data page of a certain data page needs to be read from the computing node, it can be determined whether the sub-data page corresponds to a page-splitting process according to the split information, so that the sub-data page corresponds to a page-splitting process. In this case, the correct read data page is determined according to the occurrence timing of the page splitting process, so that the parent data page and the child data page in the slave computing node match each other, that is, the slave computing node can read correct data.
综上,对于图9所示的实施例中,若全量分裂信息存储在管理节点,未存储在从计算节点,存储节点中也未存储有全量分裂信息或部分分裂信息,从计算节点每次需要从存储节点中读取数据均需要向管理节点请求要读取的数据页是否对应有页分裂过程,网络开销很大。一种改进的方式为图9所示的实施例中全量分裂信息存储在从计算节点的情况,此时,从计算节点无需向管理节点请求要读取的数据页是否对应有页分裂过程,降低了网络开销。另一种改进的方式为图8所示的实施例中存储节点中存储有部分分裂信息,此时,在存储节点接收到从计算节点发送的数据页读取请求时,根据存储的部分分裂信息确定待读取数据页是否对应有页分裂过程,且在待读取数据页对应有页分裂过程且页分裂过程在一定的发生时机下才会使用到全量分裂信息,无论全量分裂信息存储在从计算节点还是管理节点,均相对于“全量分裂信息存储在管理节点、未存储在从计算节点以及存储节点中也未存储有全量分裂信息或部分分裂信息”的方案的网络开销少。To sum up, for the embodiment shown in FIG. 9 , if the full amount of split information is stored in the management node, but not in the slave computing node, and the storage node does not store the full amount of split information or part of the split information, the slave computing node needs to To read data from a storage node, it is necessary to request from the management node whether the data page to be read corresponds to a page splitting process, and the network overhead is large. An improved way is that in the embodiment shown in FIG. 9, the full amount of split information is stored in the slave computing node. In this case, the slave computing node does not need to request the management node whether the data page to be read corresponds to a page splitting process, reducing the need for page splitting. network overhead. Another improved way is that in the embodiment shown in FIG. 8 , the storage node stores partial split information. At this time, when the storage node receives a data page read request sent from the computing node, the storage node stores the partial split information according to the stored partial split information. Determine whether the data page to be read corresponds to a page splitting process, and the full splitting information will be used only when the data page to be read corresponds to a page splitting process and the page splitting process occurs at a certain timing, regardless of whether the full splitting information is stored from Computational nodes or management nodes have less network overhead than the scheme in which the full amount of splitting information is stored in the management node, and neither is stored in the slave computing nodes nor in the storage node, nor does the full amount of splitting information or part of the splitting information are stored.
接着,采用具体的实施例对分裂信息的创建和清理过程进行说明。Next, the creation and cleaning processes of split information are described with specific embodiments.
由于所有的写操作均在主计算节点进行,当一个数据页发生分裂时,所有涉及到的数据页均应当在主计算节点的缓存中,所以主计算节点存储有所有相关数据页的信息,因此,分裂信息可以是由主计算节点创建的,初始过程中,主计算节点向其它的节点发送新创建的分裂信息,比如向从计算节点或管理节点发送全量分裂信息,向存储节点发送部分分裂信息。在后续过程中,主节点发送新增的分裂信息至存储有分裂信息的节点,以更新节点中存储的分裂信息。Since all write operations are performed on the main computing node, when a data page is split, all the involved data pages should be in the cache of the main computing node, so the main computing node stores the information of all relevant data pages, so , the splitting information can be created by the master computing node. In the initial process, the master computing node sends the newly created splitting information to other nodes, such as sending the full splitting information to the slave computing node or management node, and sending part of the splitting information to the storage node. . In the subsequent process, the master node sends the newly added split information to the node where the split information is stored, so as to update the split information stored in the node.
随着数据的增多,页分裂的情况的会不断发生,那么分裂信息中的信息量会越来越多,因此我们需要对分裂信息进行清理。清理过程可由管理节点控制。As the data increases, page splits will continue to occur, and the amount of information in the split information will increase, so we need to clean up the split information. The cleanup process can be controlled by the management node.
其中,在从计算节点和存储节点中,redo日志的回放是按照LSN大小的顺序回放,所以LSN小于当前回放过的LSN的日志将不会被看到。基于这样的事实,可以根据从计算节点和存储节点当前回放的日志的LSN来进行清理。比如在一种方案中,管理节点确定从计算节点最新回放的日志的LSN和存储节点最新回放的日志的LSN中较小的LSN,并将该较小的LSN发送至存储有分裂信息的各节点,以使存储有分裂信息的各节点删除分裂信息中小于该较小的LSN所对应的信息。例如从计算节点已经应用到了LSN为100的日志,存储节点应用到了LSN为120的日志,那么我们就可以清理分裂信息中触发页分裂过程的日志的LSN小于100的页分裂过程的信息。Among them, in the slave computing nodes and storage nodes, the playback of redo logs is played back in the order of LSN size, so logs whose LSN is smaller than the currently played back LSN will not be seen. Based on this fact, cleaning can be done according to the LSNs of the logs currently played back from the compute nodes and storage nodes. For example, in one solution, the management node determines the smaller LSN among the LSN of the latest replayed log from the computing node and the LSN of the latest replayed log of the storage node, and sends the smaller LSN to each node that stores the split information , so that each node that stores the split information deletes the information corresponding to the smaller LSN in the split information. For example, since the computing node has been applied to the log with an LSN of 100, and the storage node has been applied to the log with an LSN of 120, then we can clear the information of the page splitting process whose LSN is less than 100 in the log that triggers the page splitting process in the split information.
本实施例给出了分裂信息的生成和删除的具体实现,以用于上述的数据读取过程。This embodiment provides a specific implementation of the generation and deletion of split information, which is used in the above-mentioned data reading process.
以上对本申请实施里的数据读取方法进行了说明,下面对本申请实施例涉及的装置进行说明。The data reading method in the embodiment of the present application has been described above, and the device involved in the embodiment of the present application will be described below.
图10为本申请实施例提供的一种数据读取装置的结构示意图。如图10所示,该数据读取装置1000可以是如上的从计算节点,也可以是如上的从计算节点的部件(例如,集成电路,芯片等等)。该数据读取装置1000还可以是如上的存储节点,也可以是如上的存储节点的部件(例如,集成电路,芯片等等)。该数据读取装置1000可以包括:处理模块1002(处理单元)。可选的,还可以包括收发模块1001(收发单元)和存储模块1003(存储单元)。FIG. 10 is a schematic structural diagram of a data reading apparatus provided by an embodiment of the present application. As shown in FIG. 10 , the
在一种可能的设计中,如图10中的一个或者多个模块可能由一个或者多个处理器来实现,或者由一个或者多个处理器和存储器来实现;或者由一个或多个处理器和收发器实现;或者由一个或者多个处理器、存储器和收发器实现,本申请实施例对此不作限定。所述处理器、存储器、收发器可以单独设置,也可以集成。In a possible design, one or more modules as shown in FIG. 10 may be implemented by one or more processors, or by one or more processors and memory; or by one or more processors and a transceiver; or implemented by one or more processors, a memory, and a transceiver, which is not limited in this embodiment of the present application. The processor, memory, and transceiver can be set independently or integrated.
所述数据读取装置具备实现本申请实施例描述的从计算节点的功能,比如,所述数据读取装置包括从计算节点执行本申请实施例描述的从计算节点涉及步骤所对应的模块或单元或手段(means),所述功能或单元或手段(means)可以通过软件实现,或者通过硬件实现,也可以通过硬件执行相应的软件实现,还可以通过软件和硬件结合的方式实现。详细可进一步参考前述对应方法实施例中的相应描述。The data reading device has the function of implementing the slave computing node described in the embodiment of the present application. For example, the data reading device includes a module or unit corresponding to the slave computing node executing the steps involved in the slave computing node described in the embodiment of the present application. or means (means), the function or unit or means (means) can be implemented by software, or by hardware, or by executing corresponding software by hardware, or by a combination of software and hardware. For details, further reference may be made to the corresponding descriptions in the foregoing corresponding method embodiments.
或者所述数据读取装置具备实现本申请实施例描述的存储节点的功能,比如,所述数据读取装置包括所述存储节点执行本申请实施例描述的存储节点涉及步骤所对应的模块或单元或手段(means),所述功能或单元或手段(means)可以通过软件实现,或者通过硬件实现,也可以通过硬件执行相应的软件实现,还可以通过软件和硬件结合的方式实现。详细可进一步参考前述对应方法实施例中的相应描述。Or the data reading device has the function of implementing the storage node described in the embodiments of the present application. For example, the data reading device includes modules or units corresponding to the storage node performing the steps involved in the storage node described in the embodiments of the present application. or means (means), the function or unit or means (means) can be implemented by software, or by hardware, or by executing corresponding software by hardware, or by a combination of software and hardware. For details, further reference may be made to the corresponding descriptions in the foregoing corresponding method embodiments.
可选的,本申请实施例中的数据读取装置1000中各个模块可以用于执行本申请方法实施例中描述的方法。Optionally, each module in the
在第一种可能的设计中,一种数据读取装置1000可包括收发模块1001和处理模块1002。In a first possible design, a
收发模块1001,用于从计算节点接收数据页读取请求,所述数据页读取请求包括第一标识;处理模块1002,用于确定在数据读取装置中标识为所述第一标识的第一数据页对应有页分裂过程;收发模块1001,还用于根据所述页分裂过程的发生时机,向所述计算节点发送目标数据页,所述目标数据页为所述第一数据页或者第二数据页。The
可选地,所述数据读取装置中存储有部分分裂信息;所述部分分裂信息包括部分页分裂过程所对应的分裂数据页的标识以及触发页分裂过程的日志的日志序列号LSN,且所述部分页分裂过程所对应的分裂数据页均存储在所述数据读取装置中;所述处理模块1002,具体用于确定所述部分分裂信息包括的分裂数据页的标识中存在所述第一标识。Optionally, the data reading device stores partial split information; the partial split information includes the identifier of the split data page corresponding to the partial page split process and the log sequence number LSN of the log that triggers the page split process, and the The split data pages corresponding to the partial page splitting process are all stored in the data reading device; the
可选地,所述第一标识是所述计算节点确定的待读取数据页的标识,待读取数据页为所述计算节点中的第一父数据页的子数据页。Optionally, the first identifier is an identifier of a data page to be read determined by the computing node, and the data page to be read is a child data page of a first parent data page in the computing node.
可选地,所述数据页读取请求包括所述第一标识和所述计算点中的所述第一父数据页的第三LSN;在所述收发模块1001根据所述页分裂过程的发生时机,向所述计算节点发送所述目标数据页之前,所述处理模块1002还用于:根据触发所述页分裂过程的日志的第一LSN、数据读取装置中所述第一数据页的第二LSN以及所述第三LSN,确定所述页分裂过程的发生时机。Optionally, the data page read request includes the first identifier and the third LSN of the first parent data page in the calculation point; in the
可选地,所述处理模块1002具体用于:若所述第三LSN小于所述第一LSN且所述第一LSN小于或等于所述第二LSN,则确定所述页分裂过程发生在所述数据读取装置得到所述第一父数据页之后;若所述第一LSN小于所述第二LSN且所述第一LSN小于所述第三LSN,则确定所述页分裂过程发生在所述数据读取装置得到所述第一父数据页之前;若所述第二LSN小于所述第一LSN且所述第一LSN小于或等于所述第三LSN,则确定所述数据读取装置的数据回放速度慢于所述计算节点的数据回放速度且在所述数据读取装置中所述页分裂过程待发生。Optionally, the
可选地,所述页分裂过程的发生在所述数据读取装置得到所述第一父数据页之后;在所述收发模块1001向所述计算节点发送目标数据页之前,所述收发模块1001还用于:向所述计算节点发送第一信息,所述第一信息用于所述计算节点确定待读取的所述目标数据页;接收来自所述计算节点的所述目标数据页的读取请求。Optionally, the page splitting process occurs after the data reading device obtains the first parent data page; before the
可选地,所述第一信息包括:触发所述页分裂过程的日志的第一LSN和指示信息,所述指示信息指示所述页分裂过程发生在所述数据读取装置得到第一父数据页之后。Optionally, the first information includes: a first LSN of a log that triggers the page splitting process and indication information, the indication information indicates that the page splitting process occurs when the data reading device obtains the first parent data page after.
可选地,所述页分裂过程发生在所述数据读取装置得到所述第一父数据页之前,所述目标数据页为所述数据读取装置中的所述第一数据页。Optionally, the page splitting process occurs before the data reading device obtains the first parent data page, and the target data page is the first data page in the data reading device.
可选地,所述数据读取装置的数据回放速度慢于所述计算节点的数据回放速度且在所述数据读取装置中所述页分裂过程待发生,所述目标数据页为所述数据读取装置中的所述第一数据页。在所述收发模块1001向所述计算节点发送所述第一数据页之前,所述处理模块1002还用于:确定所述数据读取装置对LSN为所述第一LSN的日志回放完毕。Optionally, the data playback speed of the data reading device is slower than the data playback speed of the computing node, and the page splitting process is to occur in the data reading device, and the target data page is the data The first data page in the device is read. Before the
上述第一种可能设计中的数据读取装置可为上述图8所示的方法实施中的存储节点或者存储节点的一部分。The data reading device in the above-mentioned first possible design may be the storage node or a part of the storage node in the implementation of the method shown in FIG. 8 above.
在第二种可能的设计中,一种数据读取装置1000可包括收发模块1001和处理模块1002。In a second possible design, a
处理模块1002,用于确定待读取数据页的标识为第一标识,所述待读取数据页为所述计算节点中的第一父数据页的子数据页;收发模块1001,用于向存储节点发送数据页读取请求,所述数据页读取请求包括所述第一标识,所述第一标识用于所述存储节点确定标识为第一标识的第一数据页对应的页分裂过程的发生时机以及根据所述发生时机向所述数据读取装置发送目标数据页;所述收发模块1001,还用于从所述存储节点接收目标数据页,所述目标数据页为第二数据页或者所述第一数据页。The
可选地,在所述收发模块1001从所述存储节点接收目标数据页之前:所述收发模块1001,还用于接收来自所述存储节点的第一信息,所述第一信息包括:触发所述页分裂过程的日志的第一日志序列号LSN和指示信息,所述指示信息指示所述页分裂过程发生在所述存储节点得到所述第一父数据页之后;所述处理模块1002,还用于根据所述第一信息,确定目标数据页;所述收发模块1001,还用于向所述存储节点发送读取所述目标数据页的请求。Optionally, before the
可选地,所述处理模块1002具体用于:根据所述第一信息,确定在所述存储节点中第一父数据页未对应有页分裂过程;从所述存储节点读取第二父数据页,所述第二父数据页为所述页分裂过程发生之后被更新的第一父数据页;根据所述第二父数据页确定所述目标数据页。Optionally, the
可选地,所述处理模块1002具体用于:根据所述第一信息确定在所述存储节点中所述第一父数据页对应有页分裂过程;从存储节点读取第二父数据页至目标父数据页的各数据页,其中,所述目标父数据页未对应有页分裂过程且位于根数据页和所述第二父数据页之间或者所述目标父数据页为所述根数据页,所述第二父数据页为所述第一父数据页分裂后的数据页且所述第二父数据页为所述第一数据页的父数据页;根据所述第二父数据页至所述目标父数据页的各数据页,确定所述目标数据页。Optionally, the
可选地,所述数据存储装置中存储有全量分裂信息,所述全量分裂信息包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;所述处理模块1002,具体用于:根据所述第一信息,确定所述全量分裂信息包括的分裂数据页的标识中存在所述第二标识且触发相应的页分裂过程的LSN为所述第一LSN,所述第二标识为所述第一父数据页的标识。Optionally, the data storage device stores full amount of split information, and the full amount of split information includes the identifier of the split data page corresponding to each page split process and the LSN of the log that triggers each page split process; the
可选地,所述数据存储装置中未存储有全量分裂信息,管理节点中存储有所述全量分裂信息;所述全量分裂信息包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;所述处理模块1002具体用于:根据所述指示信息,控制所述收发模块1001向管理节点发送查询请求,所述查询请求包括所述第一LSN和所述第二标识,所述查询请求指示所述管理节点根据所述全量分裂信息确定在所述存储节点中所述第一父数据页是否对应有页分裂过程;根据所述收发模块1001接收的来自所述管理节点的查询结果,确定所述在所述存储节点中所述第一父数据页对应有页分裂过程,所述查询结果指示在所述存储节点中所述第一父数据页对应有页分裂过程。Optionally, the data storage device does not store the full amount of split information, and the management node stores the full amount of split information; the full amount of split information includes the identifier of the split data page corresponding to each page split process and the trigger for each page. LSN of the log of the splitting process; the
上述第二种可能设计中的数据读取装置可为上述方法实施中的从计算节点或者从计算节点的一部分。The data reading device in the above second possible design may be a slave computing node or a part of the slave computing node in the implementation of the above method.
在第三种可能的设计中,一种数据读取装置1000可包括收发模块1001和处理模块1002。In a third possible design, a
处理模块1002,用于确定待读取数据页的标识为第一标识,所述待读取数据页为所述数据读取装置中的所述第一父数据页的子数据页;确定存储节点中标识为所述第一标识的第一数据页对应有页分裂过程;根据所述页分裂过程的发生时机,确定目标数据页;从所述存储节点读取所述目标数据页。A
可选地,所述数据读取装置中存储有全量分裂信息,所述全量分裂信息中包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;所述处理模块1002,具体用于:确定所述全量分裂信息包括的分裂数据页的标识中存在所述第一标识。Optionally, the data reading device stores full amount of split information, and the full amount of split information includes the identifier of the split data page corresponding to each page split process and the LSN of the log that triggers each page split process; the
可选地,还包括收发模块1001;所述数据读取装置中未存储有全量分裂信息,所述管理节点中存储有全量分裂信息,所述全量分裂信息中包括各页分裂过程所对应的分裂数据页的标识以及触发各页分裂过程的日志的LSN;所述处理模块1002,具体用于控制收发模块1001向所述管理节点发送查询请求,所述查询请求包括所述第一标识,所述查询请求指示所述管理节点根据所述全量分裂信息确定所述第一数据页在所述存储节点中对应有页分裂过程;以及根据收发模块1001接收的来自所述管理节点的查询结果确定所述第一数据页在所述存储节点中对应有页分裂过程,所述查询结果指示所述第一数据页在所述存储节点中对应有页分裂过程。Optionally, it also includes a
可选地,在所述处理模块1002根据所述页分裂过程的发生时机,确定目标数据页之前,所述处理模块1002还用于:根据触发所述页分裂过程的日志的第一LSN、存储节点中的所述第一数据页的第二LSN以及所述数据读取装置中的第一父数据页的第三LSN,确定所述页分裂过程的发生时机。Optionally, before the
可选地,所述处理模块1002具体用于:若所述第三LSN小于所述第一LSN且所述第一LSN小于或等于所述第二LSN,则确定所述页分裂过程发生在所述存储节点得到所述第一父数据页之后;若所述第一LSN小于所述第二LSN且所述第一LSN小于所述第三LSN,则确定所述页分裂过程发生在所述存储节点得到所述第一父数据页之前;若所述第二LSN小于所述第一LSN,所述第一LSN小于或等于所述第三LSN,则确定所述存储节点的数据回放速度慢于所述数据读取装置的数据回放速度且在所述存储节点中所述页分裂过程待发生。Optionally, the
可选地,若所述页分裂过程发生在所述存储节点得到所述第一父数据页之后,则所述处理模块1002具体用于:确定在所述存储节点中所述第一父数据页未对应有页分裂过程;从存储节点读取第二父数据页,所述第二父数据页为所述页分裂发生后被更新的第一父数据页;根据所述第二父数据页确定目标数据页。Optionally, if the page splitting process occurs after the storage node obtains the first parent data page, the
可选地,若所述页分裂过程发生在所述存储节点得到第一父数据页之后,则所述处理模块1002具体用于:确定在所述存储节点中所述第一父数据页对应有页分裂过程;从存储节点读取第二父数据页至目标父数据页的各数据页,其中,所述目标父数据页未对应有页分裂过程且位于根数据页和所述第二父数据页之间或者所述目标父数据页为所述根数据页,所述第二父数据页为所述第一父数据页分裂后的数据页且所述第二父数据页为所述第一数据页的父数据页;根据所述第二父数据页至所述目标父数据页的各数据页,确定所述目标数据页。Optionally, if the page splitting process occurs after the storage node obtains the first parent data page, the
可选地,若所述页分裂过程发生在所述存储节点得到所述第一父数据页之前,则所述处理模块1002具体用于:确定存储节点中的所述第一数据页为目标数据页。Optionally, if the page splitting process occurs before the storage node obtains the first parent data page, the
可选地,若存储节点的数据回放速度慢于数据读取装置的数据回放速度且存储节点中所述页分裂过程待发生,则所述处理模块1002具体用于:确定所述存储节点对所述第一LSN的日志回放完毕;确定存储节点中的所述第一数据页为目标数据页。Optionally, if the data playback speed of the storage node is slower than the data playback speed of the data reading device and the page splitting process in the storage node is about to occur, the
上述第三种可能设计中的数据读取装置可为上述图9所示的方法实施中的从计算节点或者从计算节点的一部分。The data reading device in the third possible design may be the slave computing node or a part of the slave computing node in the implementation of the method shown in FIG. 9 .
本实施例的装置,可以用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The apparatus of this embodiment can be used to implement the technical solutions of the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。According to the embodiments of the present application, the present application further provides an electronic device and a readable storage medium.
如图11所示,是实现本申请实施例的数据读取方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。As shown in FIG. 11 , it is a block diagram of an electronic device implementing the data reading method of the embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are by way of example only, and are not intended to limit implementations of the application described and/or claimed herein.
如图11所示,该电子设备包括:一个或多个处理器1101、存储器1102,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图11中以一个处理器1101为例。As shown in FIG. 11, the electronic device includes: one or
存储器1102即为本申请所提供的非瞬时计算机可读存储介质。其中,所述存储器存储有可由至少一个处理器执行的指令,以使所述至少一个处理器执行本申请所提供的数据读取方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的数据读取方法。The
存储器1102作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的数据读取方法对应的程序指令/模块(例如,附图10所示的处理模块1002和收发模块1001)。处理器1101通过运行存储在存储器1102中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的数据读取方法。As a non-transitory computer-readable storage medium, the
存储器1102可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储实现数据读取方法的电子设备的使用所创建的数据等。此外,存储器1102可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器1102可选包括相对于处理器1101远程设置的存储器,这些远程存储器可以通过网络连接至实现数据读取方法的电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The
实现数据读取方法的电子设备还可以包括:输入装置1103和输出装置1104。处理器1101、存储器1102、输入装置1103和输出装置1104可以通过总线或者其他方式连接,图11中以通过总线连接为例。The electronic device implementing the data reading method may further include: an
输入装置1103可接收输入的数字或字符信息,以及产生与实现数据读取方法的电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置1104可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。The
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein can be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor that The processor, which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。These computational programs (also referred to as programs, software, software applications, or codes) include machine instructions for programmable processors, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages calculation program. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or apparatus for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLDs), including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or trackball) through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (eg, visual feedback, auditory feedback, or tactile feedback); and can be in any form (including acoustic input, voice input, or tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented on a computing system that includes back-end components (eg, as a data server), or a computing system that includes middleware components (eg, an application server), or a computing system that includes front-end components (eg, a user's computer having a graphical user interface or web browser through which a user may interact with implementations of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。A computer system can include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.
本申请中在需要读取存储节点中某一数据页的子数据页时,可根据分裂信息确定该子数据页是否对应有页分裂过程,以在该子数据页对应有页分裂过程的情况下,根据页分裂过程的发生时机,确定待读取的数据页,以使从计算节点得到父数据页和子数据页相互匹配,即从计算节点能够读取到正确的数据。In the present application, when a sub-data page of a data page in a storage node needs to be read, it can be determined whether the sub-data page corresponds to a page-splitting process according to the splitting information, so that if the sub-data page corresponds to a page-splitting process , according to the occurrence timing of the page splitting process, determine the data page to be read, so that the parent data page and the child data page obtained from the computing node match each other, that is, correct data can be read from the computing node.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that steps may be reordered, added or deleted using the various forms of flow shown above. For example, the steps described in the present application can be performed in parallel, sequentially or in different orders, and as long as the desired results of the technical solutions disclosed in the present application can be achieved, no limitation is imposed herein.
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the protection scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims (35)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010081830.7A CN111290714B (en) | 2020-02-06 | 2020-02-06 | Data reading method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010081830.7A CN111290714B (en) | 2020-02-06 | 2020-02-06 | Data reading method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111290714A true CN111290714A (en) | 2020-06-16 |
CN111290714B CN111290714B (en) | 2023-09-05 |
Family
ID=71024539
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010081830.7A Active CN111290714B (en) | 2020-02-06 | 2020-02-06 | Data reading method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111290714B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112379844A (en) * | 2020-11-25 | 2021-02-19 | 深圳市华宝电子科技有限公司 | Data protection method and device, electronic terminal and storage medium |
CN115114370A (en) * | 2022-01-20 | 2022-09-27 | 腾讯科技(深圳)有限公司 | Synchronization method and device for master database and slave database, electronic equipment and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5915254A (en) * | 1994-10-20 | 1999-06-22 | Fujitsu Limited | File storing system for managing a relational data base including information of a parental relationship |
CN1612112A (en) * | 2003-10-30 | 2005-05-04 | 微软公司 | Shadow page tables for address translation control |
US20110225164A1 (en) * | 2010-03-14 | 2011-09-15 | Microsoft Corporation | Granular and workload driven index defragmentation |
CN105122241A (en) * | 2013-03-15 | 2015-12-02 | 亚马逊科技公司 | Database system with database engine and separate distributed storage service |
CN105550345A (en) * | 2015-12-25 | 2016-05-04 | 百度在线网络技术(北京)有限公司 | File operation method and apparatus |
CN105631035A (en) * | 2016-01-04 | 2016-06-01 | 北京百度网讯科技有限公司 | Data storage method and device |
CN105989140A (en) * | 2015-02-27 | 2016-10-05 | 阿里巴巴集团控股有限公司 | Data block processing method and equipment |
US9519664B1 (en) * | 2013-09-20 | 2016-12-13 | Amazon Technologies, Inc. | Index structure navigation using page versions for read-only nodes |
US20170177448A1 (en) * | 2015-12-16 | 2017-06-22 | Netapp, Inc. | Optimized file system layout for distributed consensus protocol |
CN109299067A (en) * | 2018-08-22 | 2019-02-01 | 北京百度网讯科技有限公司 | Page access method, device and storage medium |
-
2020
- 2020-02-06 CN CN202010081830.7A patent/CN111290714B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5915254A (en) * | 1994-10-20 | 1999-06-22 | Fujitsu Limited | File storing system for managing a relational data base including information of a parental relationship |
CN1612112A (en) * | 2003-10-30 | 2005-05-04 | 微软公司 | Shadow page tables for address translation control |
US20110225164A1 (en) * | 2010-03-14 | 2011-09-15 | Microsoft Corporation | Granular and workload driven index defragmentation |
CN105122241A (en) * | 2013-03-15 | 2015-12-02 | 亚马逊科技公司 | Database system with database engine and separate distributed storage service |
CN109933597A (en) * | 2013-03-15 | 2019-06-25 | 亚马逊科技公司 | With database engine and the Database Systems for being independently distributed formula storage service |
US9519664B1 (en) * | 2013-09-20 | 2016-12-13 | Amazon Technologies, Inc. | Index structure navigation using page versions for read-only nodes |
CN105989140A (en) * | 2015-02-27 | 2016-10-05 | 阿里巴巴集团控股有限公司 | Data block processing method and equipment |
US20170177448A1 (en) * | 2015-12-16 | 2017-06-22 | Netapp, Inc. | Optimized file system layout for distributed consensus protocol |
CN105550345A (en) * | 2015-12-25 | 2016-05-04 | 百度在线网络技术(北京)有限公司 | File operation method and apparatus |
CN105631035A (en) * | 2016-01-04 | 2016-06-01 | 北京百度网讯科技有限公司 | Data storage method and device |
CN109299067A (en) * | 2018-08-22 | 2019-02-01 | 北京百度网讯科技有限公司 | Page access method, device and storage medium |
Non-Patent Citations (2)
Title |
---|
NA, GAP OO等: "Dynamic In-Page Logging for B+-tree Index", vol. 24, no. 24, pages 1231 - 1243, XP011445002, DOI: 10.1109/TKDE.2011.32 * |
金天荣;: "SQL Server的查询优化方法的设计和实现", no. 18, pages 247 - 249 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112379844A (en) * | 2020-11-25 | 2021-02-19 | 深圳市华宝电子科技有限公司 | Data protection method and device, electronic terminal and storage medium |
CN115114370A (en) * | 2022-01-20 | 2022-09-27 | 腾讯科技(深圳)有限公司 | Synchronization method and device for master database and slave database, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111290714B (en) | 2023-09-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11977532B2 (en) | Log record identification using aggregated log indexes | |
US10628449B2 (en) | Method and apparatus for processing database data in distributed database system | |
CN112269789B (en) | Method and device for storing data, and method and device for reading data | |
JP2021170409A (en) | Label data processing method, apparatus therefor, device, and recording medium | |
CN108121782B (en) | Distribution method of query request, database middleware system and electronic equipment | |
CN111241108B (en) | Key value based indexing method and device for KV system, electronic equipment and medium | |
CN111523001B (en) | Method, device, equipment and storage medium for storing data | |
CN111046034A (en) | Method and system for managing memory data and maintaining data in memory | |
US9152683B2 (en) | Database-transparent near online archiving and retrieval of data | |
CN110737682A (en) | cache operation method, device, storage medium and electronic equipment | |
WO2020007288A1 (en) | Method and system for managing memory data and maintaining data in memory | |
EP3816817B1 (en) | Method and apparatus for importing data into graph database, electronic device and medium | |
CN111459882B (en) | Distributed file system namespace transaction processing method and device | |
CN113364877B (en) | Data processing method, device, electronic equipment and medium | |
CN111831752A (en) | Space arrangement method, device, device and storage medium for distributed database | |
CN111290714B (en) | Data reading method and device | |
CN117149784A (en) | Method and device for updating clickhouse database in high performance | |
CN116226139A (en) | A method and system for distributed storage and processing of large-scale ocean data | |
CN111782633B (en) | Data processing method and device and electronic equipment | |
CN119988680A (en) | A semi-structured data compression storage method, device, equipment and storage medium | |
JP2024509198A (en) | Soft deletion of data in a sharded database | |
WO2025118788A1 (en) | Data query method and apparatus | |
US12072937B2 (en) | Data read method, data update method, electronic device, and program product | |
CN118519964A (en) | Data processing method, apparatus, computer program product, device and storage medium | |
CN115374078A (en) | Data storage and reading system and working method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |