Data recovery method, computing device and storage medium

文档序号:1963608 发布日期:2021-12-14 浏览:10次 中文

阅读说明:本技术 数据的恢复方法、计算设备及存储介质 (Data recovery method, computing device and storage medium ) 是由 章颖强 于 2021-08-13 设计创作,主要内容包括:本申请实施例提供一种数据的恢复方法、计算设备及存储介质,在本申请实施例中,对本地内存节点进行数据写入,根据写入数据对应的写入操作,生成并存储用于记录写入操作的记录信息;将本地内存节点中的写入数据写入到远程内存节点中;生成并存储第一定位信息,第一定位信息用于定位已写入到远程内存节点中写入数据;在计算节点异常的情况下,根据第一定位信息以及记录信息,对本地内存节点中未写入到远程内存节点中的写入数据进行恢复。使得无需再对远程内存节点中已经写入的数据进行恢复,从而保留了远程内存节点中的写入数据,维持了远程内存节点的生命周期。有效利用了远程内存节点的生命周期,减少了数据的恢复量。(In the embodiment of the application, data is written into a local memory node, and record information for recording write-in operation is generated and stored according to write-in operation corresponding to the write-in data; writing the write-in data in the local memory node into the remote memory node; generating and storing first positioning information, wherein the first positioning information is used for positioning written data written into a remote memory node; and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information. The written data in the remote memory node does not need to be recovered, so that the written data in the remote memory node is reserved, and the life cycle of the remote memory node is maintained. The life cycle of the remote memory node is effectively utilized, and the recovery amount of data is reduced.)

1. A method of recovering data, comprising:

writing data into a local memory node, and generating and storing record information for recording the write-in operation according to the corresponding write-in operation;

writing the write-in data in the local memory node into the remote memory node;

generating and storing first positioning information, wherein the first positioning information is used for positioning written data written into the remote memory node;

and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

2. The method according to claim 1, wherein the writing data into the local memory node, and generating and storing record information for recording the write operation according to the corresponding write operation, comprises:

receiving a data modification request, and modifying corresponding data in a corresponding memory page in a local memory node according to the modification request;

and generating a modification operation log aiming at the modification operation of the corresponding data, and storing the modification operation log.

3. The method of claim 2, the storing the modification operation log, comprising:

and storing the modification operation log into a log cache, and storing the modification operation log into a storage device through the log cache.

4. The method of claim 1, wherein writing write data in a local memory node to a remote memory node comprises:

writing the corresponding memory page in the local memory node where the written data is located into a local linked list;

and writing the corresponding memory page into the remote memory node through the local linked list.

5. The method of claim 1, the generating and storing first positioning information comprising:

determining the first positioning information according to the memory page written into the remote memory node;

and storing the first positioning information into the remote memory node.

6. The method according to claim 1, wherein the recovering, according to the first positioning information and the record information, the written data that is not written into the remote memory node in the local memory node comprises:

reading the first positioning information in the remote memory node and reading a modification operation log in the storage device;

and determining unwritten write-in data according to the first positioning information, and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log so as to enable the recovered write-in data to wait for being written into a remote memory node.

7. The method of claim 1 or 6, further comprising:

storing the write-in data in the remote memory node to a storage device;

generating and storing second positioning information, wherein the second positioning information is used for positioning written data stored in the storage device;

and under the condition that the remote memory node is abnormal, recovering the written data which is not written into the storage equipment in the remote memory node according to the record information and the second positioning information.

8. The method of claim 7, wherein storing write data in the remote local memory to the storage device comprises:

writing the corresponding memory page in the remote memory node where the written data is in into the remote linked list;

and storing the corresponding memory pages to the storage equipment through the remote linked list.

9. The method of claim 7, the generating and storing second positioning information, comprising:

determining the second positioning information according to the memory page written into the storage device;

storing the second positioning information in the storage device.

10. The method of claim 7, wherein the recovering the written data in the remote memory node that is not written in the storage device according to the record information and the second positioning information comprises:

reading a modification operation log in a storage device and the second positioning information;

and determining unwritten write-in data according to the second positioning information, and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log, so that the recovered write-in data waits to be stored in a storage device.

11. A computing device, comprising: a memory, a processor;

the memory for storing a computer program;

the processor executing the computer program to:

writing data into a local memory node, and generating and storing record information for recording the write-in operation according to the corresponding write-in operation;

writing the write-in data in the local memory node into the remote memory node;

generating and storing first positioning information, wherein the first positioning information is used for positioning the written data written into the remote memory node;

and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

12. A computer readable storage medium having a computer program stored thereon, which, when executed by one or more processors, causes the one or more processors to carry out the steps of the method of any one of claims 1-10.

13. A computer program product comprising a computer program or instructions, wherein the computer program, when executed by a processor, causes the processor to carry out the steps of the method of any one of claims 1 to 10.

14. A system for recovery of data, comprising: a first device and a second device;

the first equipment sends a data writing request to the second equipment;

