Metadata management method, storage system and related computer equipment

By dividing the metadata drop zone into multiple drop zones and adopting grid management, the problem of ineffective repair efficiency when the metadata is huge is solved, and more efficient metadata repair and storage system reliability are achieved.

CN118885339BActive Publication Date: 2024-12-20INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411366387.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-20
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

In scenarios with huge metadata magnitude, the metadata repair process caused by controller failure is complex and time-consuming, affecting the reliability of the storage system and business recovery efficiency.

Method used

By dividing the metadata drop zone into multiple drop zones, and selecting only some sub-zones for metadata writing disks in the write disk operation, the number of sub-zones that need to be processed during repair is reduced, and a grid management strategy is adopted to reduce the number of sub-zones that need to be processed during repair. Repair scope and analysis burden.

Benefits of technology

It effectively reduces the computational burden and time-consuming of metadata repair, improves the repair efficiency, reduces the loss of metadata and bitmap information, and improves the reliability of the storage system and the speed of business recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885339B_ABST
    Figure CN118885339B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of storage systems, and in particular to a metadata management method, a storage system, and related computer equipment. The metadata management method includes: obtaining metadata to be written to disk; selecting a sub-area for writing the metadata to be written to disk from the metadata writing area as a sub-area to be written; wherein the metadata writing area includes multiple sub-areas; selecting several sub-areas to be written as target sub-areas at the same time, and writing the metadata to be written to disk to the target sub-areas until the metadata to be written to disk is completed; wherein the number of sub-areas used as target sub-areas is less than the number of sub-areas in the metadata writing area; and repairing the target sub-areas when repairing the metadata. The use of this method can reduce the burden of metadata repair, which is conducive to improving the repair efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of storage systems, and in particular to a metadata management method, a storage system, a computer program product, a computer device, and a computer-readable storage medium. Background Art

[0002] In order to ensure that the storage system can provide good business performance when it is running, the metadata and bitmap information that express the new append operation are usually saved as hardened data in the power-saving memory; among them, hardened data means data that needs to be not lost in the event of a power outage. In this way, the latency caused by writing to the disk can be reduced, and at the same time, it can help to ensure the retention of metadata and bitmap information when the controller fails, so as to ensure the reliability of the storage system. However, in scenarios where the amount of metadata is relatively large, once a controller failure occurs, the metadata repair process is very complicated, the computational burden of the repair process is heavy, and it takes a long time. Summary of the invention

[0003] Based on this, it is necessary to provide a metadata management method, storage system, computer program product, computer device and computer-readable storage medium to address the above technical problems, which can reduce the metadata repair burden and help improve repair efficiency.

[0004] On the one hand, a metadata management method is provided, the metadata management method comprising: obtaining metadata to be written to disk; selecting a sub-area for writing the metadata to be written to disk from the metadata writing area as a sub-area to be written; wherein the metadata writing area includes multiple sub-areas; selecting several sub-areas to be written as target sub-areas at the same time, writing the metadata to be written to disk to the target sub-areas until the metadata to be written to disk is written to disk; wherein the number of sub-areas to be written as target sub-areas is less than the number of sub-areas to be written in the metadata writing area; and repairing the target sub-areas when repairing the metadata.

[0005] In one embodiment of the present application, when repairing metadata, repairing the target sub-area includes: obtaining status information of each landed sub-area; determining that the landed sub-area is in a disk write state in response to the identification status information, and determining that the landed sub-area is a target sub-area; determining that the landed sub-area is not in a disk write state in response to the identification status information, and determining that the landed sub-area is not a target sub-area.

[0006] In one embodiment of the present application, after selecting several areas to be placed as target sub-areas at the same time, it also includes: after selecting several areas to be placed as target sub-areas at the same time, it also includes: assigning a disk placement identifier to the target sub-area until the metadata to be placed assigned to the target sub-area is placed on disk; and / or, linking to the space marking area, updating the current state of the target sub-area in the space marking area to the disk placement state until the metadata to be placed assigned to the target sub-area is completely placed on disk; wherein the space marking area is used to record the current state of the sub-area to be placed on disk.

[0007] In one embodiment of the present application, repairing the target sub-area includes: linking the root node area, extracting the root nodes of each metadata located in the root node area; wherein the root node area is used to store a number of root nodes of metadata; at each root node, obtaining the sequence identifier of its leaf node from the root node step by step; wherein the sequence identifier is associated with the number of updates of the root node / leaf node to which it belongs; in response to the fact that the number of updates fed back by the sequence identifier of the leaf node is greater than the sequence identifier of its parent node, it is determined that a node is lost.

[0008] In one embodiment of the present application, the metadata management method includes: in response to a newly added metadata node, assigning an initial sequence identifier to the metadata node; wherein the metadata node includes a root node and a leaf node, and the sequence identifier is a serial number; in response to a change in a key-value pair of the metadata node, increasing the serial number of the metadata node by a preset value.

[0009] In one embodiment of the present application, obtaining the sequence identifiers of the leaf nodes from the root node step by step includes: obtaining the sequence identifier of the current node; comparing the sequence identifier of the current node with the sequence identifier of its adjacent upper-level node; in response to the number of updates of the sequence identifier feedback of the current node being less than the sequence identifier of its adjacent upper-level node, determining that the current node is a valid node and using its adjacent lower-level node as the new current node.

[0010] In one embodiment of the present application, after determining that the current node is a valid node, the method further includes: obtaining bitmap information; and marking the bitmap state of the current node in the bitmap information as valid.

[0011] In one embodiment of the present application, after determining that there is a node loss, the method further includes: stopping the acquisition of the sequence identifiers of the lower-level leaf nodes of the current node; and at least marking the bitmap information of the current node as invalid.

[0012] In one embodiment of the present application, extracting the root nodes of each metadata located in the root node area includes: in response to determining that multiple root nodes belong to the same node tree, comparing the sequence identifiers of multiple root nodes belonging to the same node tree; and taking the root node with the largest number of updates in the sequence identifier feedback among the multiple root nodes as the root node of the node tree.

[0013] In one embodiment of the present application, repairing the target sub-area includes: using the metadata of the target sub-area as verification metadata; obtaining the key-value pair of the leaf node of the verification metadata and performing a retry process on the key-value pair; and storing the metadata modified by the retry process to a non-target sub-area.

[0014] In one embodiment of the present application, after performing retry processing on the key-value pair, it also includes: obtaining bitmap information; marking the retry disk placement position in the bitmap information as invalid; wherein the retry disk placement position represents the disk placement position of the metadata to be placed in the target sub-area that has been placed on disk.

