Data recovery method and computing device
Patent Information
- Application Number
- CN202310085772.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-11
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-01-11
AI Technical Summary
[0005]本申请实施例提供一种数据恢复方法及计算设备,用以解决现有技术中系统资源开销大,影响存储性能的技术问题
[0013]第三方面,本申请实施例提供了一种计算机存储介质,存储有计算机程序,所述计算机程序被计算机执行时实现如上述第二方面所述的数据恢复方法。
Smart Images

Figure CN116302683B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data recovery method and a computing device. Background Technology
[0002] To maximize storage performance, distributed storage systems typically employ a tiered, pooled storage approach, setting up two data pools. Data is written to both data pools in parallel and synchronously. One data pool can be implemented using low-latency storage media to reduce write latency and improve write performance, while the data can ultimately be stored in the other data pool.
[0003] By employing a parallel synchronous write mechanism, if a write operation fails in one data pool but succeeds in another, such as when the write operation to the actual storage data pool fails, data recovery can be performed based on the data written to the other data pool.
[0004] Existing data recovery methods typically employ in-situ retry writes, overwriting the faulty location with data read from another data pool. However, the storage media used by the data pool may not support overwrites, leading to data recovery failure. Therefore, a method can be used to read multiple data points from the entire storage area, modify these multiple data points based on data from another data pool, and then write the entire data point back to the storage area. However, this process is very complex, has huge overhead, and impacts storage performance. Summary of the Invention
[0005] This application provides a data recovery method and computing device to solve the technical problem of high system resource consumption and impact on storage performance in the prior art.
[0006] In a first aspect, embodiments of this application provide a data recovery method, including:
[0007] The target data was determined to have failed to be written to the first data pool;
[0008] The target data is obtained from the second data pool;
[0009] The target data is reallocated to a first storage address in the first data pool;
[0010] The target data is written to the first data pool according to the reallocated first storage address.
[0011] Secondly, embodiments of this application provide a computing device, including a processing component and a storage component;
[0012] The storage component stores one or more computer instructions; the one or more computer instructions are invoked and executed by the processing component to implement the data recovery method as described in the first aspect above.
[0013] Thirdly, embodiments of this application provide a computer storage medium storing a computer program, which, when executed by a computer, implements the data recovery method described in the second aspect above.
[0014] In this embodiment, if writing to the first data pool fails, the target data can be read from the second data pool. Then, a first storage address is reallocated to the target data in the first data pool, and the target data is written back to the first data pool according to the newly allocated first storage address. By rewriting the target data to the newly allocated first storage address in the first data pool, the data recovery process is simplified, system resource overhead is reduced, and storage performance can be improved.
[0015] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 The diagram illustrates a system structure in which the technical solution of this application is applicable to one of the embodiments;
[0018] Figure 2 A flowchart of one embodiment of a data recovery method provided in this application is shown;
[0019] Figure 3 This illustration shows a data recovery operation diagram in a practical application based on an embodiment of this application;
[0020] Figure 4 This illustration shows an address setting diagram of an embodiment of this application in a practical application;
[0021] Figure 5 A flowchart of yet another embodiment of the data recovery method provided in this application is shown;
[0022] Figure 6 This invention provides a schematic diagram of the structure of one embodiment of a data recovery apparatus.
[0023] Figure 7 A schematic diagram of one embodiment of a computing device provided in this application is shown. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0025] In some of the processes described in the specification, claims, and accompanying drawings of this application, multiple operations appearing in a specific order are included. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not themselves represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.
[0026] The technical solutions of this application embodiment can be applied to storage systems that provide distributed storage. Distributed storage is widely used due to its advantages such as horizontal scaling architecture and high data availability, especially by various cloud service providers.
[0027] Traditional distributed storage suffers from long I / O (Input / Output) paths and significant latency. However, advancements in storage media in recent years, such as NAND flash memory (a superior storage device compared to hard drives) and phase-change memory, have led to their widespread adoption in storage services. Leveraging the advantages of these new storage technologies—low read / write latency and high throughput—write caching can be integrated into the data storage path. This write cache, optimized for append-only writes, maximizes storage performance through sequential writing, resulting in tiered storage architectures. Furthermore, to reduce costs, improve deployment flexibility, and enhance system performance and stability, tiered pooled storage has been proposed. This approach involves setting up two independent data pools, with data written to both pools in parallel and synchronously. This reduces bandwidth overhead. Assuming the two pools are designated as the first and second data pools, the first pool stores the actual data, while the second pool utilizes a lower-latency storage medium. Both approaches can meet the requirements of distributed storage. Compared to traditional write caching, the second data pool possesses distributed global attributes, ensuring persistent data storage and mitigating single points of failure. In addition, the second data pool can decouple throughput from capacity binding, enabling high throughput performance with high-performance media.
[0028] In the process of developing this application, the inventors discovered that, because data is written to both a first data pool and a second data pool in parallel and synchronously, if the first data pool is successfully written to, the data in the second data pool can be deleted to free up storage space for subsequent data writing. Under the parallel synchronous writing mechanism, if the first data pool fails to write, the second data pool is likely to have already been successfully written to due to its lower write latency. When recovering data from the first data pool, the corresponding data can be located and read from the second data pool. However, if an overwrite method is used, the storage medium used by the data pool, such as the novel storage medium described above, may not support overwrite, leading to data recovery failure. Therefore, the common approach is to read multiple data points from the storage area where the data resides, modify these multiple data points based on data from another data pool, and then write the entire dataset back to the storage area. This process is extremely complex, inefficient, and impacts storage performance.
[0029] In order to solve the technical problems of complex data recovery processes and high costs, which affect storage performance, the inventors have proposed the technical solution of this application after a series of studies.
[0030] To facilitate understanding of the technical solution of this application, the technical terms that may be involved in this application will be explained below:
[0031] Append write: A data writing method that adds new data to the existing data.
[0032] Overwrite: A data writing method in which the currently written data overwrites the corresponding data that has already been written.
[0033] Sequential write: refers to a data writing method in which multiple write operations are performed at consecutive positions. When appending to a data file at consecutive positions, it is called sequential write.
[0034] Metadata: Data that describes data attributes, such as storage address, data combination method, write time, modification time, etc.
[0035] Storage medium: The hardware device used to store data in a storage system. Data ultimately needs to be written into the storage device, which can refer to storage media such as disks.
[0036] Distributed storage refers to data being stored across multiple independent storage nodes. Storage systems providing distributed storage employ a scalable system architecture, utilizing multiple storage nodes to share the storage load, thus improving system reliability, availability, and access efficiency, and also facilitating expansion.
[0037] Data Pool: A distributed storage system consisting of multiple storage media capable of persistently storing data. This application embodiment involves two data pools. For example, the first data pool can actually store the data, and the data is ultimately stored in the first data pool; therefore, it can also be called the flush pool. The second data pool uses storage media with lower write latency. To improve data write performance, data is continuously written to the second data pool in an append-only manner; since this is the same as the log data write method, it can also be called the log pool. The first data pool can possess characteristics such as large data storage capacity, full lifecycle data storage, and random access data source, meeting the performance, stability, reliability, and availability requirements of distributed storage.
[0038] In this embodiment, if writing to the first data pool fails, target data can be read from the second data pool. Then, the target data is inserted into the data stream to be written in the first data pool, and a new first storage address is allocated for the target data in the first data pool. The target data is then written to the first data pool according to the newly allocated first storage address. By rewriting the target data as new data to the newly allocated first storage address in the first data pool, the data recovery process is simplified, system resource overhead is reduced, and storage performance can be improved.
[0039] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0040] Figure 1 The diagram illustrates a system architecture in which the technical solution of this application can be applied. This system architecture may include a storage system 100, which may be in the form of a cluster and has a first data pool 101 and a second data pool 102. In addition, the storage system 100 may also include a storage engine 103 responsible for data management and other operations.
[0041] In addition, the system architecture may also include a data access party 104, which may be a front-end application, while the storage system serves as a back-end storage cluster to provide data access capabilities, etc.
[0042] Both the first data pool 101 and the second data pool 102 can adopt a distributed storage architecture, consisting of multiple storage nodes, each of which can be implemented as a storage medium, etc.
[0043] The second data pool 102 can use a high-speed storage medium with lower write latency. The first data pool 101 and the second data pool 102 adopt a parallel synchronous write mechanism. In most cases, the second data pool 102 will be written successfully first. If the first data pool is also written successfully, the data in the second data pool can be deleted to free up storage space in the second data pool for subsequent data writing.
[0044] When the data access party acts as a front-end application, it can be a browser, an app (application), a web application such as an H5 (HyperText Markup Language 5) application, a lightweight application (also known as a mini-program), or a cloud application. It can be deployed on electronic devices and depends on the device's operation or certain apps on the device to run. Electronic devices can have displays and support information browsing, such as personal mobile terminals like smartphones, tablets, personal computers, desktop computers, smart speakers, smartwatches, etc.
[0045] In a practical application, the technical solution of this application embodiment can be applied to a cloud computing scenario. The first data pool and the second data pool described above can provide cloud storage, and the storage engine can be implemented as a cloud server, for example.
[0046] It should be noted that the embodiments of this application may involve the use of user data. In practical applications, user-specific personal data may be used in the scheme described herein within the scope permitted by applicable laws and regulations, provided that it complies with the applicable laws and regulations of the country (e.g., with the user's explicit consent, with the user being properly notified, etc.).
[0047] The implementation details of the technical solutions in the embodiments of this application are described in detail below.
[0048] Figure 2 This application provides a flowchart of a data recovery method according to one embodiment. The technical solution of this embodiment can be executed by the storage engine in the above system architecture. The method may include the following steps:
[0049] 201: The target data was determined to have failed to be written to the first data pool.
[0050] The target data is written to the first data pool and the second data pool in parallel and synchronously. An error will be reported if the writing fails, so it can be determined whether the target data failed to be written to the first data pool.
[0051] Both the first and second data pools can be written sequentially using an append-only method, and the target data can be any data written by the data access request.
[0052] 202: Read the target data from the second data pool.
[0053] Since the second data pool has a high probability of having been successfully written to even if the first data pool fails to write, in this embodiment, the target data can be obtained from the second data pool if the first data pool fails to write to it.
[0054] 203: Reallocate a first storage address for the target data in the first data pool;
[0055] 204: Write the target data into the first data pool according to the reallocated first storage address.
[0056] In order to write the target data into the first data pool, in this embodiment of the application, the first storage address can be reallocated in the first data pool instead of using the old address corresponding to the write failure. Therefore, compared with the traditional method, this embodiment of the application decouples data writing and fault handling by resending the same target data to the rearranged storage location, simplifies the management and control process, standardizes traffic allocation, overcomes congestion with predictable bandwidth resource allocation, and ensures QoS (Quality of Service) and other performance.
[0057] Since the first data pool simultaneously receives other data requests from data access providers, the target data can be added as a new data block to the data stream to be written. Based on the insertion position, the target data, along with other data, can be sequentially written into the first data pool. Before data in the data stream is written to the first data pool, storage addresses are allocated within it. The insertion position determines the order of the target data in the data stream; this order can serve as either the address allocation order or the data writing order. Therefore, each piece of data in the data stream can be allocated a first storage address and written to the first data pool according to this order, achieving the goal of writing the target data to the first data pool. Alternatively, after allocating a first storage address to each piece of data in the data stream, it can be written to the first data pool. Or, multiple pieces of data in the data stream can be allocated first storage addresses and then written to the first data pool sequentially according to their respective order of arrangement, achieving the goal of writing the target data to the first data pool. The first storage addresses corresponding to different pieces of data in the data stream can be arranged according to their respective sorting order within the data stream to ensure continuous write positions and achieve sequential writing. In summary, in some embodiments, the method may further include: inserting the target data into the data stream to be written in the first data pool.
[0058] Optionally, the above-mentioned reallocation of the first storage address for the target data in the first data pool can be: obtaining the target data from the first data stream according to the insertion position; and reallocating the first storage address for the target data in the first data pool. This can be achieved by obtaining the target data from the first data stream according to the order in which the insertion position corresponds to the arrangement in the data stream.
[0059] Optionally, writing the target data into the first data pool according to the reallocated first storage address can be: writing the target data into the first data pool according to the reallocated first storage address and the arrangement order corresponding to the insertion position in the data stream.
[0060] Before data is written to the first data pool and the second data pool, a storage address is allocated in the first data pool and a storage address is allocated in the second data pool. Rewriting the target data to the first data pool also reallocates a storage address. Therefore, in some embodiments, after the target data is successfully written to the first data pool, the first storage address corresponding to the failed write operation in the first data pool can be deleted.
[0061] In some embodiments, inserting the target data into the data stream to be written in the first data pool can be done by inserting the target data into the data stream to be written in the order of receipt time.
[0062] The receiving time can refer to the time of the write request or the time when data enters the storage engine, etc.
[0063] To facilitate understanding of the data recovery process in the embodiments of this application, such as Figure 3 In the data recovery operation diagram shown, storage engine 103 can receive requests to write multiple data items. These multiple data items can be arranged in chronological order of receipt to form the data stream to be written corresponding to the first data pool 101. Assume the target data is... Figure 3 For ease of distinction, previously written data B is described as data B1, and rewritten data B is described as data B2, where B1 = B2 = B. The format after sequential data writing is AB1CD. If writing data B1 to the first data pool fails, data B2 can be retrieved from the second data pool 102. Data B2 is considered new data upon entering the storage engine and inserted into the data stream. Assuming the insertion position is determined based on the reception time, data B2 is located after data E and before data F. Therefore, data B2 can be rewritten to the first data pool according to the insertion position, resulting in a format of EB2FG.
[0064] In some embodiments, reading target data from a second data pool may include:
[0065] The first storage address corresponding to the target data in the first data pool is determined.
[0066] Determine the second storage address in the second data pool corresponding to the first storage address;
[0067] Based on the second storage address, the target data is read from the second data pool.
[0068] The first storage address and the second storage address can have an address mapping relationship. By finding this address mapping relationship, the second storage address corresponding to the first storage address can be determined.
[0069] The first storage address corresponding to the target data in the first data pool can refer to the first storage address allocated in the most recent allocation operation before the reallocation operation.
[0070] Furthermore, since the storage address is stored in the metadata, the metadata of the first data pool and the metadata of the second data pool can have a corresponding address mapping relationship based on the data identifier. Therefore, the second storage address corresponding to the first storage address can also be determined by looking up the metadata.
[0071] In addition, the first data pool and the second data pool can also manage metadata in a unified manner. The metadata includes the first storage address in the first data pool and the second storage address in the second data pool, so that the second storage address corresponding to the first storage address can be quickly determined by looking up the metadata.
[0072] Furthermore, to improve address determination efficiency, the address format of the second storage address corresponding to the second data pool may include a node identifier, a starting address, and an address offset; therefore, in some embodiments, reading target data from the second data pool based on the second storage address may include:
[0073] Based on the second storage address, determine the storage node corresponding to the node identifier;
[0074] Read the target data from the storage location corresponding to the starting address and the address offset.
[0075] The corresponding storage node can be located based on the node identifier, and the corresponding storage location can be determined based on the starting address and address offset, so that the target data can be read from the storage location.
[0076] Here, the starting address can refer to the starting address of a data segment in the storage node where the target data is requested to be written, and the offset address is the offset of the target data relative to the starting address. The storage location of the target data can be the starting address plus the offset address. For example... Figure 4In the address format diagram shown, the second storage address may include a node identifier, a starting address, and an offset address. The first storage address and the second storage address can establish a quick mapping relationship based on their respective metadata.
[0077] As described above, the first storage address and the second storage address can have a corresponding address mapping relationship. Therefore, in some embodiments, the method may further include:
[0078] Update the address mapping relationship based on the newly allocated first storage address.
[0079] In addition, in some embodiments, the method may further include:
[0080] After the target data is successfully written to the first data pool, the first storage address corresponding to the target data when writing to the first data pool failed is deleted from the first data pool.
[0081] Optionally, the deleted first storage address can also be recycled. Specifically, after the target data is successfully written into the first data pool, the deleted first storage address can be recycled so that the first storage address can be used to continue storing data.
[0082] In addition, to facilitate address reclamation, some embodiments of the method may further include:
[0083] Set an invalidation flag for the first storage address corresponding to the target data when writing to the first data pool fails;
[0084] Alternatively, after the target data is successfully written to the first data pool, the first storage address with the invalidation flag can be reclaimed.
[0085] In combination with the above Figure 3 The diagram shown illustrates the data recovery operation. After B2 is successfully written, the storage address corresponding to B1 can be deleted, and the deleted address can be reused.
[0086] In some embodiments, before determining that the target data has failed to be written to the first data pool, the method may further include:
[0087] For the target data to be written, allocate a first storage address for the target data in the first data pool;
[0088] Determine whether the target data originates from the second data pool;
[0089] If so, write the target data into the first data pool according to the first storage address;
[0090] If not, allocate a second storage address for the target data in the second data pool, and write the target data into the first data pool and the second data pool respectively based on the first storage address and the second storage address.
[0091] In other words, the target data to be written may originate from the second data pool, be data requested for recovery, be data requested by the user, or be data recovered from other channels. Therefore, before performing the write operation, it can be first determined whether the data originates from the second data pool. If it does, the target data does not need to be written to the second data pool; it only needs to be written to the first data pool. If it does not originate from the second data pool, it needs to be written to both the first and second data pools.
[0092] In the above description, the target data is written into the first data pool according to the reallocated first storage address. Alternatively, it can be determined first whether the target data comes from the second data pool. If so, the target data is then written into the first data pool according to the reallocated first storage address.
[0093] Since the target data may also fail to be written to the second data pool or may have been deleted, in order to recover the data, the target data can be obtained from the upstream and downstream backup data, including the backup data in the data access party. Therefore, in some embodiments, the method may further include: if the target data fails to be obtained from the second data pool, obtaining the target data from the data access party; and writing the target data into the first data pool.
[0094] In addition, if it is determined that the write to the second data pool has failed, the target data obtained from the data accessor can be written to both the first and second data pools in parallel and synchronously.
[0095] In some embodiments, the method may further include:
[0096] If the target data fails to be retrieved from the second data pool, an error message will be output.
[0097] This fault message can be used to indicate a fault in the second data pool, etc.
[0098] The output of fault prompt information can be either displaying fault prompt information or sending fault prompt information to a communication account, such as an email account or an instant messaging account.
[0099] Furthermore, to facilitate data access, before secure storage in the first data pool, read requests can be directed to the first data pool for access. Therefore, in some embodiments, the method may further include:
[0100] Receive a read request for the target data; determine whether the target data has been successfully written to the first data pool; if yes, access the first data pool to read the target data; if no, access the second data pool to read the target data.
[0101] In some embodiments, to improve data security, inserting the target data into the data stream to be written in the first data pool may include: performing data verification on the target data; after successful verification, inserting the target data into the data stream to be written in the first data pool. The data verification may employ verification methods such as CRC checksum, and this application does not limit the specific methods used.
[0102] Figure 5 A flowchart illustrating yet another embodiment of a data recovery method provided in this application is provided. The method may include the following steps:
[0103] 501: For the target data to be written, allocate a first storage address for the target data in the first data pool.
[0104] 502: Determine whether the target data comes from the second data pool; if yes, proceed to step 503; otherwise, proceed to step 504.
[0105] If the target data originates from the second data pool, it indicates that the target data is rewritten data. In this case, it can be written to the second data pool according to the first storage address. The target data is retrieved from the second data pool and can be inserted into the data stream to be written. Based on the order of each data in the data stream, storage addresses can be allocated to each data in turn to ensure sequential writing. This order can be determined according to the sequence of reception times, etc. The reception time can refer to the time when each piece of data enters the storage engine.
[0106] Specifically, data obtained from the second data pool can be marked with a specific tag to determine whether the target data originates from the second data pool.
[0107] If the target data does not originate from the second data pool, it may be data requested to be written by the data accessor or target data obtained from upstream or downstream backup data. Upstream and downstream backup data may include, for example, backup data from the data accessor.
[0108] Data from the data accessor, backup data, and the second data pool can be arranged in chronological order of receipt to form a data stream to be written. Storage addresses can be allocated to each data item based on its order in the data stream.
[0109] 503: Write to the second data pool according to the first storage address.
[0110] 504: Allocate a second storage address for the target data in the second data pool, and write the target data into the first data pool and the second data pool respectively based on the first storage address and the second storage address.
[0111] The target data can be written to the first data pool and the second data pool in parallel and synchronously. Alternatively, the target data can be written to the first data pool and the second data pool sequentially using an append-only method.
[0112] 505: Determine if the target data has been successfully written to the first data pool. If yes, the process can end; otherwise, proceed to step 506.
[0113] 506: Set an invalid flag for the first memory address.
[0114] 507: Determine the second storage address corresponding to the first storage address, and obtain the target data from the second data pool based on the second storage address.
[0115] The second storage address can use a concise address format of node identifier, starting address, and offset address to quickly find the target data, thereby simplifying the address lookup method.
[0116] The first storage address and the second storage address have an address mapping relationship. After the target data comes from the second data pool and the first storage address is reallocated to the target data, the address mapping relationship can be updated based on the reallocated first storage address.
[0117] 508: Was the data retrieved from the second data pool successfully? If yes, proceed to step 509; otherwise, proceed to step 511.
[0118] 509: Insert the target data into the data stream to be written in the first data pool.
[0119] 510: Determine the target data to be written according to the insertion position, and return to step 501 to continue execution.
[0120] The target data can be obtained from the data stream according to the order in which it is inserted.
[0121] 511: Obtain the target data from upstream and downstream backup data, and return to step 501 to continue execution.
[0122] If the second data pool fails to be retrieved, a fault message can also be output.
[0123] 512: After the target data is successfully written, the corresponding first storage address is reclaimed based on the invalidation flag.
[0124] Furthermore, if a read request for the target data is received before the first data pool is securely stored, the first data pool is accessed to read the target data if the target data is successfully written to the first data pool, and if the writing is unsuccessful, the second data pool is accessed to read the target data, thus guiding the data access to the second data pool.
[0125] In this embodiment, by embedding new data into the data stream to be written, traffic switching and impact on the current operation are avoided. The first serrated write is completed through address mapping and subsequent space reclamation. This simplifies the management and scheduling of write priorities in the first data pool, constructs a more storage-friendly IO feature, and ensures that data is sequentially flushed to the storage medium, leveraging the performance advantages of the storage medium during sequential operations. Both the first and second data pools can append write records, and the second data pool is highly coupled with the first data pool, simplifying the data query process and enabling rapid verification. This embodiment reduces system resource overhead, improves storage read / write performance, and ensures storage QoS stability.
[0126] Figure 6 This application provides a schematic diagram of the structure of a data recovery device according to one embodiment. The device may include:
[0127] The determination module 601 is used to determine that the target data failed to be written to the first data pool;
[0128] Data acquisition module 602 is used to acquire target data from the second data pool;
[0129] Address allocation module 603 is used to reallocate a first storage address for the target data in the first data pool;
[0130] The data recovery module 604 is used to write the target data into the first data pool according to the reallocated first storage address.
[0131] In some embodiments, the data acquisition module is specifically used to determine a first storage address corresponding to the target data in a first data pool; determine a second storage address corresponding to the first storage address; and read the target data from a second data pool based on the second storage address.
[0132] In some embodiments, the second storage address includes a node identifier, a starting address, and an offset address; based on the second storage address, the data acquisition module is specifically used to determine the storage node corresponding to the node identifier; and to read the target data from the storage location corresponding to the starting address and the offset address.
[0133] In some embodiments, the device may further include:
[0134] The data implantation module is used to insert the target data into the data stream to be written in the first data pool;
[0135] Specifically, the aforementioned data recovery module writes the target data into the first data pool according to the reallocated first storage address and the order in which the insertion position corresponds to the data stream.
[0136] In some embodiments, the device may further include:
[0137] The deletion module is used to delete the first storage address corresponding to the target data when the writing of the target data to the first data pool failed, after the target data has been successfully written to the first data pool.
[0138] In some embodiments, the device may further include:
[0139] The recycling module is used to set an invalidation flag for the first storage address corresponding to the target data when writing to the first data pool fails; after the target data is successfully written to the first data pool, the corresponding first storage address is recycled based on the invalidation flag.
[0140] In some embodiments, the determining module may specifically look up the address mapping relationship to determine the second storage address corresponding to the first storage address;
[0141] The address allocation module is also used to update the address mapping relationship based on the reassigned first storage address after the target data is reallocated to the first storage address in the first data pool.
[0142] In some embodiments, the device may further include:
[0143] The data writing module is used to allocate a first storage address for the target data to be written in the first data pool; determine whether the target data comes from the second data pool; if so, write it to the second data pool according to the first storage address; if not, allocate a second storage address for the target data in the second data pool, and write the target data to the first data pool and the second data pool respectively based on the first storage address and the second storage address.
[0144] In some embodiments, the data recovery module is also used to obtain the target data from the data access party if the target data fails to be obtained from the second data source; and to write the target data into the first data pool.
[0145] In some embodiments, the data implantation module may specifically insert the target data into the data stream to be written in the first data pool according to the order of receipt time.
[0146] In some embodiments, the device may further include:
[0147] The data access module is used to receive read requests for target data; determine whether the target data has been successfully written to the first data pool; if so, access the first data pool to read the target data; if not, access the second data pool to read the target data.
[0148] Figure 6 The data recovery device described above can perform... Figure 2 The implementation principle and technical effects of the data recovery method described in the illustrated embodiments will not be repeated here. The specific methods by which each module and unit of the data recovery device in the above embodiments performs its operations have been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0149] This application also provides a computing device, such as... Figure 7 As shown, the computing device may include a storage component 701 and a processing component 702;
[0150] Storage component 701 stores one or more computer instructions, wherein the one or more computer instructions are invoked and executed by processing component 702 to implement the data recovery method as described in any of the above embodiments.
[0151] Of course, computing devices may also include other components, such as input / output interfaces, display components, and communication components. Input / output interfaces provide an interface between processing components and peripheral interface modules, which can be output devices, input devices, etc. Communication components are configured to facilitate wired or wireless communication between the computing device and other devices.
[0152] The processing component may include one or more processors to execute computer instructions to complete all or part of the steps in the above-described method. Alternatively, the processing component may be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described method.
[0153] Storage components are configured to store various types of data to support operations on the terminal. Storage components can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0154] The display component can be an electroluminescent (EL) element, a liquid crystal display or a microdisplay with a similar structure, or a retina-direct display or a similar laser scanning display.
[0155] It should be noted that the aforementioned computing devices can be physical devices or elastic computing hosts provided by cloud computing platforms. They can be implemented as a distributed cluster composed of multiple servers or terminal devices, or as a single server or a single terminal device.
[0156] This application also provides a computer-readable storage medium storing a computer program that, when executed by a computer, can implement the data recovery method of any of the above embodiments. This computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device.
[0157] This application also provides a computer program product comprising a computer program carried on a computer-readable storage medium, which, when executed by a computer, can implement the data recovery method as described in any of the above embodiments. In such embodiments, the computer program may be downloaded and installed from a network, and / or installed from a removable medium. When the computer program is executed by a processor, it performs various functions defined in the system of this application.
[0158] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0159] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0160] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A data recovery method, characterized in that, A storage system for providing distributed storage, wherein the storage system employs a tiered, pooled storage approach, the method comprising: The target data is determined to have failed to be written to the first data pool but was successfully written to the second data pool; wherein, the data pool is a distributed storage system consisting of multiple storage media for persistent storage of data, the data pool does not support overwrite, and the write latency of the second data pool is lower than that of the first data pool. The target data is obtained from the second data pool; The target data is reallocated to a first storage address in the first data pool; The target data is written to the first data pool according to the reallocated first storage address.
2. The method according to claim 1, characterized in that, The step of obtaining the target data from the second data pool includes: The first storage address corresponding to the target data in the first data pool is determined; The first storage address is determined to correspond to the second storage address in the second data pool; Based on the second storage address, the target data is read from the second data pool.
3. The method according to claim 2, characterized in that, The second storage address includes a node identifier, a starting address, and an offset address; obtaining the target data from the second data pool based on the second storage address includes: Based on the second storage address, determine the storage node corresponding to the node identifier; The target data is read from the storage location corresponding to the starting address and the offset address.
4. The method according to claim 1, characterized in that, Also includes: Insert the target data into the data stream to be written in the first data pool; The step of writing the target data into the first data pool according to the reallocated first storage address includes: According to the reallocated first storage address, and based on the arrangement order corresponding to the insertion position in the data stream, the target data is written into the first data pool; The method further includes: After the target data is successfully written to the first data pool, the first storage address corresponding to the failure to write the target data to the first data pool is deleted.
5. The method according to claim 2, characterized in that, Determining the second storage address corresponding to the first storage address includes: Find the address mapping relationship to determine the second storage address corresponding to the first storage address; After reallocating the first storage address for the target data in the first data pool, the method further includes: The address mapping relationship is updated based on the newly allocated first storage address.
6. The method according to claim 1, characterized in that, After the method for determining the target data fails to write to the first data pool, it further includes: An invalidation flag is set for the first storage address corresponding to the failure to write the target data into the first data pool; After the target data is successfully written to the first data pool, the corresponding first storage address is reclaimed based on the invalidation flag.
7. The method according to claim 1, characterized in that, Before determining the target data before the first data pool write fails, the method further includes: For the target data to be written, a first storage address is allocated for the target data in the first data pool; Determine whether the target data originates from the second data pool; If so, write the target data into the first data pool according to the first storage address; If not, allocate a second storage address for the target data in the second data pool, and write the target data into the first data pool and the second data pool respectively based on the first storage address and the second storage address.
8. The method according to claim 1, characterized in that, Also includes: If the target data fails to be obtained from the second data source, the target data is obtained from the data accessor. The target data is written into the first data pool.
9. The method according to claim 4, characterized in that, The step of inserting the target data into the data stream currently being written to the first data pool includes: The target data is inserted into the data stream to be written in the first data pool according to the order of receipt time.
10. The method according to claim 1, characterized in that, Also includes: Receive a read request for the target data; Determine whether the target data has been successfully written to the first data pool; If so, access the first data pool to read the target data; If not, access the second data pool to read the target data.
11. A computing device, characterized in that, This includes processing components and storage components; The storage component stores one or more computer instructions; the one or more computer instructions are invoked and executed by the processing component to implement the data recovery method as described in any one of claims 1 to 10.
12. A computer storage medium, characterized in that, The device contains a computer program that, when executed by a computer, implements the data recovery method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Data storage method, device and system
CN108780386A
Time sequence database cluster data processing method and device, medium and electronic equipment
CN113778746A