the second device writes data into the local memory node according to the received write-in request, and generates and stores record information for recording the write-in operation according to the corresponding write-in operation; writing the write-in data in the local memory node into the remote memory node; generating and storing first positioning information, wherein the first positioning information is used for positioning written data written into a remote memory node; and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

Technical Field

The present application relates to the field of computer technologies, and in particular, to a data recovery method, a computing device, and a storage medium.

Background

The database memory separation architecture is a cloud native architecture evolved on the basis of separation of cloud native database storage and computation. In the database memory separation architecture, the local memory and the separation memory are managed in a logic management mode or in a unified mode, after a computing node is crashed, the local memory is emptied along with the local memory due to the restarting of the computing node, so that the state in the separation memory is not complete any more, the separation memory is restarted along with the computing node, and the crash recovery is carried out depending on the stored state. But recovery in this way wastes the independent life cycle of the separate memories, and the data recovery process is slow.

Disclosure of Invention

Aspects of the present disclosure provide a data recovery method, a computing device, and a storage medium, which are used to effectively utilize data in a separate memory and perform data recovery relatively quickly.

An embodiment of the present application provides a data recovery method, including: writing data into a local memory node, and generating and storing record information for recording the write-in operation according to the corresponding write-in operation; writing the write-in data in the local memory node into the remote memory node; generating and storing first positioning information, wherein the first positioning information is used for positioning the written data written into the remote memory node; and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

An embodiment of the present application further provides a computing device, including: a memory, a processor; the memory for storing a computer program; the processor executing the computer program to: writing data into a local memory node, and generating and storing record information for recording the write-in operation according to the corresponding write-in operation; writing the write-in data in the local memory node into the remote memory node; generating and storing first positioning information, wherein the first positioning information is used for positioning the written data written into the remote memory node; and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

Embodiments of the present application also provide a computer-readable storage medium storing a computer program, which when executed by one or more processors causes the one or more processors to implement the steps of the above-mentioned method.

Embodiments of the present application also provide a computer program product, which includes a computer program or instructions, wherein when the computer program is executed by a processor, the processor is caused to implement the steps in the above method.

An embodiment of the present application further provides a data recovery system, including: a first device and a second device; the first equipment sends a data writing request to the second equipment; the second device writes data into the local memory node according to the received write-in request, and generates and stores record information for recording the write-in operation according to the corresponding write-in operation; writing the write-in data in the local memory node into the remote memory node; generating and storing first positioning information, wherein the first positioning information is used for positioning the written data written into the remote memory node; and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

In the embodiment of the application, data writing is carried out on the local memory node, and according to the corresponding writing operation, record information for recording the writing operation is generated and stored; writing the write-in data in the local memory node into the remote memory node; generating and storing first positioning information, wherein the first positioning information is used for positioning written data written into a remote memory node; and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

Under the condition that the computing node is abnormal, according to the first positioning information and the recording information, the written data which is not written into the remote memory node in the local memory node is recovered, so that the written data in the remote memory node does not need to be recovered, the written data in the remote memory node is reserved, and the life cycle of the remote memory node is maintained. The life cycle of the remote memory node is effectively utilized, the recovery amount of data is reduced, and the data recovery efficiency is greatly improved.

Drawings

The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:

FIG. 1 is a flow chart illustrating a data recovery method according to an exemplary embodiment of the present application;

FIG. 2 is a schematic diagram of data recovery in an exemplary embodiment of the present application;

FIG. 3 is a schematic diagram of a data recovery system according to an exemplary embodiment of the present application;

FIG. 4 is a flowchart illustrating a data recovery method according to an exemplary embodiment of the present application;

fig. 5 is a schematic structural diagram of a data recovery apparatus according to an exemplary embodiment of the present application;

fig. 6 is a schematic structural diagram of a computing device according to an exemplary embodiment of the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

As can be seen from the foregoing description, when a computing node, such as a CPU (central processing unit), crashes, the computing node is restarted, and meanwhile, the local memory and the separate memory of the computing node are emptied due to the restart. However, when this method is applied to the split memory architecture, the stored data in the split memory cannot be effectively utilized to speed up the data recovery, and the data in the split memory needs to be reset.

Based on this, embodiments of the present application provide a data recovery method, a computing device, and a storage medium, which can effectively utilize data in a separate memory and perform data recovery relatively quickly.

The following describes the data recovery process in detail with reference to the method embodiment.

Fig. 1 is a flowchart illustrating a data recovery method according to an exemplary embodiment of the present application. The method 100 provided by the embodiment of the present application is executed by a computing device, such as a server. The method 100 comprises the steps of:

101: and writing data into the local memory node, and generating and storing record information for recording the write-in operation according to the corresponding write-in operation.

102: and writing the write data in the local memory node into the remote memory node.

103: first positioning information is generated and stored.

The first positioning information is used for positioning the written data written into the remote memory node.

104: and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

It should be noted that, more specifically, the execution subject in the embodiment of the present application may be a physical host of a cloud server, and the like. The corresponding architecture can be a storage-separated architecture and a memory-separated architecture. In particular, for memory separation, corresponding memories are deployed on different physical hosts. For local memory nodes, memory on other physical hosts may be considered remote memory nodes. In addition, for the local memory node, there is a corresponding computing node, such as a CPU, locally. The compute node is not split. Based on this, a corresponding memory-separated database can be realized.

