A method and device for recovering a history version of a multi-version function, and a storage medium

By utilizing bucket index sharding and data header operations in the multi-version function, historical versions can be quickly restored, solving the problem of significant performance impact in existing technologies and achieving efficient historical version recovery.

CN115344549BActive Publication Date: 2025-10-17JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211032212.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-26
Publication Date
2025-10-17
Estimated Expiration
2042-08-26

AI Technical Summary

Technical Problem

The existing technology involves a large amount of data processing in the historical version recovery process of the multi-version function, which has a significant impact on the performance of the distributed storage system and consumes too many resources.

Method used

By obtaining the version number of the target version object, the basic information of the target actual object data is found using the key value index of the bucket index shard, and its modification time and the pointing status of the logical header are modified. At the same time, the additional attributes of the data header are updated in the data pool to avoid direct operation of the actual object data.

Benefits of technology

The function of quickly restoring historical versions is realized, which reduces the impact on performance and improves response speed and product competitiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115344549B_ABST
    Figure CN115344549B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of multi-version function recovery historical version method, device and storage medium.Recover the version number of the target version object pointed to, according to version number and object name by key value index to find the basic information of corresponding target actual object data, modify the modification time in the basic information of target actual object data as current time, the state of current latest version in the basic information of target actual object data is modified to be;Find the object logic head with object name as key, modify the actual version object pointed to by object logic head as target version object, set the state of current latest version in the basic information of actual version object originally pointed to by object logic head as false, indicating that actual version object originally pointed to is no longer current latest version;In data pool, modify the version number of object recorded in data total head additional attribute to the version number of target version object, realize multi-version function recovery historical version.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of realizing multi-version function to restore a history version, in particular to a method, device and storage medium for realizing multi-version function to restore a history version. BACKGROUND

[0002] With the development of the Internet, the amount of Internet data (unstructured data) is increasing, and distributed object storage emerges as the times require. This emerging storage method is suitable for the storage of unstructured data such as pictures and videos. It also has the characteristics of block storage high-speed direct access disk and file storage distributed sharing, so it has been widely developed and applied since its introduction.

[0003] By default, when the object storage uploads an object into the storage bucket, the actual data is stored in the data pool, and the basic information of the object is stored on the bucket index shard. The basic information is stored on the bucket index shard in the form of K-V structure of "object name-basic information". When a user queries or lists the objects in the storage bucket, the objects stored on the bucket index shard are searched or traversed, and the required results are returned to the user. Therefore, the main function of the bucket index shard is to query or list the objects. When a user deletes an object in the bucket, the process is roughly the opposite of uploading an object. The actual data in the data pool is deleted, and the basic information of the object on the bucket index shard is also deleted, thus completing the deletion process. The multi-version function of the storage bucket refers to the case where the multi-version function is enabled, and the user repeatedly uploads files with the same properties. For each upload of the same file, the RGW generates a different hash value as an identifier for distinguishing the versions of the same file, i.e., a version number. Similarly, when the multi-version function is enabled, the user deletes an object in the bucket, and the RGW writes a new version of the file index on the bucket index shard, but the index content is empty and does not have any actual data. It only serves as a marker to indicate that the same file in the bucket has been deleted, which is referred to as a delete marker. At this time, if the user wants to restore a historical version of the file to the latest version for normal read-write operations, the historical version recovery of the multi-version function is required. In the existing RGW, the historical version recovery often involves the processing of data, which has a large amount of data and occupies many resources when performing the historical version recovery, thus greatly affecting the performance of the distributed storage system. SUMMARY

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a method, device and storage medium for recovering a history version of a multi-version function.

[0005] In a first aspect, the present application provides a method for recovering a historical version of a multi-version function, comprising: obtaining a version number of a target version object pointed to by the recovery; finding basic information of a corresponding target actual object data through a key-value index of a bucket index slice according to an object name and the version number of the target version object; modifying a modification time in the basic information of the target actual object data to a current time; modifying a state of a current latest version in the basic information of the target actual object data to true; then finding an object logical head with the object name as a key, modifying an actual version object pointed to by the object logical head to the target version object, and setting a state of a current latest version in basic information of the actual version object originally pointed to by the object logical head to false, indicating that the actual version object originally pointed to is no longer the current latest version; and in a data pool, modifying a version number of an object recorded in an attached attribute of a data total head to the version number of the target version object.