[0015] In one embodiment of the present application, obtaining the key-value pairs of the leaf nodes of the verification metadata includes: in response to the existence of multiple leaf nodes with matching key-value pair ranges, obtaining the sequence identifiers of the multiple leaf nodes with matching key-value pair ranges; and taking the leaf node with the largest number of updates in the sequence identifier feedback among the multiple leaf nodes as the valid leaf node.

[0016] In one embodiment of the present application, selecting a sub-region for placing metadata to be placed on disk from the metadata placement area as the area to be placed includes: obtaining spatial information of each sub-region; wherein the spatial information includes at least one of spatial usage data and spatial free data of the sub-region; and selecting a number of sub-regions for placing metadata to be placed on disk based on the spatial information as the area to be placed.

[0017] In one embodiment of the present application, after writing the metadata to be written to the disk to the target sub-area, the method further includes: obtaining the data size of the metadata written to the target sub-area; and updating the spatial information of the target sub-area using the data size.

[0018] On the other hand, a storage system is provided, the storage system comprising: a storage system body and a metadata management device; the metadata management device is arranged in the storage system body, and is used to implement the metadata management method in any of the above embodiments.

[0019] On the other hand, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: obtaining metadata to be written to disk; selecting a sub-area for writing the metadata to be written to disk from the metadata writing area as a sub-area to be written; wherein the metadata writing area includes multiple sub-areas; selecting several sub-areas to be written as target sub-areas at the same time, and writing the metadata to be written to disk to the target sub-areas until the metadata to be written to disk is written to disk; wherein the number of sub-areas used as target sub-areas is less than the number of sub-areas in the metadata writing area; and repairing the target sub-areas when repairing the metadata.

[0020] On the other hand, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: obtaining metadata to be written to disk; selecting a sub-area for writing the metadata to be written to disk from the metadata writing area as a sub-area to be written; wherein the metadata writing area includes a plurality of sub-areas; selecting a plurality of sub-areas to be written as target sub-areas at the same time, and writing the metadata to be written to disk to the target sub-areas until the metadata to be written to disk is written to disk; wherein the number of sub-areas used as target sub-areas is less than the number of sub-areas in the metadata writing area; and repairing the target sub-areas when repairing the metadata.

[0021] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: obtaining metadata to be written to disk; selecting a sub-area for writing the metadata to be written to disk from the metadata writing area as a sub-area to be written; wherein the metadata writing area includes multiple sub-areas; selecting several sub-areas to be written as target sub-areas at the same time, and writing the metadata to be written to disk to the target sub-areas until the metadata to be written to disk is written to disk; wherein the number of sub-areas used as target sub-areas is less than the number of sub-areas in the metadata writing area; and repairing the target sub-areas when repairing the metadata.

[0022] The metadata management method, storage system, computer program product, computer device and computer-readable storage medium divide the metadata landing area into multiple landing sub-areas. When the metadata to be landed is landed, at least part of the landing disks can be selected for writing the metadata to be landed. Moreover, in a specific write operation, only part of the landing sub-areas are selected at the same time to perform the write operation with the metadata to be landed. In this way, once a failure occurs, the metadata landing area space that needs to be repaired can be reduced, the computational burden of the repair process can be reduced, and the analysis of other landing sub-areas that have not been written to the disk can also be reduced, which is conducive to improving the repair efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a flowchart of an embodiment of the metadata management method of the present application;

[0024] Figure 2 It is a flowchart of another embodiment of the metadata management method of the present application;

[0025] Figure 3 It is a structural diagram of an embodiment of the spatial organization of the present application;

[0026] Figure 4 This is a flow chart of an embodiment of data change of this application;

[0027] Figure 5It is a structural diagram of an embodiment of a metadata node of the present application;

[0028] Figure 6 It is a structural diagram of an embodiment of a storage system of the present application;

[0029] Figure 7 It is a structural diagram of an embodiment of a computer device of the present application. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0031] In application scenarios such as all-flash storage systems, an append-write mechanism is usually used. The so-called append-write mechanism means that whenever new data is written and the write disk location is determined, it will not overwrite the original location but will choose to write to a new location. At the same time, the newly written data will be aggregated and finally written to RAID (Redundant Arrays of Independent Disks).

[0032] However, since the location of each write is not fixed, the concept of metadata comes into being. The address mapping relationship can be recorded through metadata, and metadata varies according to the differences in storage system design, but is usually divided into forward mapping (LBA->PBA, LP) and reverse mapping (PBA->LBA, PL).

[0033] In addition, since data is written to a new location each time, there is usually bitmap information to mark the validity of the space. For example, the space can be marked as used by marking 1, and unused by marking 0. Each bit represents the block granularity defined by the system. In order to ensure that the storage system can provide more business performance during operation, the newly modified metadata and bitmap information will be saved as harden data in the power-saving memory, thereby reducing the latency and write amplification overhead caused by writing to the disk, and at the same time helping to reduce the risk of metadata and bitmap information loss when the controller fails, thereby ensuring the reliability of the storage system.

[0034] The power-saving memory usually adds a BBU (battery backup unit). In the event of an unexpected power outage, the data in the power-saving memory can be temporarily written to the system disk or specific media based on the power of the BBU. After the controller is restored, the data is read from the memory to ensure the security of the data in the power-saving memory. The design of the power-saving memory can ensure that the hardened data is reliable in most scenarios. Even if a controller failure occurs, the hardened data will not be missed or lost, so that the cluster can operate normally after the failure is restored. However, there are some more extreme scenarios, such as when the controllers in the cluster fail at the same time and the BBU device also fails. In this case, the hardened data will not be saved normally and will be lost. At this time, some newly modified metadata and bitmap information will be lost, causing the all-flash system to fail to operate normally, and the system and data must be repaired.

[0035] In addition, since the amount of metadata in an all-flash system is very large, only a small amount of the latest modified metadata will be stored in the power-saving memory when the metadata is saved, and these lost metadata are basically impossible to recover. Therefore, when repairing harden data loss, it is usually recognized that some metadata is lost, and the repair action is completed as much as possible based on the metadata that has been written to the disk. Because different storage systems use very different metadata algorithms and structures, the detailed recovery process will be quite different.