The following is set forth in detail with respect to the above steps:

101: and writing data into the local memory node, and generating and storing record information for recording the write-in operation according to the corresponding write-in operation.

The local memory node refers to a memory deployed on a local physical host. And the local physical host is also provided with a corresponding computing node, such as a GPU, and can also become a local computing node.

A write operation may refer to a specific execution action of a write, such as one that modifies data (or thing) a into data (or thing) B. The write operation may include a data modification operation, a data storage or write operation, and the like.

For example, a user may send an SQL (Structured Query Language) statement to a database server via a terminal, such as a computer, for data modification. After receiving the statement, the database server may invoke a corresponding execution engine to modify data according to the parsing of the statement. The corresponding execution engine can modify the data in the local memory through a Transaction Manager (Transaction Manager) on the local physical host. And then recording the modification process, namely the corresponding record information, for recording the corresponding modification operation, such as modifying the data A into the data B.

Specifically, writing data into the local memory node, and generating and storing record information for recording the write operation according to the corresponding write operation, includes: receiving a data modification request, and modifying corresponding data in a corresponding memory page in a local memory node according to the modification request; and generating a modification operation log aiming at the modification operation of the corresponding data, and storing the modification operation log.

For example, according to the foregoing, a user may send a data modification request through a computer, where the request may carry the SQL statement for data modification, or the SQL statement is a data modification request. According to the foregoing manner, as shown in fig. 2, when the transaction manager 204 on the local physical host receives the instruction for modifying the data, and modifies the data in the corresponding memory page in the local memory according to the instruction, step 210 is executed: data in the memory page is modified. A corresponding redo log is then generated, such that the corresponding modify operation is recorded in the log. And stores the log. The memory pages 2011 are stored in a Local cache Pool 2012 (PUB, i.e. Local memory or Local memory node) in the Local compute node 201.

It should be noted that, for the database of the embodiment of the present application, it may be a relational database. In addition, a memory page refers to data corresponding to a segment of an address.

Wherein, storing the modification operation log comprises: and storing the modification operation log into a log cache, and storing the modification operation log into a storage device through the log cache.

For example, as described above, as shown in fig. 2, the generated redo Log is stored in the Log cache (Log buffer)2014 in the local computing node 201 on the local physical host, that is, step 211 is executed: and writing the modified operation log into the log cache 2014. Then, through the log cache 2014, the redo log is written into the Storage device 203(Persistent Shared Storage), and the transaction submission is completed, that is, step 213 is executed: the transaction is committed to the storage device 203, and more specifically may be written to a Write-Ahead Log 2031(Write-Ahead Log) in the storage device 203.

In addition, after the storage device 203 successfully stores the log, an acknowledgement message may be returned to the log cache 2014 to ensure that the log is successfully written into the storage device 203.

102: and writing the write data in the local memory node into the remote memory node.

The remote memory node may refer to a memory deployed on another physical host. Such as remote memory node 202 in fig. 2.

For example, as described above, as shown in fig. 2, the modified memory pages 2011 (which may be multiple memory pages) in the local cache pool 2012 are written into the corresponding cache pool in the remote memory node 202.

Specifically, writing the write data in the local memory node into the remote memory node includes: writing the corresponding memory page in the local memory node where the written data is located into a local linked list; and writing the corresponding memory page into the remote memory node through the local linked list.

Where the local linked list is located in the local compute node 201 as shown in figure 2.

For example, as described above, as shown in fig. 2, the modified memory pages are hung in the local linked list (FLUSH _ LBP, which may also be referred to as a local dirty page linked list) 2013 in the local compute node 201 through the local cache pool 2012, that is, step 212 is performed: and writing the modified memory pages into the local linked list 2013. The modified memory page 2011 is written into the Remote memory node 202, and more specifically, into a Remote cache Pool (Remote Buffer Pool)2021 in the Remote memory node 202, through the local linked list 2013.

In addition, the write to the remote memory node may be triggered by a local middleware (LFT Daemon). As shown in fig. 2, step 214 is performed by the local linked list 2013, as described above: the trigger component, i.e., the local intermediate component 2015, is triggered to write the modified memory pages 2011 to the remote cache pool 2021 in the remote memory node 202. Step 215 is executed: and writing the remote memory node into the remote cache pool 2021.

It should be noted that data writing to the remote memory node can be performed even without an intermediate component.

In addition, as shown in FIG. 2, step 223 may also be performed to the transaction manager 204 via the local linked list 2013: the transaction result, i.e. the modified transaction acknowledgement, is sent. And returns to the user's computer through the transaction manager 204 to inform the user of the confirmation of the modified transaction. At this point, the log cache 2014 has completed the transaction commit.

103: first positioning information is generated and stored.

The first positioning information is information for positioning data written into the remote memory node, such as a checkpoint. The checkpoint is represented as data prior to the site, all of which have been stored.