[0006] Further, a historical version recovery request carrying the version number of the target version object is sent to an object storage gateway, and the object storage gateway parses the historical version recovery request to obtain the version number and the object name of the target version object pointed to by the recovery.

[0007] Further, for an object uploaded under a multi-version function opening condition, the object logical head and the data total head are logical objects corresponding to actual objects, and the logical objects are responsible for simultaneously pointing to corresponding version actual objects in terms of index and data.

[0008] Further, for an object uploaded under a multi-version function opening condition, an object logical head is written on a bucket index slice in an index pool, and the object logical head takes the object name as a key and takes an actual version object pointed to by the object logical head as a value.

[0009] Further, for an object uploaded under a multi-version function opening condition, actual object data of the object written in a data pool is named by an object name and a version number, and a multi-version data total head is written in the data pool, the data total head is used for managing multi-version actual object data, the data total head itself has no data and is an empty data block, and an attached attribute of the data total head records a version number of an object.

[0010] Further, a request for actual object data is first accessed to the data total head, and the actual object data corresponding to the version number of the object is oriented to through the version number of the object in the attached attribute of the data total head.

[0011] Further, for the uploaded object under the multi-version function enabled condition, the key-value index of the object is recorded in the bucket index shard in the index pool, the key-value index takes the object name and version number of the object as the key, and takes the basic information of the object data as the value, which is used for user query, listing index corresponding object, wherein the basic information includes modification time, whether the object is marked by the deletion flag, and whether the object is the current latest version.

[0012] Further, whether the target version object is deleted is judged by the deletion flag, if the target version object is deleted, whether to recover the target version object is prompted, and the target version object is taken as the object pointed by the recovery.

[0013] In the second aspect, the application provides a device for recovering a historical version under a multi-version function, comprising at least one processing unit, a storage unit and a bus unit, the bus unit is connected to the processing unit and the storage unit, the storage unit stores a computer program, and the computer program is executed by the processing unit to realize the method for recovering a historical version under a multi-version function.

[0014] In the third aspect, the application provides a storage medium for realizing a method for recovering a historical version under a multi-version function, the storage medium stores a computer program, and the computer program is executed by a processor to realize the method for recovering a historical version under a multi-version function.

[0015] Compared with the prior art, the above technical solution provided by the embodiments of the application has the following advantages:

[0016] When the historical version is recovered, the version number of the target version object pointed by the recovery is acquired, the basic information of the corresponding target actual object data is found through the key-value index of the bucket index shard according to the object name and version number of the target version object, the modification time in the basic information of the target actual object data is modified to the current time, and the state of the current latest version in the basic information of the target actual object data is modified to true; then the actual version object pointed by the object logical head is modified to the target version object, the state of the current latest version in the basic information of the actual version object originally pointed by the object logical head is set to false, indicating that the actual version object originally pointed is no longer the current latest version; in the data pool, the version number of the object recorded in the additional attribute of the data total head is modified to the version number of the target version object. The function of recovering the historical version is realized by operating the bucket index shard of the index pool and the additional attribute of the data total head in the data pool. Since the implementation only operates the specified bucket index shard and the additional attribute of the data total head, and does not involve the operation of the actual object data, the performance is less affected, the response speed is fast, and the product competitiveness can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0017] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings can also provide other drawings based on these drawings for those ordinarily skilled in the art without creative effort.

[0019] Figure 1 A flow chart of a method for recovering a history version by a multi-version function according to an embodiment of the present application is provided.

[0020] Figure 2 An architecture diagram of a method for recovering a history version by a multi-version function according to an embodiment of the present application is provided.

[0021] Figure 3 A flow chart of a processing procedure when a target version object is logically deleted according to an embodiment of the present application is provided.