[0036] Taking B+TREE (a variant of B-tree, which is a self-balancing tree data structure) as an example, when modifying, it is generally required to first scan the disk in full to find the root node of each B+TREE, and then traverse the entire tree through the root node until the leaf node. After all checks, the undamaged B+TREE will be reorganized, and the damaged ones will be discarded. After the B+TREE is repaired, the location indexed by the metadata will be traversed again to repair the bitmap information. The location with records in the metadata is the used space, and the bitmap BIT mark is 1, while the location without records in the metadata is the unused space, and the BIT mark is 0, until the repair of all metadata and bitmap information is completed. It can be seen from the above repair process that this method has at least two defects. First, since the entire space is traversed, it will take a long time, that is, the repair process will be very long, affecting customer business recovery and not conducive to the normal use of the product. Second, during the repair process, a lot of metadata information will be lost.

[0037] In order to solve the technical problem of low metadata repair efficiency existing in the related art, the present application provides a metadata management method, storage system, computer program product, computer device and computer-readable storage medium. The metadata management method includes: obtaining metadata to be dropped on disk; selecting a drop sub-area for the metadata to be dropped on disk from the metadata drop area as the drop sub-area to be dropped; wherein the metadata drop area includes multiple drop sub-areas; selecting several drop sub-areas to be dropped on disk as target sub-areas at the same time, and writing the metadata to be dropped on disk to the target sub-area until the drop of the metadata to be dropped on disk is completed; wherein the number of drop sub-areas as target sub-areas is less than the number of drop sub-areas in the metadata drop area; when repairing the metadata, the target sub-area is repaired. The use of this method can reduce the burden of metadata repair and is conducive to improving the repair efficiency. The specific working principle of the present application is defined below.

[0038] See also Figure 1 , Figure 1 It is a flowchart of an embodiment of the metadata management method of the present application.

[0039] S101: Obtain metadata to be written to disk.

[0040] In this embodiment, the metadata to be written to the disk refers to metadata generated based on an operation such as append writing and has not yet been written to the disk.

[0041] S102: Selecting a sub-region for storing metadata to be stored in disk from the metadata storage region as the sub-region to be stored; wherein the metadata storage region includes a plurality of sub-regions for storing metadata to be stored in disk.

[0042] In this embodiment, the metadata placement area is divided into a plurality of placement sub-areas to implement grid management of the metadata placement area. After obtaining the metadata to be placed on disk, at least part of the placement sub-areas are selected as the pending placement sub-areas to which the pending placement metadata can be allocated. In other words, the number of pending placement sub-areas can be less than or equal to the total number of placement sub-areas of the metadata placement area.

[0043] S103: At the same time, several sub-areas to be written are selected as target sub-areas, and the metadata to be written are written to the target sub-areas until the metadata to be written is completed; wherein the number of sub-areas to be written as target sub-areas is less than the number of sub-areas to be written in the metadata writing area; when repairing the metadata, the target sub-areas are repaired.

[0044] In this embodiment, when performing a disk write operation, only part of the disk areas are simultaneously subjected to disk write operations for metadata to be written to disk. In this way, when a failure needs to be repaired, the range of the metadata disk areas to be concerned about can be reduced.

[0045] Optionally, the number of target sub-areas may be one, two, three, etc., which is not limited here.

[0046] It can be seen that in this embodiment, the metadata landing area is divided into multiple landing disk areas. When the metadata to be landed is landed, at least part of the landing disks can be selected to write the metadata to be landed. In addition, in a specific disk writing operation, only part of the landing disk areas are selected at the same time to perform the disk writing operation with the metadata to be landed. In this way, once a failure occurs, the metadata landing disk area space that needs to be repaired can be reduced, the computational burden of the repair process can be reduced, and the analysis of other landing disk areas that have not been written to the disk can also be reduced, which is conducive to improving the repair efficiency.

[0047] See also Figure 2 , Figure 2 It is a flowchart of another embodiment of the metadata management method of the present application.

[0048] S201: Selecting a plate to be placed based on the spatial information of the plate placement area.

[0049] In this embodiment, in response to obtaining metadata to be placed on disk, a placement sub-area for placing metadata to be placed on disk can be selected from the metadata placement area as the sub-area to be placed; wherein the metadata placement area includes multiple placement sub-areas.

[0050] Specifically, the spatial information of each plate-dropping area can be obtained, wherein the spatial information includes at least one of the spatial usage data and the spatial idle data of the plate-dropping area. Based on the spatial information, several plate-dropping areas are selected as the areas to be dropped.

[0051] That is to say, in this embodiment, the disk to be placed can be selected based on the space status of each placement plate area to balance the space usage of each placement plate area, thereby reducing the risk of uneven metadata distribution affecting the stability of the storage system and further improving the reliability of the metadata management strategy in this embodiment.

[0052] S202: Update the current state of the target sub-area in the spatial marking area.

[0053] In this embodiment, several sub-areas to be placed are selected as target sub-areas at the same time, and the metadata to be placed on disk is written to the target sub-areas until the metadata to be placed on disk is completed; wherein, the number of sub-areas to be placed on disk as target sub-areas is less than the number of sub-areas to be placed on disk in the metadata placement area.

[0054] Link to the space marking area, update the current state of the target sub-area in the space marking area to the disk-stacked state, until the metadata to be stacked to the target sub-area is completely stacked. The current state of the space marking area can be used as the state information of the repair process to realize the automation of the determination of the area to be repaired and reduce the tedious calculation of global repair.

[0055] like Figure 3 As shown in the example, Figure 3This is a schematic diagram of the structure of an embodiment of the space organization of the present application. It may have a metadata drop zone consisting of multiple drop zones, a space mark zone and a root node zone. The space mark zone is used to record the current state of the drop zone.

[0056] In an alternative embodiment, after selecting several pending sub-areas as target sub-areas, a disk placement identifier may be assigned to the target sub-areas until the pending disk placement metadata allocated to the target sub-areas is placed on disk.

[0057] S203: Allocate space and write to disk for the metadata to be written to disk.

[0058] In this embodiment, the disk writing space for the data to be written to the disk can be allocated based on the space information of each sub-disk to be written to the disk, and the disk writing operation can be performed on the target sub-disk.

[0059] S204: Update the spatial information of the target sub-area using the data size of the metadata written to the target sub-area.

[0060] In this embodiment, the data size of the metadata stored in the target sub-area is obtained, and the spatial information of the target sub-area is updated using the data size.

[0061] S205: Determine whether the metadata to be stored on disk has been stored on disk.