For example, according to the foregoing, when the modified memory page in the local memory node is written into the remote memory node on the local physical host, after a preset number of memory pages have been written into the remote memory node, L1checkpoint may be set to indicate that data before the point has been stored by the remote memory node. The L1checkpoint may be updated as the write process progresses until a database exception requires data recovery.

Specifically, generating and storing first positioning information for positioning write data written in a remote memory node includes: determining first positioning information according to the memory page written into the remote memory node; and storing the first positioning information into a remote memory node.

For example, according to the foregoing, when the modified memory page in the local memory node is written into the remote cache pool in the remote memory node, after a preset number of memory pages are written into the remote cache pool in the remote memory node, L1checkpoint may be set to indicate that all data before the point has been stored by the remote memory node. The L1checkpoint may be updated as the write process progresses until a database exception requires data recovery. As shown in fig. 2, L1checkpoint may be set by the local linked list 2013 and then stored in the first location information cache (checkpoints)2022 in the remote memory node 202. Or, the local intermediate component 2015 is triggered by the local linked list 2013 to set the L1checkpoint, and then the checkpoint is stored in the first positioning information cache (checkpoints)2022 in the remote memory node 202. Step 216 is executed: the first positioning information is stored in a first positioning information buffer (caches) 2022.

104: and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

Wherein, the computing node is located locally, that is, the local computing node: the local compute node is deployed on a local physical host.

The computing node exception refers to local computing node exception, such as power failure of the local computing node or software crash corresponding to the CPU.

For example, as described above, when the local CPU crashes, such as after a power failure, the power is turned back on for a reboot. And after the CPU is restarted, acquiring L1checkpoint in the remote memory node and acquiring a stored redo log. And then determining the memory page written into the remote memory node according to the L1checkpoint, and then searching the operation corresponding to the subsequent memory page which is not written into the remote memory node according to the redo log to recover the data. The specific recovery process is similar to the manner described above, and is not repeated again, only for illustration, and the recovery process is also started from step 210 as shown in fig. 2 to modify the data in the memory page.

It should be understood that the recovery process is similar for the stored data and will not be described again.

It should be noted that, for better data recovery, the memory pages have corresponding identifications, such as IDs. The log may also have a corresponding identification, such as an ID. And the identification of the log and the identification of the memory page may correspond. Therefore, the ID of the memory page can be determined according to the checkpoint, and then the subsequent redo log of the ID is searched for data recovery.

Specifically, according to the first positioning information and the record information, recovering the write-in data that is not written into the remote memory node in the local memory node, includes: reading first positioning information in a remote memory node and reading a modification operation log in a storage device; and determining unwritten write-in data according to the first positioning information, and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log so as to enable the recovered write-in data to wait to be written into the remote memory node.

For example, as described above, as shown in fig. 2, when the local CPU crashes, such as after a power failure, the power is turned on again for a reboot. After the CPU is restarted, the L1checkpoint stored in the first location information cache 2022 in the remote memory node 202 is read, and the redo log in the storage device 203 is read, specifically, the redo log may be read from the pre-written log 2031 in the storage device 203. Then, according to L1checkpoint, it is determined that the ID has been written into the memory page 2011 of the remote memory node 202, and then a subsequent redo log of the ID is searched. And searching for subsequent operation corresponding to the memory page 2011 which is not written into the remote memory node 202 according to the redo log, and performing data recovery. The specific recovery process is similar to the manner described above, and thus is not described again, and only the description is given, and the recovery process is also performed by starting from step 210 and modifying the data in the memory page 2011 until the data is stored in the remote cache pool 2021 in the remote memory node 202 as shown in fig. 2.

It should be noted that the separated memory (i.e., the remote memory node) can have an independent recovery capability through L1checkpoint, and the separated memory can crash and recover the crash recovery independently and continue to be used. The process of crash recovery and performance recovery is greatly accelerated.

Since the data corresponding to the memory page in the remote cache pool is stored in the storage device in the subsequent process, if the data is already stored in the storage device and the local computing node is abnormal, the data which is not written into the remote memory node can be recovered through the above method, and the data which is not written into the storage device can also be recovered.

In the remote memory node, data is already stored to the storage device, and if the remote memory node is abnormal, data recovery is also required, and a specific recovery method is as follows:

specifically, the method 100 further includes: storing the write-in data in the remote memory node to a storage device; generating and storing second positioning information, wherein the second positioning information is used for positioning the written data stored in the storage equipment; and under the condition that the remote memory node is abnormal, recovering the written data which is not written into the storage equipment in the remote memory node according to the record information and the second positioning information.

The second positioning information is information for positioning written data stored in the storage device. For example, checkpoint is similar to the first positioning information, and thus redundant description is omitted.

For example, as described above, the stored memory pages are written to the storage device by the remote memory node. In the process of storing into the storage device, L2checkpoint indicates that the data before the point has been stored into the storage device. The L2checkpoint may be updated as the write process advances until the remote memory node in the database is abnormal and data recovery is required. When recovering, the local computing node needs to obtain the corresponding redo log and L2checkpoint, and recover the written data that is not written into the storage device in the remote memory node.