[0022] Figure 4 A schematic diagram of an apparatus for recovering a history version by a multi-version function according to an embodiment of the present application is provided. DETAILED DESCRIPTION

[0023] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those ordinarily skilled in the art without creative effort belong to the scope of protection of the present application.

[0024] It should be noted that, in this document, the terms "comprising", "containing" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus including a list of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus including the element.

[0025] RGW (RADOS Gateway) is an object storage gateway in Ceph, which is a unified, distributed storage system with excellent performance, reliability and scalability. Ceph supports object storage (RGW), block storage (RBD) and file storage (CephFS). For RGW, it plays a HTTP server for upper-layer APP and a RADOS client for lower-layer RADOS cluster. RGW receives and parses HTTP client requests as a HTTP server, and provides a data storage channel for object storage applications as a RADOS client, processes application data requests and sends them to the RADOS cluster for storage. Specifically, the logical processing layer structure of RGW includes a HTTP front end, a REST API general processing layer, an API operation execution layer, a RADOS interface adaptation layer and a librados interface layer. The HTTP front end accepts request data and saves it in the corresponding data structure. The REST API general processing layer parses S3 or Swift data from the HTTP front end data structure and performs a series of checks. After the checks pass, different processing flows are executed according to different API operation requests. If data is obtained from or written to the RADOS cluster, the librados interface is called through the RADOS interface adaptation layer of RGW to send the request to the RADOS cluster to obtain or write data to the RADOS cluster.

[0026] The RGW provides three basic data logical entities externally: a user, a bucket, and an object, wherein the bucket is a container of the object and is a first-level management unit introduced for the convenience of management and operation of a same-named object. The bucket information includes basic information and extended information. The basic information is information concerned by the RGW and includes quota information (maximum object data or maximum object size sum) of the bucket, a bucket placement rule, a number of index objects in the bucket, and the like. The bucket placement rule includes an index pool, a bucket index shard, and the like. When an object storage creates a bucket, a certain number of bucket index shards (default 512, numbered 0-511) are created in the index pool. The bucket index shards mainly store key-value indexes of key-value structures, and the key in the key-value index is an object file name and the value is some basic information of the object file. The data on the bucket index shards is mainly used for querying and listing objects. When the object storage stores a file, the specific data of the file is stored in a data pool, and the object file name is calculated into a bucket index shard id through a hash calculation, and a corresponding key-value index record is added on the bucket index shard corresponding to the id. The data pool (data pool) stores all file data; the segmented upload data pool (data extra pool) stores some intermediate state data in the segmented upload process. These data can help users to resume and garbage data recovery.

[0027] Historical version: for the same-named files repeatedly uploaded multiple times, the last uploaded one is the latest version, and the rest are historical versions. Restoring the historical version means restoring the historical version to the current latest version. When a user accesses the file, the accessed file is the one that has been restored to the latest version.

[0028] Embodiment 1

[0029] Referring to FIGS. 1, 2, and 3, Figure 1 and Figure 2 The present application provides a method for restoring a historical version of a multi-version function, which comprises the following steps:

[0030] S100, when a historical version object is restored, the version number of a target version object pointed to by the restoration is acquired. Specifically, when a historical version object is restored, a user sends a historical version restoration request carrying a version number of a target version object to an object storage gateway through a client; the object storage gateway receives the historical version restoration request and parses the historical version restoration request to acquire the version number of the target version object pointed to by the restoration and an object name. For example, the version number of the target version object is 111111.

[0031] S200, find the basic information of the corresponding target actual object data according to the object name and version number of the target version object through the key-value index of the bucket index shard. Specifically, for the uploaded object under the condition that the multi-version function is enabled, record the key-value index of the object in the bucket index shard in the index pool, the key-value index takes the object name and version number of the object as the key, and takes the basic information of the object data as the value, which is used for user query and enumeration index corresponding to the object, wherein the basic information includes modification time, whether the object is marked by a deletion flag, and whether the object is the current latest version. The deletion flag is used to realize the logical deletion of the object. The version number 111111 and the object name obtained by parsing are used to find the basic information of the target actual object data corresponding to the version number 111111 through the key-value index of the index shard.