[0062] In this embodiment, when it is determined that the metadata to be written to disk is completed, step S206 is executed; when it is determined that the metadata to be written to disk is not completed, step S204 is executed to continue writing the metadata to disk.

[0063] Optionally, the judgment and current status update may be performed for each target sub-disk, or the judgment and current status update may be performed for the global sub-disk to be placed, which is not limited here.

[0064] S206: canceling the disk placement status of the target sub-area in the space marking area.

[0065] Please refer to Figure 4 as well as Figure 5 , Figure 4 This is a flow chart of an embodiment of data change in this application. Figure 5 It is a structural diagram of an embodiment of a metadata node of the present application.

[0066] In one embodiment, in response to a newly added metadata node, an initial sequence identifier is assigned to the metadata node; wherein the metadata node includes a root node and a leaf node, and the sequence identifier is a serial number. In response to a change in the key-value pair of the metadata node, the sequence number of the metadata node is increased by a preset value, and the preset value is increased based on a relative regularity. The update times of the current metadata node can be fed back through the sequence number in the sequence identifier, which is conducive to the rapid identification of valid nodes and invalid nodes after a failure. Wherein, the metadata node includes a root node and a leaf node, and the structure of the metadata node can include a preset area and a key-value pair storage area. The sequence identifier can be stored in a preset area such as HEADER (header / node header).

[0067] Furthermore, for ease of understanding, the update times of the sequence identifier feedback are simplified to be referred to as the sequence identifier. The sequence identifier distribution of all metadata nodes in the storage system, or the sequence identifier distribution of the metadata nodes of each node tree, can be globally checked. The difference in sequence identifiers between metadata nodes of adjacent levels and having a reference relationship in the same node tree is obtained. Among them, metadata nodes of adjacent levels and having a reference relationship include: a root node and a leaf node adjacent to it and referencing its level, and a leaf node and a leaf node adjacent to it and referencing its level. In response to the difference in sequence identifiers between metadata nodes of adjacent levels exceeding a difference threshold, the sequence identifiers of metadata nodes of each level in the same node tree are globally updated. The global update is to ensure that the difference in sequence identifiers between metadata nodes of adjacent levels after the update does not exceed the difference threshold, and the sequence identifier of each metadata node is higher than the sequence identifier of the metadata node of the next level that is adjacent to it and references it.

[0068] For example, the preset value added by each update can be 1. Correspondingly, the difference threshold can also be 1, which is conducive to ensuring the best detection effect. Of course, other combinations of preset values ​​and difference thresholds are also possible, such as the preset value is 1 and the difference threshold is 2, the preset value is 2 and the difference threshold is 7, etc., which will not be repeated here.

[0069] The following is an example of the repair process of this application.

[0070] In one embodiment, the status information of each landing plate area can be obtained. In response to the identification status information, it is determined that the landing plate area is in the disk writing state, and the landing plate area is determined to be the target sub-area; in response to the identification status information, it is determined that the landing plate area is not in the disk writing state, and the landing plate area is determined to be a non-target sub-area. In this way, the status information of the landing plate area can be maintained before writing to the disk, so that when a controller failure, BBU failure, etc. need to be repaired, the target sub-area that needs to be maintained can be automatically identified based on the status information, thereby reducing the redundant operations of the global repair, effectively reducing the calculation burden of the repair, and at the same time helping to improve the repair efficiency.

[0071] The root node area is linked to extract the root nodes of each metadata in the root node area, wherein the root node area is used to store several root nodes of metadata.

[0072] Specifically, in response to determining that multiple root nodes belong to the same node tree, the sequence identifiers of the multiple root nodes belonging to the same node tree may be compared, and the root node with the largest number of updates of the sequence identifier feedback among the multiple root nodes may be used as the root node of the node tree.

[0073] At each root node, the sequence identifiers of its leaf nodes are obtained from the root node step by step, wherein the sequence identifier is associated with the update times of the root node / leaf node to which it belongs.

[0074] Specifically, the sequence identifier of the current node is obtained. The sequence identifier of the current node is compared with the sequence identifier of its adjacent upper node. In response to the update number of the sequence identifier feedback of the current node being less than that of the sequence identifier of its adjacent upper node, the current node is determined to be a valid node, and its adjacent lower node is used as the new current node, thereby rationalizing the process of node verification based on the sequence identifier and reducing repeated verification steps.

[0075] Optionally, in response to determining that the current node is a valid node, bitmap information may be obtained, and the bitmap state of the current node in the bitmap information may be marked as valid.

[0076] In response to the fact that the number of updates fed back by the sequence identifier of a leaf node is greater than that of the sequence identifier of its parent node, it is determined that a node is lost, and the completion of the disk flushing is verified using the sequence identifier. The disk flushing situation before the failure is effectively and quickly identified based on the number of updates, so as to effectively identify the node loss situation and further improve the reliability of metadata management.

[0077] Optionally, in response to determining that there is a node loss, the acquisition of the sequence identifier of the lower-level leaf node of the current node is terminated, and at least the bitmap information of the current node is marked as invalid.

[0078] Furthermore, the metadata of the target sub-area can be used as verification metadata. The key-value pair of the leaf node of the verification metadata is obtained, and a retry process of the key-value pair is performed on it.

[0079] Furthermore, in response to the existence of multiple leaf nodes that match the key-value pair range, sequence identifiers of the multiple leaf nodes that match the key-value pair range are obtained.

[0080] The leaf node with the largest number of updates of sequence identifier feedback among multiple leaf nodes is regarded as a valid leaf node.

[0081] Optionally, in response to retrying the key-value pair, bitmap information may be obtained, and the retry placement position in the bitmap information may be marked as invalid; wherein the retry placement position indicates the placement position of the metadata to be placed in the target sub-area that has been placed in the target sub-area.

[0082] The metadata modified by the retry process is written to the non-target sub-area.

[0083] Please refer to Figures 2 to 4 , the following is a relatively popular and detailed description of an embodiment of the metadata management method of the present application.

[0084] In this embodiment, in order to solve the problem of metadata repair after harden data is lost, the main idea of ​​this embodiment includes a defined root node area, so that the root node scan can be completed by scanning a small range. The metadata disk space is managed and allocated in a grid manner, that is, the metadata disk area is divided into multiple disk areas. Even only one grid can be used at the same time. In this way, it can be ensured that when a harden loss occurs, only the data of one grid may be incompletely written to the disk, while the data of other grids is complete, thereby limiting the scanning range to the greatest extent and avoiding time-consuming due to large-scale scanning. The KV (key-value) insertion retry operation is performed on specific metadata on the disk to try to recover the lost metadata and reduce the amount of data loss.