Wherein, storing the write data in the remote memory node to the storage device includes: writing the corresponding memory page in the remote memory node where the written data is in into the remote linked list; and storing the corresponding memory pages to the storage equipment through a remote linked list.

For example, as described above, as shown in fig. 2, memory pages in the remote memory node 202 may be hung in a remote linked list (FLUSH _ RBP, remote dirty page linked list) 2023 by a remote cache pool 2021. Or, the memory page 2011 is hung to the remote linked list 2023 by triggering the local middle component 2015, that is, step 217 is executed: write to memory pages 2011 in remote memory nodes to the remote linked list 2023. Since step 215 is also performed by local middle component 2015, the component is aware of the information, such as addresses and data, of memory pages 2011 in the remote cache pool, so step 217 can be performed by the component. No further description is given. The data in the memory pages 2011 is stored in the data 2033 in the storage device 203 through the remote linked list 2023. Thereby completing the persistent storage of the data.

Alternatively, as shown in fig. 2, the data may be stored in the storage device 203 by triggering a remote intermediate component (HFT Daemon)2024 in the remote memory node 202. Triggering, by the remote linked list 2023, the remote intermediary component 2024 to write the data corresponding to the memory page 2011 into the storage device 203, that is, performing step 218: the trigger component writes the data. The corresponding data is written to the data 2033 in the storage device 203 by the remote intermediary component 2024, i.e. step 219 is performed by the remote intermediary component: write data to data 2033 in storage device 203.

Wherein generating and storing second positioning information comprises: determining second positioning information according to the memory page written into the storage equipment; and storing the second positioning information into the storage device.

For example, as described above, as shown in fig. 2, when the memory pages 2011 in the remote memory node 202 are written into the storage device 203, after a preset number of memory pages 2011 are written into the storage device 203, the setting L2checkpoint may be performed, which indicates that all data before the point have been device-stored. The L2checkpoint can be updated along with the progress of the writing process until the remote memory node in the database is abnormal and data recovery is needed. L2checkpoint may be set by the remote linked list 2024 and then stored in the second location information (checkpoints)2032 in the storage device 203. Or, the remote middleware 2024 is triggered by the remote linked list 2024 to set L2checkpoint, and then stores the checkpoint into the second location information (checkpoints)2032 in the storage device 203. Step 220 is executed: the second positioning information is stored in the second positioning information (checkpoints)2032 in the storage device 203.

According to the record information and the second positioning information, recovering the written data which is not written into the storage device in the remote memory node, including: reading a modification operation log and second positioning information in the storage device; and determining the unwritten written data according to the second positioning information, and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log so as to enable the recovered written data to wait for being stored in the storage device.

The remote memory node exception may refer to an individual remote memory node exception (e.g., power off) or a local computing node exception + a remote memory node exception, i.e., both of them are exception at the same time.

For example, as described above, as shown in fig. 2, when the remote memory node crashes, for example, after power off, the remote memory node is powered on again for reboot. After the restart, the local CPU reads L2checkpoint stored in the second location information 2032 in the storage device 203 and reads a redo log in the storage device 203, specifically, may read the redo log from the pre-written log 2031 in the storage device 203. Then, the ID written into the memory page 2011 of the storage device 203 is determined according to L2checkpoint, and then a subsequent redo log of the ID is searched. And searching for the operation corresponding to the memory page 2011 which is not written into the storage device 203 subsequently according to the redo log, and performing data recovery. The specific recovery process is similar to the manner described above, and is not repeated again, and only described, in the recovery process, as shown in fig. 2, the data in the memory page 2011 is modified from step 210 until the data is stored in the data 2033 of the storage device 203.

It should be noted that, after data is successfully written into the storage device 203, the corresponding log in the storage device 203 may be deleted. As shown in fig. 2, triggering the local middleware 2015 by the remote middleware 2024 deletes a corresponding log, such as a redo log, in the pre-written log 2031 in the storage device 203. Then, the corresponding log in the pre-written log 2031 in the storage device 203 is deleted by the local intermediate component 2015. Namely, step 221 is executed: the trigger component deletes the pre-write log, and step 222: and deleting the preset log.

Therefore, the L2checkpoint can perform data recovery when the remote memory node is abnormal.

Fig. 3 is a schematic structural diagram of a data recovery system according to an exemplary embodiment of the present application. As shown in fig. 3, the system 300 may include: a first device 301 and a second device 302.

The first device 301 may be a device with certain computing capability, and may implement a function of sending data to the second device 302, and may also receive data sent by the second device 302. The basic structure of the first device 301 may include: at least one processor. The number of processors may depend on the configuration and type of device with a certain computing power. A device with certain computing capabilities may also include Memory, which may be volatile, such as RAM, non-volatile, such as Read-Only Memory (ROM), flash Memory, etc., or both. The memory typically stores an Operating System (OS), one or more application programs, and may also store program data and the like. In addition to the processing unit and the memory, the device with certain computing capabilities also includes some basic configurations, such as a network card chip, an IO bus, a display component, and some peripheral devices. Alternatively, some peripheral devices may include, for example, a keyboard, a stylus, and the like. Other peripheral devices are well known in the art and will not be described in detail herein. Alternatively, the first device 301 may be a smart terminal, such as a mobile phone, a desktop computer, a notebook, a tablet computer, and the like.