[0032] In the specific implementation process, referring to Figure 3 As shown in the figure, the basic information of the target actual object data is obtained, and it is detected whether the object is marked by a deletion flag in the basic information. If yes, it is judged that the target version object is logically deleted. If the target version object is logically deleted, it is prompted through an information box whether to restore the target version object. If yes is selected through the information box, the deletion flag of the target version object is deleted, and the target version object is taken as the object pointed to by the restoration. If no is selected through the information box, the termination of taking the target version object as the object pointed to by the restoration.

[0033] S300, modify the modification time in the basic information of the target actual object data to the current time, and modify the current latest version state in the basic information of the target actual object data to true.

[0034] S400, and then find the object logical header with the object name as the key, modify the actual version object pointed to by the object logical header to the target version object, set the current latest version state in the basic information of the actual version object originally pointed to by the object logical header to false, indicating that the actual version object originally pointed to is no longer the current latest version. Write the modification of the bucket index shard back to the bucket index shard.

[0035] In the specific implementation process, for the uploaded object under the condition that the multi-version function is enabled, write the object logical header on the bucket index shard in the index pool, and the object logical header takes the object name as the key and takes the actual version object pointed to by the object logical header as the value. When the user accesses the object without specifying the version number, the object logical header is accessed, and then the object pointed to by the logical header is accessed. The object name in the historical version recovery request is used to find the corresponding object logical header, modify the object with the version number 111111 pointed to by the object logical header, and set the current latest version state in the basic information of the object with the version number 222222 originally pointed to by the object logical header to false.

[0036] S500, in the data pool, the version number of the object recorded in the additional attribute of the data header is modified to the version number of the target version object. Specifically, for the uploaded object under the condition that the multi-version function is enabled, the actual object data of the object written in the data pool is named by the object name and the version number, and the multi-version data header is written in the data pool, the data header is used for managing the multi-version actual object data, the data header itself has no data and is a null data block, and the additional attribute of the data header records the version number of the object. In the data pool, the version number in the additional attribute of the data header is modified to 111111.

[0037] After the modification is completed, the client is notified of the result of the multi-version function recovery of the historical version.

[0038] For the uploaded object under the condition that the multi-version function is enabled, the object logical header and the data header are logical objects corresponding to the actual object, the logical object is responsible for simultaneously pointing to the corresponding version actual object in terms of index and data. The request access to the actual object data is first accessed to the data header, and the version number of the object in the additional attribute of the data header is used to direct to the actual object data corresponding to the version number of the object.

[0039] Embodiment 2

[0040] Referring to Figure 4 As shown in the figure, the embodiment of the application provides a device for realizing multi-version function recovery of a historical version, which comprises at least one processing unit, a storage unit and a bus unit, the bus unit is connected to the processing unit and the storage unit, the storage unit stores a computer program, and the computer program is executed by the processing unit to realize the method for realizing multi-version function recovery of a historical version.

[0041] Embodiment 3

[0042] The embodiment of the application provides a storage medium for realizing a method for realizing multi-version function recovery of a historical version, the storage medium stores a computer program, and the computer program is executed by a processor to realize the method for realizing multi-version function recovery of a historical version.

[0043] The application obtains the version number of the target version object pointed by the recovery when performing the recovery history version, finds the basic information of the corresponding target actual object data through the key value index of the bucket index slice according to the object name and the version number of the target version object, modifies the modification time in the basic information of the target actual object data to the current time, modifies the state of the current latest version in the basic information of the target actual object data to true; then modifies the actual version object pointed by the object logical head to the target version object, sets the state of the current latest version in the basic information of the actual version object originally pointed by the object logical head to false, indicating that the actual version object originally pointed is not the current latest version; in the data pool, modifies the version number of the object recorded in the additional attribute of the data total head to the version number of the target version object. The functions of the recovery history version are realized by operating the bucket index slice of the index pool and the additional attribute of the data total head, the performance is less affected, the response speed is fast, and the product competitiveness can be improved.