[0085] Moreover, since the amount of metadata information is very large, during business operation, most of the metadata is located in the metadata space composed of disk media, and only some newly modified metadata will be temporarily stored in the write cache that can be protected against power failures, and asynchronous writing to the disk will be completed according to the water level of the write cache.

[0086] Specifically, when organizing and managing the metadata space, it is necessary to first divide the area (such as Figure 3 As shown in the example, it can be roughly divided into three parts: space mark area, root node area, and metadata disk area, among which the metadata disk area is divided into multiple disk areas.

[0087] The space mark area is used to mark whether the current disk area is activated (i.e., whether the disk area is in the disk state). A mark bit can be set for each disk area to record whether it is activated / disk state. If it is in the activated state, it means that there is space allocation and disk writing in the disk area. Otherwise, it means that there is no metadata writing action in the disk area.

[0088] The root node area is used to store the root node of metadata. After the root node is updated, the cluster will eventually write it to the root node area. The purpose is to centrally scan the root node.

[0089] The metadata drop zone is divided into multiple drop zones, which are the main areas for storing newly modified metadata. In addition, in this embodiment, it is ensured that all drop zones in the metadata drop zone will not write metadata to disk at the same time. Generally speaking, only some drop zones will be activated and perform space allocation and metadata writing within a period of time. After these drop zones complete the metadata drop action, other drop zones will be selected to carry out space allocation and metadata writing.

[0090] Metadata space organization and workflow (e.g. Figure 2 As shown), first the system will set up a space utilization statistics module, whose main function is to count the idle rate of each plate landing area, and the idle rate can be used as the space information of the plate landing area.

[0091] Among them, the idle rate can be calculated as: (total capacity - effective metadata capacity) total capacity. That is, the proportion of space allowed to write new metadata in the metadata drop zone. When new metadata is written and metadata is invalid, a notification is sent to the space utilization statistics module. After receiving the notification, the space utilization statistics module can count the effective metadata capacity in each drop zone, thereby calculating the idle rate of each drop zone. By querying the idle rate of the drop zone, one or more drop zones with higher idle rates are obtained. Then find the mark corresponding to the drop zone from the space mark area and set the mark to the activated state; then query the available free space from these drop zones, and complete the space allocation to support the write operation of the metadata that is only modified; then the newly modified metadata will be written to these allocated spaces and the write operation will be completed; wait until all the free spaces in the drop zone are allocated, and the metadata that needs to be written to these spaces are all dropped, indicating that the drop zone has been used up. At this time, there will be no new metadata that needs to be written or is being written to this drop zone, and then the mark corresponding to the drop zone needs to be deactivated in the space mark area.

[0092] The data organization within the metadata node (such as Figure 5The KV storage area is used to store KV information in metadata, while the HEADER is used to store some node public information, such as verification data, node type (such as root node, leaf node), subordinate relationship, and KV quantity.

[0093] In order to ensure the need for metadata repair after harden data is lost, this embodiment adds a sequence ID (identification number) in the HEADER as a sequence identifier, and this sequence ID will only increase and not decrease. In this way, during the metadata management process, once the metadata node is modified, the new metadata node will be written to the new location after the modification is completed. The modification process is as follows: Figure 4 The example shown is roughly that when a KV in a leaf node is added, deleted, or modified, the corresponding leaf node will be modified and the modified node will be written to a new location (the location written is the disk area in the activated state mentioned in the previous section). Then, due to the change in the leaf node address, the KV in the upper intermediate node that indexes the leaf node will be modified and the modified node will be dropped to a new location, which will in turn trigger the change of the upgraded intermediate node until the top-level root node is modified (after the root node changes, the new root node will be written to the root node area). In this process, the sequence ID is managed in such a way that when the node changes, before the disk is completed, the sequence ID is increased by 1; if a node split occurs, the node after the split will inherit the sequence ID of the original node and increase by 1; if a node merge occurs, the maximum sequence ID value of the two nodes to be merged is taken and increased by 1. Based on the above rules, the final result is that no matter how the node changes, the sequence ID in the upper node will never be less than the sequence ID in the lower node.

[0094] Through the above process, the organization and management of metadata can be met. At this time, if the data in the power-saving memory is lost due to an extreme failure, the metadata repair process will be started to repair the metadata lost due to the loss of hardened data and the bitmap information used to mark the space validity in the hardened data. The specific process can be described as follows.

[0095] First, the root node area can be scanned to extract all the root nodes therein. If multiple root nodes for the same node tree are identified, it is necessary to take the root node with the largest sequence ID as the root node of the node tree according to the sequence ID saved by the node. Since the root node area is small, the time-consuming process of scanning the root node can be effectively reduced. According to the root node scanning result, it is necessary to complete the node traversal and verification of each node tree in one step. Specifically, starting from the root node, its lower-level leaf nodes can be queried one by one to determine whether each metadata node is abnormal. In this process, the sequence ID can be used for judgment. If the sequence ID of the upper node is less than the sequence ID of the lower node, it means that the upper node points to an invalid node. The reason for this is that the lower node has been updated to a new position, but the upper node update and disk writing have not been completed after the lower node is updated. It can be considered that the upper node is still an old node, and the position of the lower node currently pointed to may have been written to the nodes of other trees.

[0096] Once the above situation is found, it can be considered that the current node tree has a situation where the harden data is lost and the node has not completed the update and write to the disk. Therefore, there is no need to continue to traverse and check the lower-level nodes with problems, but for the lower-level nodes without problems, the lower-level traversal and check will continue. After completing the above traversal and verification process, it can be determined whether the node tree is complete or not, and whether there is a node loss situation. At the same time, the metadata nodes with problems during the traversal process can also be recorded.

[0097] At the same time, during the traversal process, the bitmap can also be repaired synchronously. Specifically, during the traversal process, if the metadata node is confirmed to be a valid node, the bit corresponding to the node in the bitmap needs to be set to 1, that is, marked as valid; otherwise, it is set to 0, marked as invalid. After completing the traversal and verification of all trees, most of the bitmap modifications and updates can be basically completed synchronously.

[0098] Next, you can check the space marking area. Based on the current state recorded in the space marking area, when the flag of the drop plate area is recorded as activated, it is considered that the drop plate area was in the drop plate state before the failure. If so, all the drop plate areas in the activated state can be retrieved, and the drop plate areas that need to be in the activated state are marked as drop plate areas to be detected and repaired. Because during the update and writing of metadata, the leaf nodes are first dropped to disk, and then the intermediate nodes are gradually dropped to disk. Therefore, it is possible that the drop plate area has completed the drop of leaf nodes, but the drop of intermediate nodes has not yet been completed. Therefore, it is necessary to traverse the drop plate area to find the leaf nodes. If there are multiple leaf nodes corresponding to the same range of KV, the leaf node with the largest sequence ID is the valid leaf node, so as to identify the valid leaf nodes as much as possible.

[0099] The KV value in the identified leaf node will be retried, that is, the KV update will be done again. The update will also involve the problem of writing the modified metadata to disk. At this time, the normal space allocation and metadata writing process will still be used. However, it should be noted that when the KV retry operation is performing space allocation and metadata writing, the new sub-area involved is the sub-area that is not marked as pending detection, that is, the target sub-area for writing metadata to disk before the failure.

[0100] After completing the above, it can be considered that the metadata of the disk area to be detected has been repaired, so the state of the disk area to be detected can be cleared. At the same time, after completing the leaf node identification and KV retry operation for these disk areas, the valid metadata will be re-downloaded with the KV retry operation, so it can be considered that the metadata written in the target sub-disk before the failure and the space occupied by it are invalid space, and the bit of the corresponding area in the bitmap can be set to 0 and marked as invalid. Through the above process, the metadata and bitmap can be repaired, and the cluster will continue to provide services to the host business after the repair.

[0101] In summary, the present application can optimize the metadata space layout and organization method so that in extreme failure scenarios such as power-saving memory data loss, the metadata can still quickly complete the repair process and reduce the time spent in the repair process; at the same time, it can also minimize the loss of metadata and effectively improve the effect of metadata repair.

[0102] It should be understood that although Figure 1 , Figure 2 as well as Figure 4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 , Figure 2 as well as Figure 4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0103] See also Figure 6 , Figure 6 It is a structural diagram of an embodiment of the storage system of the present application.

[0104] In one embodiment, the storage system includes a storage system body and a metadata management device; the metadata management device is arranged in the storage system body, and is used to implement the metadata management method in any of the above embodiments.

[0105] For the specific definition of the metadata management device, please refer to the definition of the metadata management method above, which will not be repeated here. Each module in the above-mentioned metadata management device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0106] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps of the metadata management method described above are implemented, which will not be described in detail here.