The second device 302 refers to a device that can provide a computing processing service in a network virtual environment, and may refer to a device that performs data recovery using a network. In physical implementation, the second device 302 may be any device capable of providing a computing service, responding to a service request, performing data acquisition, and further performing data recovery, and may be, for example, a cloud server, a cloud host, a virtual center, a conventional server, and the like. The second device 302 is mainly composed of a processor, a hard disk, a memory, a system bus, and the like, and is similar to a general computer architecture.

Specifically, the first device 301 sends a data write request to the second device.

Specifically, the second device 302 performs data writing on the local memory node according to the received write request, and generates and stores record information for recording the write operation according to the corresponding write operation; writing the write-in data in the local memory node into the remote memory node; generating and storing first positioning information, wherein the first positioning information is used for positioning written data written into a remote memory node; and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

Wherein the compute node is located locally.

Specifically, the second device 302 receives the data modification request, and modifies the corresponding data in the corresponding memory page in the local memory node according to the modification request; and generating a modification operation log aiming at the modification operation of the corresponding data, and storing the modification operation log.

The first device 301 sends a data modification request to the second device 302.

Specifically, the second device 302 stores the modification operation log in a log cache, and stores the modification operation log in the storage device through the log cache.

Specifically, the second device 302 determines the first positioning information according to the memory page written into the remote memory node; and storing the first positioning information into the remote memory node.

Specifically, the second device 302 reads the first positioning information in the remote memory node and reads the modification operation log in the storage device; and determining unwritten write-in data according to the first positioning information, and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log so as to enable the recovered write-in data to wait to be written into the remote memory node.

In addition, the second device 302 stores the write data in the remote memory node to the storage device; generating and storing second positioning information, wherein the second positioning information is used for positioning the written data stored in the storage equipment; and under the condition that the remote memory node is abnormal, recovering the written data which is not written into the storage equipment in the remote memory node according to the record information and the second positioning information.

Specifically, the second device 302 determines the second positioning information according to the memory page written in the storage device; and storing the second positioning information into the storage device.

Specifically, the second device 302 reads the modification operation log and the second positioning information in the storage device; and determining the unwritten written data according to the second positioning information, and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log so as to enable the recovered written data to wait for being stored in the storage device.

It should be noted that what has not been fully described in the system 300 is referred to in the foregoing method 100, and its specific implementation is referred to in the foregoing method 100, which is not described herein again.

In the scenario of data recovery according to the embodiment of the present application, as shown in fig. 3, a user may execute step 310 through a first device 301, such as a computer: sending a data modification request to the second device 302, such as a database server, where the request may carry the SQL statement for data modification, or the SQL statement is a data modification request. After receiving the request, the database server may invoke a corresponding execution engine to modify data according to the analysis of the SQL statement in the request. The corresponding execution engine may modify the data in the local memory through the Transaction Manager 204(Transaction Manager) on the local physical host. The modification process is then recorded, i.e. the corresponding modification operation, e.g. data a is modified to data B.

The transaction manager 204 on the local physical host of the database server receives the instruction for modifying the data, and modifies the data in the corresponding memory page in the local memory according to the instruction, that is, step 210 is executed: data in the memory page is modified. A corresponding redo log is then generated, such that the corresponding modify operation is recorded in the log. Storing the generated redo Log in a Log cache (Log buffer)2014 in the local computing node 201, that is, executing step 211: and writing the modified operation log into the log cache 2014. Then, the redo log is written into the storage device 203 through the log cache 2014, and the transaction submission is completed, that is, step 213 is executed: the transaction is committed to the storage device 203, and more specifically may be written to a pre-write log 2031 in the storage device 203.

The modified memory pages are hung in the local linked list 2013 in the local compute node 201 through the local cache pool 2012, that is, step 212 is executed: and writing the modified memory pages into the local linked list 2013. Step 214 is performed by the local linked list 2013: the trigger component, i.e., the local intermediate component 2015, is triggered to write the modified memory pages 2011 to the remote cache pool 2021 in the remote memory node 202. Step 215 is executed: and writing the remote memory node into the remote cache pool 2021. Step 223 may also be performed to the transaction manager 204 by the local linked list 2013: the transaction result, i.e. the modified transaction acknowledgement, is sent. And returns to the user's computer through the transaction manager 204 to notify the user to modify the transaction confirmation, i.e. execute step 311: and sending a modification confirmation result. At this point, the log cache 2014 has completed the transaction commit.

When the memory page modified in the local memory node is written into the remote cache pool in the remote memory node, the local intermediate component 2015 may be triggered to set L1 cache by the local linked list 2013, and then the set L1 cache is stored in the first location information cache (caches) 2022 in the remote memory node 202. Step 216 is executed: the first positioning information is stored in a first positioning information buffer (caches) 2022.