[0044] In several embodiments provided by the present application, it should be understood that the disclosed modules and units can be implemented in other manners. For example, the described embodiments of the structure are merely schematic; the division of the units is only a logical function division; there can be another division manner in actual implementation; for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, and electrical, mechanical or other forms.

[0045] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments of the present application.

[0046] In addition, each functional unit in the embodiments of the present application can be integrated in one processing unit, or each unit can exist physically as a separate unit, or two or more units can be integrated in one unit.

[0047] Although the present application has been described in detail with reference to the preferred embodiments, it should be understood that the application is not limited to those preferred embodiments. Various equivalent modifications or changes in the application can be made all of which fall within the scope of the present application. Any modifications or changes in the application should be construed as falling within the scope of the present application. The scope of the application should be determined by the appended claims.

Claims

1. A method for restoring historical versions using a multi-version function, characterized in that: include: For objects uploaded with the multi-version function enabled, the object logical header and the data header are logical objects corresponding to the actual objects. The logical objects are responsible for pointing to the actual objects of the corresponding versions in terms of both index and data. For objects uploaded with the multi-version function enabled, the object logical header is written on the bucket index shard in the index pool. The object logical header uses the object name as the keyword and the actual version object pointed to by the object logical header as the value. For objects uploaded with the multi-version function enabled, all actual object data exists in the data pool. The actual object data of the objects written to the data pool is named with the object name and version number, and a multi-version data header is written to the data pool at the same time. The data header is used to manage multiple versions of actual object data. The data header itself contains no data and is an empty data block. The version number of the object is recorded in the additional attributes of the data header. Obtain the version number of the target version object to be restored. Find the basic information of the corresponding target actual object data through the key-value index of the bucket index shard based on the object name and version number of the target version object. For objects uploaded with the multi-version function enabled, record the object's key-value index in the bucket index shard in the index pool. The key-value index uses the object name and version number as keywords and the basic information of the object data as values. This is used for users to query and list the objects corresponding to the index. The basic information includes modification time, whether the object is deleted, and whether the object is the latest version. Modify the modification time in the basic information of the target actual object data to the current time, and modify the status of the current latest version in the basic information of the target actual object data to yes; then find the object logical header with the object name as the keyword, modify the actual version object pointed to by the object logical header to the target version object, and set the status of the current latest version in the basic information of the actual version object originally pointed to by the object logical header to false, indicating that the actual version object originally pointed to is no longer the current latest version; in the data pool, modify the version number of the object recorded in the additional attributes of the data total header to the version number of the target version object.

2. The method for restoring historical versions using a multi-version function according to claim 1, characterized in that: A historical version recovery request carrying the version number of the target version object is sent to the object storage gateway. The object storage gateway parses the historical version recovery request to obtain the version number and object name of the target version object to be restored.

3. The method for restoring historical versions using a multi-version function according to claim 1, characterized in that: The request to access the actual object data first accesses the data header, and is directed to the actual object data corresponding to the object version number through the object version number in the additional attribute of the data header.

4. The method for restoring historical versions using a multi-version function according to claim 1, characterized in that: The deletion mark is used to determine whether the target version object has been deleted. If the target version object has been deleted, a prompt is given to determine whether to restore the target version object and use the target version object as the object to be restored.

5. A device for restoring historical versions with a multi-version function, characterized in that: include: At least one processing unit, a storage unit and a bus unit, wherein the bus unit connects the processing unit and the storage unit, and the storage unit stores a computer program, and when the computer program is executed by the processing unit, it implements the method for realizing multi-version function and restoring historical versions as described in any one of claims 1-4.

6. A storage medium for implementing a method for restoring historical versions using a multi-version function, wherein the storage medium stores a computer program, characterized in that: When the computer program is executed by a processor, the method for realizing multi-version function and restoring historical versions as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • File rollback method, system and device and computer-readable storage medium

    CN108062233A

  • Multi-version file operation method, system and device

    CN111752909A