[0107] See also Figure 7 , Figure 7 It is a structural diagram of an embodiment of a computer device of the present application.

[0108] In one embodiment, the computer device may be a server or a terminal.

[0109] Taking the computer device as a server as an example, its internal structure diagram can be as follows Figure 7 As shown in the example.

[0110] The computer device includes a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to the server and the services and service data it provides. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a metadata management method is implemented.

[0111] Those skilled in the art will understand that Figure 7 The structure shown as an example is merely a block diagram of a portion of the structure related to the present application solution, and does not constitute a limitation on the computer device to which the present application solution is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0112] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps may be implemented:

[0113] S101: Obtain metadata to be written to disk.

[0114] S102: Selecting a sub-region for storing metadata to be stored in disk from the metadata storage region as the sub-region to be stored; wherein the metadata storage region includes a plurality of sub-regions for storing metadata to be stored in disk.

[0115] S103: At the same time, several sub-areas to be written are selected as target sub-areas, and the metadata to be written are written to the target sub-areas until the metadata to be written is completed; wherein the number of sub-areas to be written as target sub-areas is less than the number of sub-areas to be written in the metadata writing area; when repairing the metadata, the target sub-areas are repaired.

[0116] In one embodiment, when repairing metadata and repairing the target sub-area, the processor also implements the following steps when executing the computer program: obtaining status information of each landed sub-area; determining that the landed sub-area is in a disk write state in response to the identification status information, and determining that the landed sub-area is a target sub-area; determining that the landed sub-area is not in a disk write state in response to the identification status information, and determining that the landed sub-area is not a target sub-area.

[0117] In one embodiment, after selecting several areas to be placed as target sub-areas at the same time, the processor further implements the following steps when executing the computer program: after selecting several areas to be placed as target sub-areas at the same time, it also includes: assigning a disk placement identifier to the target sub-area until the metadata to be placed allocated to the target sub-area is placed on disk; and / or, linking to the space marking area, updating the current state of the target sub-area in the space marking area to the disk placement state, until the metadata to be placed allocated to the target sub-area is completely placed on disk; wherein the space marking area is used to record the current state of the target sub-area.

[0118] In one embodiment, when repairing the target sub-area, the processor also implements the following steps when executing the computer program: linking the root node area, extracting the root nodes of each metadata located in the root node area; wherein the root node area is used to store a number of root nodes of the metadata; at each root node, obtaining the sequence identifier of its leaf node from the root node step by step; wherein the sequence identifier is associated with the number of updates of the root node / leaf node to which it belongs; in response to the fact that the number of updates fed back by the sequence identifier of the leaf node is greater than the sequence identifier of its upper-level node, it is determined that there is a node loss.

[0119] In one embodiment, the processor also implements the following steps when executing the computer program: in response to a newly added metadata node, assigning an initial sequence identifier to the metadata node; wherein the metadata node includes a root node and a leaf node, and the sequence identifier is a serial number; in response to a change in a key-value pair of the metadata node, increasing the serial number of the metadata node by a preset value.

[0120] In one embodiment, when obtaining the sequence identifiers of the leaf nodes from the root node step by step, the processor also implements the following steps when executing the computer program: obtaining the sequence identifier of the current node; comparing the sequence identifier of the current node with the sequence identifier of its adjacent upper-level node; in response to the number of updates of the sequence identifier feedback of the current node being less than that of the sequence identifier of its adjacent upper-level node, determining that the current node is a valid node and using its adjacent lower-level node as the new current node.

[0121] In one embodiment, after determining that the current node is a valid node, the processor further implements the following steps when executing the computer program: obtaining bitmap information; marking the bitmap state of the current node in the bitmap information as valid.

[0122] In one embodiment, after determining that a node is lost, the processor further implements the following steps when executing the computer program: terminating the acquisition of the sequence identifiers of the lower-level leaf nodes of the current node; and marking at least the bitmap information of the current node as invalid.