When the local CPU crashes, for example, after power off, the CPU is powered on again for restarting. After the CPU is restarted, the L1checkpoint stored in the first location information cache 2022 in the remote memory node 202 is read, and the redo log in the storage device 203 is read, specifically, the redo log may be read from the pre-written log 2031 in the storage device 203. Then, according to L1checkpoint, it is determined that the ID has been written into the memory page 2011 of the remote memory node 202, and then a subsequent redo log of the ID is searched. And searching for subsequent operation corresponding to the memory page 2011 which is not written into the remote memory node 202 according to the redo log, and performing data recovery.

The memory page 2011 is hung to the remote linked list 2023 by triggering the local middle component 2015, that is, step 217 is executed: write to memory pages 2011 in remote memory nodes to the remote linked list 2023. Triggering, by the remote linked list 2023, the remote intermediary component 2024 to write the data corresponding to the memory page 2011 into the storage device 203, that is, performing step 218: the trigger component writes the data. The corresponding data is written to the data 2033 in the storage device 203 by the remote intermediary component 2024, i.e. step 219 is performed by the remote intermediary component: write data to data 2033 in storage device 203.

By writing the memory pages 2011 in the remote memory node 202 to the storage device 203, the setting L2checkpoint can be performed after a preset number of memory pages 2011 have been written to the storage device 203. The remote middleware 2024 may be triggered by the remote linked list 2024 to set L2checkpoint, and then store it in the second location information (checkpoints)2032 in the storage device 203. Step 220 is executed: the second positioning information is stored in the second positioning information (checkpoints)2032 in the storage device 203.

And when the remote memory node crashes, if the power is off, the remote memory node is powered on again to restart. After the restart, the local CPU reads L2checkpoint stored in the second positioning information 2032 in the storage device 203, and reads a redo log in the storage device 203. And searching for the operation corresponding to the memory page 2011 which is not written into the storage device 203 subsequently according to the redo log, and performing data recovery.

For the content not described in detail herein, reference may be made to the content described above, and thus, the description thereof is omitted.

In the present embodiment described above, the first device 301 and the second device 302 are connected to each other via a network. If the first device 301 and the second device 302 are communicatively connected, the network format of the mobile network may be any one of 2G (gsm), 2.5G (gprs), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G + (LTE +), WiMax, and 5G.

According to a similar inventive concept, a method of recovering data of an exemplary embodiment of the present application. The method provided by the embodiment of the application is executed by a computing device, such as a server. As shown in fig. 4, the method 400 includes the steps of:

401: and storing the write data in the remote memory node to the storage device.

402: second positioning information is generated and stored.

And the second positioning information is used for positioning the write data stored in the storage device.

403: and under the condition that the remote memory node is abnormal, recovering the written data which is not written into the storage equipment in the remote memory node according to the record information and the second positioning information.

Specifically, storing write data in the remote local memory to the storage device includes: writing the corresponding memory page in the remote memory node where the written data is in into the remote linked list; and storing the corresponding memory pages to the storage equipment through a remote linked list.

Specifically, the generating and storing the second positioning information includes: determining second positioning information according to the memory page written into the storage equipment; and storing the second positioning information into the storage device.

Specifically, according to the record information and the second positioning information, recovering the written data that is not written in the storage device in the remote memory node includes: reading a modification operation log and second positioning information in the storage device; and determining the unwritten written data according to the second positioning information, and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log so as to enable the recovered written data to wait for being stored in the storage device.

It should be noted that, since the embodiments of steps 401-403 are similar to the embodiments of the method 200 described above, the detailed description thereof is omitted here.

For the detailed description of the method 400, reference is made to the above description.

Fig. 5 is a schematic structural framework diagram of a data recovery apparatus according to an exemplary embodiment of the present application. The apparatus 500 may be applied to a server. The apparatus 500 comprises: a generating module 501, a writing module 502 and a recovering module 503; the following detailed description is directed to the functions of the various modules:

the generating module 501 is configured to write data into a local memory node, and generate and store record information for recording a write operation according to a corresponding write operation.

The writing module 502 is configured to write the write data in the local memory node into the remote memory node.

The generating module 501 is configured to generate and store first positioning information, where the first positioning information is used to position data written in a remote memory node.

The recovery module 503 is configured to, when the compute node is abnormal, recover, according to the first positioning information and the record information, the write data that is not written in the remote memory node in the local memory node.

Wherein the compute node is located locally.

Specifically, the generating module 501 includes: the modification unit is used for receiving the data modification request and modifying the corresponding data in the corresponding memory page in the local memory node according to the modification request; and the generating unit is used for generating a modification operation log aiming at the modification operation of the corresponding data and storing the modification operation log.

Specifically, the generating unit is configured to store the modification operation log in a log cache, and store the modification operation log in the storage device through the log cache.

Specifically, the writing module 502 includes: the write-in unit is used for writing the corresponding memory page in the local memory node where the write-in data is located into the local linked list; and the first writing unit is used for writing the corresponding memory page into the remote memory node through the local linked list.