[0123] In one embodiment, when extracting the root nodes of each metadata located in the root node area, the processor also implements the following steps when executing the computer program: in response to determining that multiple root nodes belong to the same node tree, comparing the sequence identifiers of multiple root nodes belonging to the same node tree; and taking the root node with the largest number of updates of sequence identifier feedback among the multiple root nodes as the root node of the node tree.

[0124] In one embodiment, when repairing the target sub-area, the processor also implements the following steps when executing the computer program: using the metadata of the target sub-area as verification metadata; obtaining the key-value pair of the leaf node of the verification metadata, and performing a retry process on the key-value pair; and storing the metadata modified by the retry process to the non-target sub-area.

[0125] In one embodiment, after performing retry processing on the key-value pair, the method further includes: obtaining bitmap information; marking the retry disk placement position in the bitmap information as invalid; wherein the retry disk placement position indicates the placement position of the metadata to be placed in the target sub-area that has been placed in the disk.

[0126] In one embodiment, when obtaining the key-value pairs of the leaf nodes of the verification metadata, the processor also implements the following steps when executing the computer program: in response to the existence of multiple leaf nodes with matching key-value pair ranges, obtaining the sequence identifiers of the multiple leaf nodes with matching key-value pair ranges; and taking the leaf node with the largest number of updates of the sequence identifier feedback among the multiple leaf nodes as the valid leaf node.

[0127] In one embodiment, when a sub-region for placing metadata to be placed on disk is selected from the metadata placement region as the area to be placed, the processor also implements the following steps when executing the computer program: obtaining spatial information of each sub-region; wherein the spatial information includes at least one of spatial usage data and spatial free data of the sub-region; and selecting a number of sub-regions for placement as the area to be placed based on the spatial information.

[0128] In one embodiment, after writing the metadata to be written to the target sub-area, the processor further implements the following steps when executing the computer program: obtaining the data size of the metadata written to the target sub-area; and updating the spatial information of the target sub-area using the data size.

[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0130] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0131] S101: Obtain metadata to be written to disk.

[0132] S102: Selecting a sub-region for storing metadata to be stored in disk from the metadata storage region as the sub-region to be stored; wherein the metadata storage region includes a plurality of sub-regions for storing metadata to be stored in disk.

[0133] S103: At the same time, several sub-areas to be written are selected as target sub-areas, and the metadata to be written are written to the target sub-areas until the metadata to be written is completed; wherein the number of sub-areas to be written as target sub-areas is less than the number of sub-areas to be written in the metadata writing area; when repairing the metadata, the target sub-areas are repaired.

[0134] In one embodiment, when repairing metadata and repairing the target sub-area, the computer program, when executed by the processor, also implements the following steps: obtaining status information of each landed sub-area; determining that the landed sub-area is in a disk write state in response to the identification status information, and determining that the landed sub-area is a target sub-area; determining that the landed sub-area is not in a disk write state in response to the identification status information, and determining that the landed sub-area is not a target sub-area.

[0135] In one embodiment, after selecting several areas to be placed as target sub-areas at the same time, the computer program further implements the following steps when executed by the processor: after selecting several areas to be placed as target sub-areas at the same time, it also includes: assigning a disk placement identifier to the target sub-area until the metadata to be placed allocated to the target sub-area is placed on disk; and / or, linking to the space marking area, updating the current state of the target sub-area in the space marking area to the disk placement state, until the metadata to be placed allocated to the target sub-area is completely placed on disk; wherein the space marking area is used to record the current state of the target sub-area.

[0136] In one embodiment, when repairing the target sub-area, the computer program is further implemented by the processor when executed to implement the following steps: linking the root node area, extracting the root nodes of each metadata located in the root node area; wherein the root node area is used to store a number of root nodes of metadata; at each root node, obtaining the sequence identifier of its leaf node from the root node step by step; wherein the sequence identifier is associated with the number of updates of the root node / leaf node to which it belongs; in response to the fact that the number of updates fed back by the sequence identifier of the leaf node is greater than the sequence identifier of its parent node, determining that a node is lost.

[0137] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: in response to a newly added metadata node, an initial sequence identifier is assigned to the metadata node; wherein the metadata node includes a root node and a leaf node, and the sequence identifier is a serial number; in response to a change in a key-value pair of the metadata node, the serial number of the metadata node is increased by a preset value.

[0138] In one embodiment, when obtaining the sequence identifiers of leaf nodes from a root node step by step, the computer program also implements the following steps when executed by a processor: obtaining the sequence identifier of the current node; comparing the sequence identifier of the current node with the sequence identifier of its adjacent upper-level node; in response to the number of updates of the sequence identifier feedback of the current node being less than that of the sequence identifier of its adjacent upper-level node, determining that the current node is a valid node and using its adjacent lower-level node as the new current node.

[0139] In one embodiment, after determining that the current node is a valid node, the computer program further implements the following steps when executed by the processor: obtaining bitmap information; marking the bitmap state of the current node in the bitmap information as valid.

[0140] In one embodiment, after determining that a node is lost, the computer program further implements the following steps when executed by the processor: terminating the acquisition of sequence identifiers of subordinate leaf nodes of the current node; and marking at least the bitmap information of the current node as invalid.

[0141] In one embodiment, when extracting the root nodes of each metadata located in the root node area, the computer program also implements the following steps when executed by the processor: in response to determining that multiple root nodes belong to the same node tree, comparing the sequence identifiers of multiple root nodes belonging to the same node tree; and taking the root node with the largest number of update times of sequence identifier feedback among the multiple root nodes as the root node of the node tree.

[0142] In one embodiment, when repairing the target sub-area, the computer program is executed by the processor to further implement the following steps: using the metadata of the target sub-area as verification metadata; obtaining the key-value pair of the leaf node of the verification metadata, and performing a retry process on the key-value pair; and storing the metadata modified by the retry process to the non-target sub-area.

[0143] In one embodiment, after performing retry processing on the key-value pair, the method further includes: obtaining bitmap information; marking the retry disk placement position in the bitmap information as invalid; wherein the retry disk placement position indicates the placement position of the metadata to be placed in the target sub-area that has been placed in the disk.

[0144] In one embodiment, when obtaining the key-value pairs of the leaf nodes of the verification metadata, the computer program also implements the following steps when executed by the processor: in response to the existence of multiple leaf nodes with matching key-value pair ranges, obtaining the sequence identifiers of the multiple leaf nodes with matching key-value pair ranges; and taking the leaf node with the largest number of updates of the sequence identifier feedback among the multiple leaf nodes as the valid leaf node.