Specifically, the generating module 501 includes: the determining unit is used for determining first positioning information according to the memory page written into the remote memory node; the first storage unit is used for storing the first positioning information into the remote memory node.

Specifically, the recovery module 503 includes: a reading unit, configured to read the first positioning information in the remote memory node and read a modification operation log in the storage device; and the recovery unit is used for determining the unwritten write-in data according to the first positioning information and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log so as to enable the recovered write-in data to wait to be written into the remote memory node.

In addition, the apparatus 500 further comprises: the storage module is used for storing the write-in data in the remote memory node to the storage device; a generating module 501, configured to generate and store second positioning information, where the second positioning information is used to position data written in a storage device; the recovery module 503 is configured to, when the remote memory node is abnormal, recover, according to the record information and the second positioning information, the write data that is not written in the storage device in the remote memory node.

Specifically, the memory module includes: the second writing unit is used for writing the corresponding memory page in the remote memory node where the written data is located into the remote linked list; and the second storage unit is used for storing the corresponding memory pages to the storage equipment through the remote linked list.

Specifically, the determining unit is configured to determine the second positioning information according to the memory page written in the storage device; and the first storage unit is used for storing the second positioning information into the storage device.

Specifically, the reading unit is configured to read a modification operation log and second positioning information in the storage device; and the recovery unit is used for determining the unwritten written data according to the second positioning information and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log so as to enable the recovered written data to wait for being stored in the storage device.

For the content of the apparatus 500 that is not detailed above, reference is made to the above description, and thus, the description is not repeated.

While the internal functions and structures of the apparatus 500 shown in FIG. 5 are described above, in one possible design, the structures of the apparatus 500 shown in FIG. 5 may be implemented as a computing device, such as a server. As shown in fig. 6, the apparatus 600 may include: a memory 601, a processor 602;

the memory 601 is used for storing computer programs.

A processor 602 for executing a computer program for: writing data into the local memory node, generating and storing record information for recording the write-in operation by corresponding write-in operation; generating and storing first positioning information, wherein the first positioning information is used for positioning written data written into a remote memory node; and under the condition that the computing node is abnormal, recovering the written data which is not written into the remote memory node in the local memory node according to the first positioning information and the recording information.

Specifically, the processor 602 is specifically configured to: receiving a data modification request, and modifying corresponding data in a corresponding memory page in a local memory node according to the modification request; and generating a modification operation log aiming at the modification operation of the corresponding data, and storing the modification operation log.

Specifically, the processor 602 is specifically configured to: and storing the modification operation log into a log cache, and storing the modification operation log into a storage device through the log cache.

Specifically, the processor 602 is specifically configured to: writing the corresponding memory page in the local memory node where the written data is located into a local linked list; and writing the corresponding memory page into the remote memory node through the local linked list.

Specifically, the processor 602 is specifically configured to: determining first positioning information according to the memory page written into the remote memory node; and storing the first positioning information into a remote memory node.

Specifically, the processor 602 is specifically configured to: reading the first positioning information in the remote memory node and reading a modification operation log in the storage device; and determining unwritten write-in data according to the first positioning information, and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log so as to enable the recovered write-in data to wait to be written into the remote memory node.

Further, the processor 602 is further configured to: storing the write-in data in the remote memory node to a storage device; generating and storing second positioning information, wherein the second positioning information is used for positioning the written data stored in the storage equipment; and under the condition that the remote memory node is abnormal, recovering the written data which is not written into the storage equipment in the remote memory node according to the record information and the second positioning information.

Specifically, the processor 602 is specifically configured to: writing the corresponding memory page in the remote memory node where the written data is in into the remote linked list; and storing the corresponding memory pages to the storage equipment through a remote linked list.

Specifically, the processor 602 is specifically configured to: determining second positioning information according to the memory page written into the storage equipment; and storing the second positioning information into the storage device.

Specifically, the processor 602 is specifically configured to: reading a modification operation log and second positioning information in the storage device; and determining the unwritten written data according to the second positioning information, and recovering the unwritten data in a corresponding memory page in the local memory node according to the modification operation log so as to enable the recovered written data to wait for being stored in the storage device.

In addition, embodiments of the present invention provide a computer storage medium, where the computer program, when executed by one or more processors, causes the one or more processors to implement the steps of a method for recovering data in the method embodiments of fig. 1-2.

Further, embodiments of the present invention provide a computer program product comprising a computer program or instructions, wherein the computer program, when executed by a processor, causes the processor to carry out the steps of a method for recovering data in the method embodiments of fig. 1-2.

In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 101, 102, 103, etc., are merely used for distinguishing different operations, and the sequence numbers do not represent any execution order per se. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.

The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.

Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course, can also be implemented by a combination of hardware and software. With this understanding in mind, the above-described aspects and portions of the present technology which contribute substantially or in part to the prior art may be embodied in the form of a computer program product, which may be embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including without limitation disk storage, CD-ROM, optical storage, and the like.

The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable multimedia data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable multimedia data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable multimedia data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable multimedia data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.

Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种数据备份方法、网络节点及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!