[0145] In one embodiment, when a sub-region for placing metadata to be placed on disk is selected from the metadata placement region as the area to be placed, the computer program also implements the following steps when executed by the processor: obtaining spatial information of each sub-region; wherein the spatial information includes at least one of spatial usage data and spatial free data of the sub-region; and selecting a number of sub-regions for placement as the area to be placed based on the spatial information.

[0146] In one embodiment, after writing the metadata to be written to the target sub-area, the computer program further implements the following steps when executed by the processor: obtaining the data size of the metadata written to the target sub-area; and updating the spatial information of the target sub-area using the data size.

[0147] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0148] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0149] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application.

Claims

1. A metadata management method, characterized in that: The metadata management method comprises: Get the metadata to be written to disk; Selecting a sub-region for storing the metadata to be stored in disk from the metadata storage region as the sub-region to be stored; wherein the metadata storage region includes a plurality of sub-regions for storing the metadata to be stored in disk; At the same time, a plurality of the sub-areas to be written are selected as target sub-areas, and the metadata to be written to the disk are written to the target sub-areas until the metadata to be written to the disk is completed; wherein the number of sub-areas to be written as the target sub-areas is less than the number of sub-areas to be written in the metadata writing area; and when the metadata is repaired, the target sub-areas are repaired; The metadata space includes the metadata disk area and the root node area; the root node area is used to store the root node of the metadata; when repairing metadata, the root node area is scanned to extract the root node, and the root node is determined from the root node whether there is an abnormality in each metadata node.

2. The metadata management method according to claim 1, characterized in that: When repairing the metadata, repairing the target sub-area includes: Obtaining status information of each of the plate landing areas; In response to identifying the status information and determining that the landing sub-area is in a disk writing state, the landing sub-area is determined to be the target sub-area; in response to identifying the status information and determining that the landing sub-area is not in a disk writing state, the landing sub-area is determined to be not the target sub-area.

3. The metadata management method according to claim 2, characterized in that: After selecting a plurality of the pending areas as target areas at the same time, the method further includes: After selecting a plurality of the pending areas as target areas at the same time, the method further includes: Assigning a disk placement identifier to the target sub-area until the metadata to be placed on disk allocated to the target sub-area is placed on disk; and / or, Link to the space mark area, update the current state of the target sub-area in the space mark area to the disk-falling state, until the metadata to be fallen to the disk allocated to the target sub-area is completely fallen to the disk; wherein the space mark area is used to record the current state of the fallen sub-area.

4. The metadata management method according to claim 1, characterized in that: The repairing of the target sub-area comprises: Linking the root node area, extracting the root nodes of each metadata located in the root node area; wherein the root node area is used to store a plurality of root nodes of the metadata; At each of the root nodes, sequentially obtain the sequence identifiers of its leaf nodes from the root node; wherein the sequence identifier is associated with the update times of the root node / the leaf node to which it belongs; In response to the fact that the update times of the sequence identifier feedback of the leaf node is greater than the sequence identifier of its upper node, it is determined that there is a node loss.

5. The metadata management method according to claim 4, characterized in that: The metadata management method comprises: In response to the addition of a new metadata node, assigning the metadata node an initial sequence identifier; wherein the metadata node includes the root node and the leaf node, and the sequence identifier is a sequence number; In response to a change in the key-value pair of the metadata node, the serial number of the metadata node is increased by a preset value.

6. The metadata management method according to claim 5, characterized in that: The step of obtaining the sequence identifiers of leaf nodes from the root node step by step includes: Get the sequence ID of the current node; Compare the sequence identifier of the current node with the sequence identifier of its adjacent upper-level node; In response to the update times of the sequence identifier feedback of the current node being less than the sequence identifier of its adjacent upper-level node, the current node is determined to be a valid node, and its adjacent lower-level node is used as a new current node.

7. The metadata management method according to claim 6, characterized in that: After determining that the current node is a valid node, the following step further includes: Get bitmap information; The bitmap state of the current node in the bitmap information is marked as valid.

8. The metadata management method according to claim 6, characterized in that: After determining that there is a node loss, the method further includes: Ending the acquisition of the sequence identifier of the lower-level leaf node of the current node; At least the bitmap information of the current node is marked as invalid.

9. The metadata management method according to claim 4, characterized in that: The step of extracting the root node of each metadata located in the root node area includes: In response to determining that the plurality of root nodes belong to the same node tree, comparing sequence identifiers of the plurality of root nodes belonging to the same node tree; The root node with the largest number of update times of the sequence identifier feedback among the multiple root nodes is used as the root node of the node tree.

10. The metadata management method according to claim 1, characterized in that: The repairing of the target sub-area comprises: Using the metadata of the target sub-area as verification metadata; Obtaining a key-value pair of a leaf node of the verification metadata, and performing a retry process on the key-value pair; The metadata modified by the retry process is written to a disk that is not the target sub-area.

11. The metadata management method according to claim 10, characterized in that: After the retry processing of the key-value pair is performed, the following steps are further included: Get bitmap information; The retry placement position in the bitmap information is marked as invalid; wherein the retry placement position indicates the placement position of the metadata to be placed in the target sub-area that has been placed in the disk.

12. The metadata management method according to claim 10, characterized in that: The key-value pair of the leaf node of the obtained verification metadata includes: In response to the presence of multiple leaf nodes that match the key-value pair range, obtaining sequence identifiers of the multiple leaf nodes that match the key-value pair range; The leaf node with the largest number of update times of the sequence identifier feedback among the multiple leaf nodes is taken as a valid leaf node.

13. The metadata management method according to claim 1, characterized in that: The sub-area selected from the metadata placement area for placing the metadata to be placed on disk as the sub-area to be placed includes: Acquire the spatial information of each of the plate landing areas; wherein the spatial information includes at least one of the spatial usage data and the spatial idle data of the plate landing area; Based on the spatial information, a plurality of the plate placement areas are selected as the areas to be placed.

14. The metadata management method according to claim 13, characterized in that: After writing the metadata to be written to the disk to the target sub-area, the method further includes: Obtaining the data size of the metadata stored in the target sub-area; The spatial information of the target sub-area is updated using the data size.

15. A storage system, characterized in that: The storage system comprises: Storage system body; A metadata management device is provided in the storage system body and is used to implement the metadata management method as described in any one of claims 1-14.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the metadata management method according to any one of claims 1 to 14 are implemented.

17. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the metadata management method according to any one of claims 1 to 14 are implemented.

18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the metadata management method according to any one of claims 1 to 14 are implemented.