Distributed storage system, metadata management method, device and storage medium

By configuring condition files on the distributed metadata service nodes and having the control nodes compete for permissions, the problem of metadata inconsistency in the distributed metadata service is solved, the updating and deletion of condition files are realized, and the performance and stability of the distributed file system are improved.

CN115203141BActive Publication Date: 2026-06-19ALIBABA (CHINA) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2022-07-13
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

The distributed metadata service approach suffers from metadata inconsistency, which affects the performance and stability of the distributed file system.

Method used

By configuring condition files on distributed metadata service nodes and having management nodes compete for update permissions, the identity of the master management node is obtained to control the consistency of condition files among distributed metadata service nodes. The operation of data by the master management node is used to update, delete and create condition files.

Benefits of technology

It improves the performance of the distributed file system and the efficiency of master-slave management node switching, ensures the consistency of condition files among metadata service nodes, and enhances the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115203141B_ABST
    Figure CN115203141B_ABST
Patent Text Reader

Abstract

This application provides a distributed storage system, a metadata management method, a device, and a storage medium. In this application embodiment, in a distributed metadata service application scenario, distributed metadata service nodes configure condition files. Control nodes acquire operation permissions on data in the distributed file system by competing for the permission to update the condition files. By utilizing the operations of the master control node with data operation permissions on the data in the distributed file system, consistency of condition files among distributed metadata service nodes is achieved. This ensures successful data operations by the master control node, contributing to improved performance of the distributed file system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage technology, and in particular to a distributed storage system, metadata management method, device and storage medium. Background Technology

[0002] In recent years, with the development of information technology, more and more information has been digitized, and data has grown explosively. Distributed file storage can improve the efficiency of data storage and management. For most distributed file storage systems, metadata and file data are usually separated, that is, the control flow and data flow are separated, thereby obtaining higher policy scalability and I / O concurrency. Therefore, the metadata management model is crucial, directly affecting the scalability, performance, reliability, and stability of the policy.

[0003] Existing metadata management methods can be divided into centralized and distributed methods. In a centralized metadata service, each metadata service node operates within a single process, with a central metadata server responsible for storing metadata and handling client query requests. This server provides a unified namespace and handles access control functions such as location resolution and data positioning. In a distributed metadata service, each metadata service node corresponds to an independent process, managing metadata across different dimensions. However, distributed metadata services suffer from metadata inconsistency issues. Summary of the Invention

[0004] This application provides a distributed storage system, a metadata management method, an apparatus, and a storage medium to achieve consistency of condition files among distributed metadata service nodes.

[0005] This application provides a distributed storage system, including: a management node, a distributed metadata service node, and a distributed file system;

[0006] The distributed file system is used for distributed data storage;

[0007] The distributed metadata service nodes run in different processes and are used to manage metadata of different dimensions of the data; the distributed metadata service nodes are configured with condition files;

[0008] The control node is used to become the primary control node by competing for the permission to update the condition file, and as the primary control node, it has the right to operate on the data.

[0009] The main control node is used to control the consistency of the condition files of the distributed metadata service node by operating on the data.

[0010] This application also provides a metadata management method applicable to the main control node, including:

[0011] By competing with other control nodes for the permission to update the condition file configured by the distributed metadata service node, the user gains the permission to operate on data in the distributed file system.

[0012] By manipulating the data, the condition file updates of the distributed metadata service nodes are kept consistent.

[0013] The distributed metadata service node manages metadata of different dimensions of the data.

[0014] This application also provides a metadata management method adapted to distributed metadata service nodes, including:

[0015] Obtain operation requests for data in the distributed file system provided by the master control node;

[0016] In response to the operation request, the condition file of the distributed metadata service node is updated to be consistent;

[0017] The distributed metadata service node manages metadata of different dimensions of the data.

[0018] This application embodiment also provides a computing device, including: a memory, a processor, and a communication component; wherein, the memory is used to store computer programs;

[0019] The processor is coupled to the memory and the communication component to execute the computer program for performing the steps in the above-described metadata management method.

[0020] This application also provides a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps in the above-described metadata management method.

[0021] In this embodiment of the application, in the application scenario of distributed metadata service, the distributed metadata service node configures a condition file, and the control node obtains the permission to operate on the data in the distributed file system by competing for the permission to update the condition file; and by using the operation of the data in the distributed file system by the main control node with the permission to operate on the data, the consistency of the condition files among the distributed metadata service nodes is achieved, which can enable the main control node to operate on the data successfully and help improve the performance of the distributed file system. Attached Figure Description

[0022] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0023] Figure 1 and Figure 2 This is a schematic diagram of the structure of a distributed storage system provided in an embodiment of this application;

[0024] Figure 3 A schematic diagram illustrating the process of updating condition files in the distributed storage system provided in this embodiment of the application;

[0025] Figure 4 A schematic diagram illustrating the operation of the distributed storage system provided in this application embodiment in a distributed metadata service scenario;

[0026] Figure 5 A schematic diagram illustrating the process of achieving condition file consistency among distributed metadata service nodes in a distributed metadata service scenario using a distributed storage system provided in this application embodiment;

[0027] Figure 6 This application provides a schematic diagram illustrating a specific implementation method for achieving condition file consistency among distributed metadata service nodes in a distributed storage system within a distributed metadata service scenario.

[0028] Figure 7 and Figure 8 A flowchart illustrating the metadata management method provided in this application embodiment;

[0029] Figure 9 A schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0031] Figure 1 and Figure 2 This is a schematic diagram of the structure of a distributed storage system provided in an embodiment of this application. Figure 1 As shown, the system mainly includes: a management node 10, a metadata service node 20, and a distributed file system 30.

[0032] The distributed file system 30 can store data in a distributed manner. The data can be file data, image data, or data tables, etc. The distributed file system 30 can implement distributed storage of data based on block storage services. For example, ... Figure 1 and Figure 2 As shown, in a distributed file system, data is stored in chunks across different disks (e.g., disks D0-Dn). For most distributed file storage systems, metadata is typically separated from the data itself, i.e., control flow is separated from data flow, thereby achieving higher policy scalability and I / O concurrency. Therefore, the metadata management model is crucial.

[0033] Metadata service nodes are used to manage data metadata. A metadata service node may include multiple metadata service nodes 20. "Multiple" means two or more. Multiple metadata service nodes 20 are used to manage metadata of different dimensions. In some embodiments, the metadata service nodes may include: a root server 201, a metadata server 202, a namespace server 203, and a data replication and recycling server 204.

[0034] In this distributed file system, root node 201 is responsible for scheduling and managing all nodes in the cluster. Metadata node 202 manages file identifier (INode) information and ensures data security; it can also hold file session locks. Namespace node 203 manages the file system's directory tree. Data replication and garbage collection node 204 is responsible for data replication and garbage collection.

[0035] Metadata management methods can be divided into centralized metadata management methods ( Figure 1 (as shown) and distributed metadata management method ( Figure 2 As shown). Figure 1 As shown, centralized metadata service refers to the above-mentioned metadata service nodes (such as root node 201, metadata node 202, namespace node 203, and data replication and recycling node 204) being located within a single process, collectively referred to as metadata service nodes.

[0036] like Figure 2As shown, the distributed metadata service refers to the fact that the aforementioned metadata service nodes (such as root node 201, metadata node 202, namespace node 203, and data replication and recycling node 204) run in different independent processes, and different metadata service nodes can interact through remote procedure calls (RPC). The metadata service nodes in the distributed metadata service can be referred to as distributed metadata service nodes. Distributed metadata service nodes run in different independent processes and manage different dimensions of metadata in the distributed file system.

[0037] For block storage services, a master-slave service is often used to improve service stability. This involves using multiple master nodes (10) to act as master and slave nodes to provide block storage services. "Multiple" refers to two or more nodes. The master node (10) can also be called the block service master node. The persistent data on the master node (10) can be written to a distributed file system.

[0038] Multiple management nodes (10) can compete for master status and have access to the distributed file system. To prevent split-brain scenarios, some conventional solutions use distributed application coordination service software (such as Zookeeper) to allow multiple management nodes (10) to compete for master status. The distributed application coordination service software provides a distributed lock service. The principle is that if an abnormal process encounters an error while maintaining the lock service, it will release the distributed lock. Other processes continuously compete for the lock to ensure that the anomaly is detected as soon as possible and take over the service. Once the lock is acquired, it means that the right to provide external services has been obtained, and external services can begin.

[0039] For distributed lock services, service switching requires waiting for the lock to time out before switching can proceed. In a distributed environment, such timeouts are definitely on the order of seconds or more. In large-scale and complex environments, in order to tolerate short-term anomalies, such timeouts will be made even longer, resulting in low service switching efficiency.

[0040] In some embodiments of this application, to improve service switching efficiency, a condition file (or inline file) can be configured on the metadata service node. In these embodiments, the condition file is a custom file that does not contain data and lacks information such as file length and chunk count. The condition file refers to a file that provides operation conditions for the management node 10 to operate on data in the distributed file system 30. The condition file includes operation interfaces. These interfaces include, but are not limited to, a Seal File interface, an Update Inline File interface, and a Start Inline File interface. A Seal File interface refers to sealing a file to prevent write operations. The management node 10 can call the operation interfaces of the condition file to compete for operation rights; the management node that acquires operation rights to the condition file becomes the primary management node. The primary management node acquires operation rights to the distributed file system 30. These operation rights may include access to data in the distributed file system 30 (such as...). Figure 1 and Figure 2 Access permissions for each data block in the distributed file system (30) and access permissions for the metadata of the distributed file system 30, etc.

[0041] Specifically, such as Figure 1 and Figure 2 As shown, multiple control nodes 10 can compete for the right to update the condition file to become the master control node. As the master control node, it has the right to operate on the data in the distributed file system 30, thus enabling the switching of master and slave control nodes. This master-slave switching method, compared to the distributed lock method, does not require waiting for the distributed lock to expire, which helps improve the efficiency of master-slave control node switching.

[0042] Specifically, such as Figure 3 As shown, when multiple control nodes 10 compete for master, they can provide update requests to namespace node 203. Each control node 10's update request includes: the updated content of the condition file and the original content of the condition file recorded by that control node.

[0043] Namespace node 203 can receive update requests from management node 10 and compare the original content of the condition file recorded by the management node carried in the update request with the content of the condition file on namespace node 203. In the centralized metadata service mode, since all metadata service nodes run in the same process, multiple metadata service nodes can be configured with the same condition file. Accordingly, the condition file on namespace node 203 is a common condition file shared by multiple metadata service nodes.

[0044] For a distributed metadata service, since each metadata service node runs in a separate, independent process, each metadata service node can be configured with a condition file. Therefore, in a distributed metadata service, each metadata service node has its own condition file. Accordingly, the condition file on namespace node 203 is an independent condition file on namespace node 203.

[0045] Furthermore, for a target update request where the original content of the carried condition file is the same as the content of the condition file on the namespace node, the namespace node 203 can update the content of the condition file on the namespace node to the updated content carried in the target update request, thereby obtaining the target condition file and realizing the update of the condition file on the namespace node 203. Furthermore, the namespace node 203 can return an update success message to the control node 10 that provided the target update request.

[0046] The control node 10 that provides the target update request can receive the update success message and determine the control node that receives the update success message as the master control node. In this way, it can be guaranteed that only one control node can successfully take over as the master at the same time.

[0047] For the master control node that successfully seizes control, it can also use the updated target condition file as a condition to seal the data being written in the distributed file system. This prevents other control nodes (excluding the master control node) from writing to the data being written in the distributed file system, thus preventing other control nodes from continuing to write to the data. Specifically, sealing the data being written in the distributed file system means forcibly releasing the file lock on the data being written, thereby preventing write operations on the data being written.

[0048] Subsequently, the master control node can operate on the distributed file system based on the target condition file. Specifically, the operation request initiated by the master control node carries the content of the target condition file. The metadata service node compares the content of the condition file carried in the operation request with the content of the condition file it stores. If they are the same, it determines that the master control node has operation permissions on the distributed file system and allows the master control node to operate on the distributed file system.

[0049] The following provides an exemplary description of the operation process of the master control node on data in the distributed file system under the distributed metadata service mode, using condition files as conditions. The operations performed by the master control node on the data refer to operations on the data itself in the distributed file system, such as opening a file, opening a file for writing (e.g., Open4Apend operation), sealing a file, and releasing a lock and sealing a file, but are not limited to these.

[0050] like Figure 4 As shown, when the master control node needs to operate on the data in the distributed file system 30, it can provide an operation request to the namespace node 203 (corresponding to...). Figure 4 Step 1). This operation request may include: the contents of the condition file recorded by the main control node (defined as the first content) and operation information, etc.

[0051] Namespace node 203 can receive operation requests; and retrieve the first content (corresponding to) of the condition file recorded by the master control node from the operation request. Figure 4 Step 2). Further, namespace node 203 can compare the first content of the condition file recorded by the master control node with the content of the condition file on the namespace node (defined as the second content); if the first content of the condition file recorded by the master control node and the second content of the condition file on the namespace node are the same, namespace node 203 can determine the identifier of the data to be operated on in the operation request (such as INode information) and the identifier of the condition file on the namespace node (corresponding to...). Figure 4 Step 3). Here, the identifier of a condition file on the namespace node refers to the information that uniquely identifies a condition file, which may include: the name and version information of the condition file, etc.

[0052] Furthermore, namespace node 203 can return to the main control node the identifier of the data to be operated on (such as INode information) and the version information of the condition file on the namespace node (corresponding to...). Figure 4 Step 4). For the primary control node, it can receive the identifier of the data to be operated on in the operation request (such as INode information) and the version information of the condition file on the namespace node; and based on the first content of the condition file recorded by the primary control node and the identifier of the data to be operated on in the operation request (such as INode information), it generates another operation request (corresponding to...). Figure 4 Step 5); and send the operation request to metadata node 202 (corresponding to Figure 4Step 6). In this embodiment of the application, for ease of description and distinction, the operation request sent by the main control node to the namespace node 203 is defined as the first operation request; and the operation request sent by the main control node to the metadata node 202 is defined as the second operation request.

[0053] Accordingly, the metadata node 202 can receive a second operation request; and from the second operation request, obtain the first content of the condition file recorded by the main control node and the identifier of the data to be operated on in the operation request (such as INode information).

[0054] Furthermore, metadata node 202 can compare whether the first content of the condition file recorded by the primary control node is consistent with the content of the condition file on metadata node 202 (defined as the third content). Figure 4 Step 7): If the first content of the condition file recorded by the main control node is consistent with the third content of the condition file on the metadata node 202, then it is determined that the main control node has operation permissions for the data to be operated on, and can perform operations on the data to be operated on according to the second operation request (corresponding to...). Figure 4 Step 8); and return the operation result corresponding to the second operation request to the main control node (corresponding to Figure 4 Step 9). Accordingly, if the content of the condition file recorded by the main control node is inconsistent with the content of the condition file on the metadata node 202, it is determined that the main control node does not have operation permissions for the data to be operated on, and an operation failure message or no operation permission prompt message is returned to the main control node.

[0055] Based on the above process, it is clear that in a distributed metadata service, for the master control node to operate on the data in the distributed file system 30, the consistency of condition files among the distributed metadata service nodes is required. Therefore, in the application scenario of distributed metadata services, how to achieve the consistency of condition files among the distributed metadata service nodes is a technical problem that urgently needs to be solved.

[0056] based on Figure 4 The illustrated process of the master control node operating on data in the distributed file system 30 shows that the master control node operates on data based on the condition files of each distributed metadata service node. Therefore, in this embodiment, to ensure the consistency of condition files among the distributed metadata service nodes, such as... Figure 5 As shown, the master control node can control the consistency of condition files on the distributed metadata service nodes by operating on the data in the distributed file system 30. Specifically, the master control node mainly uses operations on the data in the distributed file system 30 to control the consistency of condition files on the metadata node 202 and the namespace node 203 in the distributed metadata service nodes.

[0057] The following is combined with Figure 6 The specific implementation shown exemplifies how the main control node controls the consistency of condition files of the distributed metadata service node by operating on data in the distributed file system 30. Among these, Figure 6 For a description of steps 1-4 above, please refer to the above. Figure 4 The details of steps 1-4 are not repeated here.

[0058] exist Figure 6 In step 5, the primary control node can generate a second operation request based on the content of the condition file recorded by the primary control node, the identifier of the data to be operated on in the operation request (such as INode information), and the version information of the condition file of the namespace node 203; and send the second operation request to the metadata node 202 (corresponding to Figure 6 Step 6).

[0059] Accordingly, the metadata node 202 can receive the second operation request; and from the second operation request, it can obtain the content of the condition file recorded by the main control node, the identifier of the data to be operated on in the operation request (such as INode information), and the version information of the condition file of the namespace node 203.

[0060] Furthermore, metadata node 202 can compare the version information of the condition file of metadata node 202 with that of the condition file of namespace node 203 (corresponding to...). Figure 6 Step 7); If the version information of the condition file of namespace node 203 is later than the version information of the condition file of metadata node 202, it means that the condition file of namespace node 203 has been updated, while the condition file of metadata node 202 has not been updated. Here, "the version information of the condition file of namespace node 203 is later than the version information of the condition file of metadata node 202" can be implemented by meaning that the version number of the condition file of namespace node 203 is greater than the version number of the condition file of metadata node 202. Therefore, when the version information of the condition file of namespace node 203 is later than the version information of the condition file of metadata node 202, the content of the condition file of metadata node 202 can be updated to the content of the condition file recorded in the main control node (corresponding to...). Figure 6 (Step 8.1)

[0061] Since the content of the condition file recorded by the master control node is consistent with the content of the condition file of namespace node 203, after updating the content of the condition file of metadata node 202 to the content of the condition file recorded by the master control node, the content of the condition file of metadata node 202 is consistent with the content of the condition file of namespace node 203, thus achieving consistency between the condition files on metadata node 202 and namespace node 203.

[0062] Furthermore, metadata node 202 can perform operations on the data to be operated on based on the second operation request (corresponding to...). Figure 6 Step 9); and return the operation result corresponding to the second operation request to the main control node (corresponding to...). Figure 6 (Step 10)

[0063] Accordingly, if the version information of the condition file of namespace node 203 is earlier than the version information of the condition file of metadata node 202, it indicates that another control node may have successfully preempted the master node. Consequently, in the case where the version information of the condition file of namespace node 203 is earlier than the version information of the condition file of metadata node 202, metadata node 202 can also compare the content of the condition file of the metadata node with the content of the condition file recorded by the master control node (corresponding to...). Figure 6 (Step 8.2); If the content of the condition file of the metadata node is the same as the content of the condition file recorded by the main control node, the data to be operated on can be operated on according to the second operation request (corresponding to...). Figure 6 Step 9); and return the operation result corresponding to the second operation request to the main control node (corresponding to...). Figure 6 (Step 10). Accordingly, if the content of the condition file of the metadata node is different from the content of the condition file recorded by the main control node, and it is determined that the main control node has no operation permission for the data, then the metadata node 202 can return an operation failure message and / or no operation permission prompt information to the main control node.

[0064] In this embodiment of the application, in the application scenario of distributed metadata service, the operation of the master control node on the data in the distributed file system is used to achieve the consistency of the condition files among the distributed metadata service nodes, which can enable the master control node to operate on the data successfully and help improve the performance of the distributed file system.

[0065] In this embodiment, the distributed storage system not only supports updating condition files, but also supports deleting condition files. The deletion process of condition files is described below as an example.

[0066] For the distributed metadata service nodes, since namespace node 203 and metadata node 202 have a one-to-many relationship, primarily because the identifiers (INodes, etc.) of data on a directory tree can be managed by multiple metadata nodes 202, the condition files of namespace node 203 and metadata node 202 also have a one-to-many relationship. Based on this, when namespace node 203 receives a condition file deletion request, it needs to initiate condition file deletion requests to the corresponding multiple metadata nodes 202.

[0067] Specifically, when a condition file needs to be deleted, the master control node can send a condition file deletion request to the namespace node 203. The condition file deletion request may include: the identifier (such as the name) of the condition file to be deleted and the content of the condition file to be deleted as recorded by the master control node.

[0068] Namespace node 203 can receive conditional file deletion requests and, in response, determine the target metadata node configured with the conditional file to be deleted. Specifically, namespace node 203 can obtain the identifier of the conditional file to be deleted and the content of the conditional file to be deleted recorded by the main control node from the conditional file deletion request; further, namespace node 203 can determine the target metadata node configured with the conditional file to be deleted based on the identifier of the conditional file to be deleted. Optionally, namespace node 203 can also compare whether the content of the conditional file to be deleted recorded by the main control node is the same as the content of the conditional file to be deleted on namespace node 203; if they are the same, it is determined that the main control node has operation permissions for the conditional file to be deleted. Correspondingly, if the content of the conditional file to be deleted recorded by the main control node is different from the content of the conditional file to be deleted on namespace node 203, it is determined that the main control node does not have operation permissions for the conditional file to be deleted, and can return deletion failure information and / or no operation permission prompt information to the main control node.

[0069] If the content of the condition file to be deleted recorded on the primary control node is the same as the content of the condition file to be deleted on namespace node 203, namespace node 203 can send a condition file deletion request to the target metadata node. Specifically, namespace node 203 can generate a condition file deletion request based on the identifier of the condition file to be deleted and the content of the condition file to be deleted in namespace node 203. The condition file deletion request includes: the identifier of the condition file to be deleted and the content of the condition file to be deleted in namespace node 203.

[0070] In this embodiment of the application, for ease of description and distinction, the conditional file deletion request sent by the main control node to the namespace node 203 is defined as the first conditional file deletion request; and the conditional file deletion request sent by the namespace node 203 to the target metadata node is defined as the second conditional file deletion request.

[0071] Accordingly, the target metadata node can receive a second conditional file deletion request and, in response, delete the conditional file to be deleted. Specifically, the target metadata node can obtain the identifier of the conditional file to be deleted and the content of the conditional file to be deleted in namespace node 203 from the second conditional file deletion request; and compare whether the content of the conditional file to be deleted on the target metadata node is consistent with the content of the conditional file to be deleted in namespace node 203; if they are consistent, the conditional file to be deleted is deleted, and a deletion success message is returned to namespace node 203; if they are inconsistent, a deletion failure message is returned to namespace node 203, etc.

[0072] Accordingly, namespace node 203 can delete the condition file to be deleted in response to a deletion success message. Specifically, namespace node 203 deletes the condition file to be deleted upon receiving deletion success messages from all target metadata nodes.

[0073] In some cases, while namespace node 203 is controlling metadata node 202 to delete a conditional file via a conditional file deletion request, other requests may be requesting conditional files to be deleted on metadata node 202. Blindly deleting these files would cause other requests to fail, impacting the performance of the distributed file system. To address this issue, in some embodiments of this application, namespace node 203 may, in response to a first conditional file deletion request, time a delay period; and if the delay period reaches a set duration, send a second conditional file deletion request to the target metadata node. The set duration can be configured based on the time required for historical requests to operate on the conditional files of metadata node 202. The set duration is greater than or equal to the time required for historical requests to operate on the conditional files of metadata node 202. This allows for delayed deletion of conditional files on the target metadata node, reducing the probability of other requests failing.

[0074] Alternatively, in some embodiments, the metadata node 202 may periodically query the condition file of the namespace node 203 according to a set query period. If a condition file that does not exist in the namespace node 203 is found in the metadata node 202, the condition file that does not exist in the namespace node 203 is deleted from the metadata node 202, thereby achieving consistency between the condition files of the cloud data node and the namespace node.

[0075] Optionally, metadata node 202 can query the condition file of namespace node 203 using the identifier and content of the condition file on metadata node 202. Specifically, metadata node 202 can periodically send query requests to namespace node 203 according to a set query cycle. The query request includes the identifier and content of the condition file on metadata node 202. Namespace node 203 can receive the query request and obtain the identifier and content of the condition file on metadata node 202 from the query request. Further, namespace node 203 can compare the identifier of the condition file on metadata node 202 with the identifier of the condition file on namespace node 203, and compare the content of the condition file on metadata node 202 with the content of the condition file on namespace node 203; if the identifier of the condition file on metadata node 202 is different from the identifier of the condition file on namespace node 203, and / or, the content of the condition file on metadata node 202 is different from the content of the condition file on namespace node 203, it is determined that metadata node 202 has a condition file that namespace node 203 does not have.

[0076] Furthermore, namespace node 203 can return a message to metadata node 202 indicating that the condition file corresponding to the query request does not exist. Metadata node 202 can receive the message indicating that the condition file corresponding to the query request does not exist, and if it determines that there is a condition file in metadata node 202 that does not exist in namespace node 203, it will delete the condition file that does not exist in namespace node 203 from metadata node 202, thus achieving consistency of condition files between cloud data nodes and namespace nodes.

[0077] In this embodiment, the control node 10 can not only drive the deletion of condition files, but also the creation of condition files. Specifically, the main control node can send a condition file creation request to the namespace node 203; the condition file creation request may include the content of the condition file to be created.

[0078] Accordingly, namespace node 203 can create a condition file in response to a condition file creation request. Specifically, namespace node 203 can obtain the content of the condition file to be created from the condition file creation request; and create the condition file on namespace node 203 based on the content of the condition file to be created. Metadata node 202 can perform the above... Figure 4 During the data manipulation process shown, a condition file consistent with the namespace node 203 is created on the metadata node 202 to achieve consistency between the condition files on the metadata node 202 and the namespace node 203.

[0079] The master control node can also update the condition files on the distributed metadata service nodes. The update process for the condition files can be found above. Figure 3 The relevant details will not be elaborated upon here. Each time the condition file on the distributed metadata service node is updated, its version information is incremented by 1.

[0080] In this embodiment, the control node 10 operates on data in the distributed file system. Some operations require manipulation of the data itself, such as opening a file, opening and writing a file (e.g., Open4Apend operation), sealing a file, and releasing a lock and sealing a file. Other operations only require manipulation of the data's metadata (e.g., directories), such as creating, deleting, and renaming files. These operations are operations on ordinary data in the distributed file system, not operations on condition files. Therefore, when the main control node needs to operate on the data directory, it can initiate an operation request (defined as a third operation request) to the namespace node 203. The third operation request carries the content of the condition file recorded by the main control node.

[0081] Namespace node 203 can receive a third operation request and obtain the content of the condition file recorded by the master control node from the third operation request. Further, namespace node 203 can compare the content of the condition file recorded by the master control node with the content of the file conditions of namespace node 203; if the content of the condition file recorded by the master control node is the same as the content of the file conditions of namespace node 203, it can be determined that the master control node has operation permissions on the data directory; furthermore, namespace node 203 can perform operations on the directory tree managed by namespace node 203 according to the third operation request. For example, if the third operation request is a file creation request, namespace node 203 can add the identifier of the newly created file (such as INode information) to the directory tree managed by namespace node 203 according to the file creation request.

[0082] It is worth noting that in the above distributed storage system, operations on condition files (such as condition file updates, creation, and deletion) are driven by a control node. In the distributed storage system, the control node plays the role of a client, thereby achieving client-driven consistency.

[0083] In addition to the distributed storage system embodiments described above, this application also provides a metadata management method. The metadata management method provided in this application will be illustrated below from the perspectives of a control node and a distributed metadata service node.

[0084] Figure 7This is a flowchart illustrating the metadata management method provided in an embodiment of this application. This method is applicable to the main control node. For example... Figure 7 As shown, the method mainly includes:

[0085] 701. By competing with other control nodes for the permission to update the condition file configured by the distributed metadata service node, the user gains the right to operate on data in the distributed file system.

[0086] 702. By manipulating data, ensure that the condition files of the distributed metadata service nodes are updated consistently.

[0087] Figure 8 This is a flowchart illustrating another metadata management method provided in an embodiment of this application. This method is applicable to distributed metadata service nodes. Figure 8 As shown, the method mainly includes:

[0088] 801. Obtain operation requests for data in the distributed file system provided by the master control node.

[0089] 802. In response to the operation request, update the condition files of the distributed metadata service nodes to be consistent.

[0090] In this embodiment, the description of the distributed file system and the distributed metadata service node can be found in the relevant content of the above system embodiment, and will not be repeated here.

[0091] In some embodiments of this application, to improve service switching efficiency, a condition file can be configured on the distributed metadata service node. In step 701, the master control node becomes the master control node by competing with other control nodes for the permission to update the condition file and gaining the right to operate on data in the distributed file system. That is, multiple control nodes can become the master control node by competing for the permission to update the condition file, and then have the right to operate on data as the master control node, thus realizing the master-slave control node switching. This master-slave switching method does not require waiting for the distributed lock to expire, compared to the distributed lock method.

[0092] Specifically, update requests can be provided to namespace nodes. Each control node's update request includes: the updated content of the condition file and the original content of the condition file recorded by that control node.

[0093] Namespace nodes can receive update requests from management nodes and compare the original content of the condition file recorded by the management node carried in the update request with the content of the condition file on the namespace node.

[0094] Furthermore, for a target update request whose original content of the carried condition file is the same as the content of the condition file on the namespace node, the namespace node can update the content of the condition file on the namespace node to the update content carried by the target update request, thereby obtaining the target condition file and realizing the update of the condition file on the namespace node. Figure 7 In the method shown, the target update request is provided by the primary control node. Furthermore, the namespace node can return an update success message to the control node that provided the target update request.

[0095] The control node that provides the target update request can receive the update success message and determine the control node that receives the update success message as the master control node. In this way, it can be guaranteed that only one control node can successfully take over as the master at any given time.

[0096] For the master control node that successfully seizes control, it can also use the updated target condition file as a condition to seal the data being written in the distributed file system. This prevents other control nodes besides the master control node from writing to the data being written in the distributed file system, thus preventing other control nodes from continuing to write to the data. Specifically, sealing the data being written in the distributed file system means forcibly releasing the file lock on the data being written to the distributed file system, thereby preventing write operations on the data being written to the distributed file system.

[0097] Subsequently, the master control node can operate on the distributed file system based on the target condition file. Specifically, the operation request initiated by the master control node carries the content of the target condition file. The metadata service node compares the content of the condition file carried in the operation request with the content of the condition file it stores. If they are the same, it determines that the master control node has operation permissions on the distributed file system and allows the master control node to operate on the distributed file system.

[0098] Based on the above system embodiments Figure 4 The illustrated operation process in a distributed metadata management scenario shows that, in a distributed metadata service, for the master control node to operate on data in the distributed file system, the consistency of condition files among the distributed metadata service nodes is required. Therefore, in the application scenario of distributed metadata services, how to achieve the consistency of condition files among distributed metadata service nodes is a technical problem that urgently needs to be solved.

[0099] based on Figure 4The illustrated process of the master control node operating on data in the distributed file system shows that the master control node operates on data based on the condition files of each distributed metadata service node. Therefore, in this embodiment, to ensure the consistency of condition files among the distributed metadata service nodes, in step 702, the operation on data in the distributed file system can be used to control the consistency of the condition files of the distributed metadata service nodes. Accordingly, for the distributed metadata service nodes, in step 801, the operation request from the master control node for data operations in the distributed file system can be obtained; and in step 802, in response to the operation request, the condition files of the distributed metadata service nodes can be updated to be consistent.

[0100] Specifically, step 702 can be implemented as follows: the main control node mainly uses the data operations in the distributed file system to control the consistency of the condition files on the metadata nodes and namespace nodes in the distributed metadata service node.

[0101] Accordingly, step 802 can be implemented as follows: using the metadata node and namespace node in the distributed metadata service node, in response to the operation request, update the condition files on the metadata node and namespace node to the same condition file.

[0102] The specific implementation methods for steps 702 and 802 are described below, please refer to the above. Figure 6 The relevant content will not be repeated here. Based on the above... Figure 6 One possible implementation for controlling the consistency of condition files on the metadata node and namespace node in the distributed metadata service node, where the control node primarily utilizes data operations in the distributed file system, is as follows: A first operation request is provided to the namespace node; the first operation request includes the first content of the condition file recorded by the main control node, so that if the first content is the same as the second content of the condition file on the namespace node, the namespace node returns the identifier of the data to be operated on in the first operation request and the version information of the condition file on the namespace node; based on the first content, the identifier of the data to be operated on, and the version information of the condition file on the namespace node, a second operation request is generated; the second operation request is provided to the metadata node, so that if the version information of the condition file on the namespace node is later than the version information of the condition file on the metadata node, the metadata node updates the content of the condition file on the metadata node to the first content.

[0103] Accordingly, one optional implementation method for updating the condition files on the metadata nodes and namespace nodes to the same condition file in response to an operation request, utilizing the metadata nodes and namespace nodes in the distributed metadata service nodes, is as follows: The metadata node receives a first operation request from the master control node; the first operation request includes a first content of the condition file recorded by the master control node; the namespace node compares the first content with a second content of the condition file on the namespace node; if the first content and the second content are the same, the namespace node returns to the master control node the identifier of the data to be operated on in the first operation request and the version information of the condition file on the namespace node; the metadata node receives a second operation request generated by the master control node based on the first content, the identifier of the data to be operated on, and the version information of the condition file on the namespace node; if the version information of the condition file on the namespace node is later than the version information of the condition file on the metadata node, the metadata node updates the content of the condition file on the metadata node to the first content.

[0104] Since the content of the condition file recorded by the master control node is consistent with the content of the condition file of the namespace node, after updating the content of the condition file of the metadata node to the content of the condition file recorded by the master control node, the content of the condition file of the metadata node is consistent with the content of the condition file of the namespace node, thus achieving consistency between the condition files on the metadata node and the namespace node.

[0105] Furthermore, the metadata node can perform operations on the data to be operated on based on the second operation request, and return the operation result corresponding to the second operation request to the main control node. Accordingly, the main control node can receive the operation result corresponding to the second operation request.

[0106] Accordingly, if the version information of the condition file of the namespace node is earlier than that of the condition file of the metadata node, it indicates that another control node may have successfully preempted the master node. In this case, the metadata node can be used to compare the content of its condition file with the content of the condition file recorded by the master control node. If the content of the metadata node's condition file is the same as that of the master control node, the metadata node can be used to operate on the data to be operated on according to the second operation request and return the operation result corresponding to the second operation request to the master control node. Conversely, if the content of the metadata node's condition file is different from that of the master control node, indicating that the master control node does not have operation permissions on the data, the metadata node can return an operation failure message and / or a message indicating insufficient operation permissions to the master control node.

[0107] In this embodiment of the application, in the application scenario of distributed metadata service, the operation of the master control node on the data in the distributed file system is used to achieve the consistency of the condition files among the distributed metadata service nodes, which can enable the master control node to operate on the data successfully and help improve the performance of the distributed file system.

[0108] In this embodiment, the distributed storage system not only supports updating condition files, but also supports deleting condition files. The deletion process of condition files is described below as an example.

[0109] For distributed metadata service nodes, the relationship between namespace nodes and metadata nodes is one-to-many. This is primarily because the identifiers (INodes, etc.) of data on a directory tree can be managed by multiple metadata nodes. Therefore, the condition files of namespace nodes and metadata nodes also have a one-to-many relationship. Based on this, when a namespace node receives a condition file deletion request, it needs to initiate condition file deletion requests to the corresponding multiple metadata nodes.

[0110] Specifically, when a condition file needs to be deleted, the master control node can send a condition file deletion request to the namespace node. The condition file deletion request may include: the identifier (such as the name) of the condition file to be deleted and the content of the condition file to be deleted as recorded by the master control node.

[0111] For distributed metadata service nodes, namespace nodes can receive conditional file deletion requests and, in response, determine the target metadata node configured with the conditional file to be deleted. Specifically, namespace nodes can obtain the identifier of the conditional file to be deleted and its content recorded by the main control node from the deletion request. Further, namespace nodes can determine the target metadata node configured with the conditional file to be deleted based on its identifier. Optionally, namespace nodes can compare the content of the conditional file to be deleted recorded by the main control node with the content of the conditional file to be deleted on the namespace node. If they are the same, it is determined that the main control node has permission to operate on the conditional file to be deleted. Conversely, if the content of the conditional file to be deleted recorded by the main control node differs from the content of the conditional file to be deleted on the namespace node, it is determined that the main control node does not have permission to operate on the conditional file to be deleted, and a deletion failure message and / or a permission denied message can be returned to the main control node.

[0112] If the content of the condition file to be deleted recorded on the primary control node is the same as the content of the condition file to be deleted on the namespace node, the namespace node can be used to send a condition file deletion request to the target metadata node. Specifically, the namespace node can generate a condition file deletion request based on the identifier of the condition file to be deleted and the content of the condition file to be deleted in the namespace node. This condition file deletion request includes: the identifier of the condition file to be deleted and the content of the condition file to be deleted in the namespace node.

[0113] In this embodiment of the application, for ease of description and distinction, the conditional file deletion request sent by the main control node to the namespace node is defined as the first conditional file deletion request; and the conditional file deletion request sent by the namespace node to the target metadata node is defined as the second conditional file deletion request.

[0114] Accordingly, the target metadata node can receive a second conditional file deletion request and, in response, delete the conditional file to be deleted. Specifically, the target metadata node can obtain the identifier of the conditional file to be deleted and the content of the conditional file to be deleted in the namespace node from the second conditional file deletion request; and compare whether the content of the conditional file to be deleted on the target metadata node is consistent with the content of the conditional file to be deleted in the namespace node; if they are consistent, the conditional file to be deleted is deleted, and a deletion success message is returned to the namespace node; if they are inconsistent, a deletion failure message is returned to the namespace node, etc.

[0115] Accordingly, the namespace node can be used to delete the conditional file to be deleted in response to a deletion success message. Specifically, the namespace node deletes the conditional file to be deleted upon receiving deletion success messages from all target metadata nodes.

[0116] In some cases, while a namespace node is controlling a metadata node to delete a conditional file via a conditional file deletion request, other requests may be requesting the same conditional file on the metadata node. Blindly deleting these files could cause other requests to fail, impacting the performance of the distributed file system. To address this issue, in some embodiments of this application, the namespace node can time the delay period in response to a first conditional file deletion request; and when the delay period reaches a set duration, a second conditional file deletion request can be sent to the target metadata node. The set duration can be configured based on the duration required for historical requests to operate on the conditional files of the metadata node. The set duration is greater than or equal to the duration required for historical requests to operate on the conditional files of the metadata node. This allows for delayed deletion of conditional files on the target metadata node, reducing the probability of other requests failing.

[0117] Alternatively, in some embodiments, the metadata node can periodically query the condition files of the namespace node according to a set query cycle. If a condition file exists in the metadata node that does not exist in the namespace node, the non-existent condition file is deleted from the metadata node, thus achieving consistency between the condition files of the cloud data node and the namespace node. For specific implementation methods of periodically querying the condition files of the namespace node using the metadata node, please refer to the relevant content of the above system embodiments, which will not be repeated here.

[0118] In this embodiment, the control node can not only drive the deletion of condition files, but also the creation of condition files. Specifically, the main control node can send a condition file creation request to the namespace node; the condition file creation request may include the content of the condition file to be created.

[0119] Accordingly, for the distributed metadata service node, the namespace node can respond to the condition file creation request and create the condition file on the namespace node. For specific implementation details on creating the condition file, please refer to the relevant content in the above system embodiments, which will not be repeated here.

[0120] In this embodiment, the control node operates on data in the distributed file system. For operations requiring manipulation of the data itself, the main control node can initiate an operation request (defined as a third operation request) to the namespace node when it needs to operate on the data directory. The third operation request carries the contents of the condition file recorded by the main control node.

[0121] Accordingly, for the distributed metadata service node, the namespace node can receive the third operation request and obtain the content of the condition file recorded by the main control node from the third operation request. Furthermore, the namespace node can compare the content of the condition file recorded by the main control node with the content of the file conditions of the namespace node; if the content of the condition file recorded by the main control node is the same as the content of the file conditions of the namespace node, it can be determined that the main control node has operation permissions on the data directory; furthermore, the namespace node can perform operations on the directory tree managed by the namespace node according to the third operation request.

[0122] It is worth noting that in the above distributed storage system, operations on condition files (such as condition file updates, creation, and deletion) are driven by a control node. In the distributed storage system, the control node plays the role of a client, thereby achieving client-driven consistency.

[0123] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 701 and 702 can be device A; or the execution subject of step 701 can be device A, and the execution subject of step 702 can be device B; and so on.

[0124] Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 701, 702, etc., are merely used to distinguish different operations and do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel.

[0125] Accordingly, embodiments of this application also provide a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause one or more processors to perform the steps in the aforementioned metadata management methods.

[0126] Figure 9 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Figure 9 As shown, the computing device mainly includes: a memory 90a, a processor 90b, and a communication component 90c.

[0127] In some embodiments, the computing device may be implemented as a management node. Accordingly, the processor 90b is coupled to the memory 90a and the communication component 90c for executing computer programs to: acquire operation permissions on data in the distributed file system by contending with other management nodes for permission to update the condition file configured by the distributed metadata service node; and control the consistency of the condition file updates of the distributed metadata service node by using the operation on the data through the communication component 90c.

[0128] In some embodiments, when the processor 90b updates the condition files of the distributed metadata service node to be consistent by using data operations, it is specifically used to: control the condition files on the metadata node and namespace node in the distributed metadata service node to be updated to the same condition file by using data operations through the communication component 90c.

[0129] Optionally, when the processor 90b uses data operations to control the condition files on the metadata node and namespace node in the distributed metadata service node to be the same, it specifically performs the following: providing a first operation request to the namespace node through the communication component 90c; the first operation request includes a first content of the condition file recorded by the master control node, so that if the first content is the same as the second content of the condition file on the namespace node, the namespace node returns the identifier of the data to be operated on in the first operation request and the version information of the condition file on the namespace node; generating a second operation request based on the first content, the identifier of the data to be operated on, and the version information of the condition file on the namespace node; and providing the second operation request to the metadata node through the communication component 90c, so that if the version information of the condition file on the namespace node is later than the version information of the condition file on the metadata node, the metadata node updates the content of the condition file on the metadata node to the first content.

[0130] Optionally, the processor 90b is further configured to: receive, via the communication component 90c, the operation result corresponding to the second operation request returned by the metadata node; the operation result is obtained by the metadata node performing operations on the data to be operated on according to the second operation request after updating the content of the metadata node's condition file to the first content; or, the operation result is obtained by the metadata node performing operations on the data to be operated on according to the second operation request when the version information of the namespace node's condition file is earlier than the version information of the metadata node's condition file, and the content of the metadata node's condition file is the same as the first content.

[0131] In some embodiments, when the processor 90b obtains operation permissions on data in the distributed file system by competing with other management nodes for the permission to update the condition file configured by the distributed metadata service node, it is specifically used to: provide an update request to the namespace node through the communication component 90c; the update request includes the updated content of the condition file and the original content of the condition file recorded by the main management node, so that the namespace node can update the content of the condition file on the namespace node to the updated content if the original content is the same as the content of the condition file on the namespace node, so as to obtain the target condition file; receive the update success message returned by the namespace node through the communication component 90c; and determine that the management node that received the update success message is the main management node.

[0132] Optionally, the processor 90b is also configured to: seal the first data being written in the distributed file system based on the target condition file, so as to prevent other control nodes among the multiple control nodes, except the primary control node, from writing the first data.

[0133] Optionally, the processor 90b is further configured to: provide a third operation request to the namespace node via the communication component 90c to operate on the directory of the data; the third operation request carries the first content of the condition file recorded by the master control node, so that the namespace node can operate on the directory tree managed by the namespace node according to the third operation request if the first content is the same as the second content of the condition file on the namespace node.

[0134] Optionally, the processor 90b is also configured to: send a condition file creation request to the namespace node via the communication component 91c, so as to create a condition file in the namespace node in response to the condition file creation request.

[0135] In some embodiments of this application, the computing device may also be implemented as a distributed metadata service node. Each metadata service node in the distributed metadata service node may be implemented as a different independent process within the computing device. Accordingly, the processor 90b is configured to: obtain operation requests for data in the distributed file system provided by the main control node through the communication component 90c; and, in response to the operation requests, update the condition files of the distributed metadata service nodes to ensure consistency; wherein the distributed metadata service nodes manage metadata of different dimensions of the data.

[0136] Optionally, when processor 90b updates the condition files of the distributed metadata service node in response to an operation request, it specifically uses the metadata node and namespace node in the distributed metadata service node to update the condition files on the metadata node and namespace node to the same condition file in response to the operation request.

[0137] Optionally, when the processor 90b updates the condition files on the metadata node and namespace node to the same condition file in response to an operation request using the metadata node and namespace node in the distributed metadata service node, it specifically performs the following: receiving a first operation request from the master management node using the metadata node; the first operation request includes a first content of the condition file recorded by the master management node; comparing the first content with a second content of the condition file on the namespace node using the namespace node; if the first content and the second content are the same, returning the identifier of the data to be operated on in the first operation request and the version information of the condition file on the namespace node to the master management node using the namespace node; receiving a second operation request generated by the master management node based on the first content, the identifier of the data to be operated on, and the version information of the condition file on the namespace node using the metadata node; and, if the version information of the condition file on the namespace node is later than the version information of the condition file on the metadata node, updating the content of the condition file on the metadata node to the first content using the metadata node.

[0138] Furthermore, the processor 90b is also used to: after updating the content of the condition file of the metadata node to the first content, use the metadata node to operate on the data to be operated on according to the second operation request; and use the metadata node to return the operation result corresponding to the second operation request to the main control node.

[0139] Accordingly, if the version information of the condition file of the namespace node is earlier than the version information of the condition file of the metadata node, the content of the condition file of the metadata node is compared with the first content using the metadata node; if the content of the condition file of the metadata node is the same as the first content, the data to be operated on is operated on using the metadata node according to the second operation request; and the operation result corresponding to the second operation request is returned to the main control node using the metadata node.

[0140] In some embodiments, the processor 90b is further configured to: receive a first condition file deletion request sent by the master control node using the namespace node; determine a target metadata node configured with the condition file to be deleted using the namespace node in response to the first condition file deletion request; send a second condition file deletion request to the target metadata node using the namespace node; delete the condition file to be deleted using the target metadata node in response to the second condition file deletion request; return a deletion success message to the namespace node using the target metadata node; and delete the condition file to be deleted using the namespace node in response to the deletion success message.

[0141] Optionally, when the processor 90b sends a second conditional file deletion request to the target metadata node using the namespace node, it specifically performs the following: using the namespace node to respond to the first conditional file deletion request and timing the delay duration; and when the delay duration reaches the set duration, using the namespace node to send a second conditional file deletion request to the target metadata node.

[0142] Optionally, the processor 90b is also configured to: periodically query the condition files of the namespace node using the metadata node according to a set query period; if a condition file that does not exist in the namespace node is found in the metadata node, the condition file that does not exist in the namespace node is deleted from the metadata node using the metadata node.

[0143] Optionally, the processor 90b is further configured to: receive a third operation request from the master management node to operate on the directory of data using a namespace node; the third operation request carries a first content of a condition file recorded by the master management node; compare the first content with a second content of the condition file on the namespace node using the namespace node; if the first content and the second content are the same, determine that the master management node has operation permissions on the directory of data; and operate on the directory tree managed by the namespace node according to the third operation request using the namespace node.

[0144] Optionally, the processor 90b is also configured to: receive a condition file creation request sent by the master control node via the communication component 90c using the namespace node; and create a condition file on the namespace node in response to the condition file creation request using the namespace node.

[0145] In some alternative implementations, such as Figure 9 As shown, the computing device may also include optional components such as a power supply component 90d. Figure 9 The diagram only shows some components and does not mean that the computing device must contain them. Figure 9 The inclusion of all components does not imply that a computing device can only include... Figure 9 The components shown.

[0146] The computing device provided in this embodiment can be deployed in a distributed storage system. In a distributed metadata service application scenario, the distributed metadata service nodes configure condition files, and the control nodes obtain the permission to operate on the data in the distributed file system by competing for the permission to update the condition files. By utilizing the operation of the main control node with the permission to operate on the data in the distributed file system, the consistency of the condition files among the distributed metadata service nodes is achieved, which enables the main control node to operate on the data successfully and helps to improve the performance of the distributed file system.

[0147] In this embodiment, the memory is used to store computer programs and can be configured to store various other data to support operation on its host device. The processor can execute the computer programs stored in the memory to implement corresponding control logic. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0148] In the embodiments of this application, the processor can be any hardware processing device capable of executing the above-described method logic. Optionally, the processor can be a central processing unit (CPU), a graphics processing unit (GPU), or a microcontroller unit (MCU); it can also be a field-programmable gate array (FPGA), a programmable array logic (PAL), a general array logic (GAL), a complex programmable logic device (CPLD), or other programmable devices; or it can be an advanced reduced instruction set (RISC) processor (ARM) or a system on chip (SOC), etc., but is not limited thereto.

[0149] In this embodiment, the communication component is configured to facilitate wired or wireless communication between its host device and other devices. The device housing the communication component can access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In another exemplary embodiment, the communication component may also be implemented based on Near Field Communication (NFC), Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wideband (UWB), Bluetooth (BT), or other technologies.

[0150] In embodiments of this application, the display component may include a liquid crystal display (LCD) and a touch panel (TP). If the display component includes a touch panel, the display component may be implemented as a touchscreen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may not only sense the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation.

[0151] In this embodiment, a power supply component is configured to provide power to various components of the device in which it resides. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply component resides.

[0152] In embodiments of this application, the audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), which is configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals. For example, in devices with voice interaction capabilities, voice interaction with the user can be achieved through the audio component.

[0153] It should be noted that the terms "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.

[0154] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0155] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0156] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0157] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

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

[0159] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0160] Computer storage media are readable storage media, also known as removable media. Removable and non-removable media can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media do not include transient media, such as modulated data signals and carrier waves.

[0161] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0162] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A distributed storage system, comprising: Control nodes, distributed metadata service nodes, and distributed file systems; The distributed file system is used for distributed data storage; The distributed metadata service nodes run in different processes and are used to manage the metadata of the data; the distributed metadata service nodes are configured with condition files; the control node is used to compete for the permission to update the condition files to become the master control node, and as the master control node, it has the right to operate on the data; The main control node is used to control the consistency of the condition files of the distributed metadata service node by operating on the data; The distributed metadata service node includes a metadata node and a namespace node; the metadata node is used to manage the identifier of the data; the namespace node is used to manage the directory tree of the distributed file system. When the main control node uses operations on the data to control the consistency of the condition file updates of the distributed metadata service node, it is specifically used for: A first operation request is provided to the namespace node; the first operation request includes the first content of the condition file recorded by the main control node; The namespace node is used to compare the first content with the second content of the condition file on the namespace node; if the first content and the second content are the same, the identifier of the data to be operated on in the first operation request and the version information of the condition file on the namespace node are returned to the main control node. The main control node is used to generate a second operation request based on the first content, the identifier of the data to be operated, and the version information of the condition file of the namespace node; and to provide the second operation request to the metadata node. The metadata node is used to update the content of the condition file of the metadata node to the first content when the version information of the condition file of the namespace node is later than the version information of the condition file of the metadata node.

2. In the system according to claim 1, when the control node becomes the primary control node by contending for the permission to update the condition file, it is specifically used for: An update request is provided to the namespace node; the update request provided by each control node includes the updated content of the condition file and the original content of the condition file recorded by the control node. The namespace node is used to compare the original content of the condition file recorded by the control node with the content of the condition file on the namespace node; for a target update request whose original content is the same as the content of the condition file on the namespace node, the content of the condition file on the namespace node is updated to the update content carried by the target update request to obtain the target condition file. Return an update success message to the control node that provided the target update request; The control node is used to determine the control node that receives the update success message as the master control node.

3. A metadata management method, applicable to the primary control node, comprising: By competing with other control nodes for the permission to update the condition file configured by the distributed metadata service node, the user gains the permission to operate on data in the distributed file system. By manipulating the data, the condition file updates of the distributed metadata service nodes are kept consistent. The step of updating the condition file of the distributed metadata service node to be consistent by operating on the data includes: A first operation request is provided to the namespace node in the distributed metadata service node; the first operation request includes the first content of the condition file recorded by the main control node, so that if the first content is the same as the second content of the condition file on the namespace node, the namespace node returns the identifier of the data to be operated on by the first operation request and the version information of the condition file on the namespace node. Based on the first content, the identifier of the data to be operated on, and the version information of the condition file of the namespace node, a second operation request is generated; The second operation request is provided to the metadata node in the distributed metadata service node so that the metadata node updates the content of the condition file of the metadata node to the first content if the version information of the condition file of the namespace node is later than the version information of the condition file of the metadata node.

4. A metadata management method, adapted to distributed metadata service nodes, comprising: Obtain operation requests for data in the distributed file system provided by the master control node; In response to the operation request, the condition file of the distributed metadata service node is updated to be consistent; The step of updating the condition file of the distributed metadata service node in response to the operation request includes: The metadata node in the distributed metadata service node receives a first operation request from the main control node; the first operation request includes the first content of the condition file recorded by the main control node. The first content is compared with the second content of the condition file on the namespace node using the namespace node in the distributed metadata service node; If the first content and the second content are the same, the identifier of the data to be operated on in the first operation request and the version information of the condition file on the namespace node are returned to the main control node using the namespace node; The metadata node receives a second operation request generated by the main control node based on the first content, the identifier of the data to be operated, and the version information of the condition file of the namespace node; If the version information of the condition file of the namespace node is later than the version information of the condition file of the metadata node, the content of the condition file of the metadata node is updated to the first content using the metadata node.

5. The method according to claim 4, further comprising: The namespace node is used to receive a first conditional file deletion request sent by the main control node; Using the namespace node in response to the first conditional file deletion request, determine the target metadata node configured with the conditional file to be deleted; The namespace node is used to send a second conditional file deletion request to the target metadata node; The target metadata node responds to the second conditional file deletion request and deletes the conditional file to be deleted. The target metadata node returns a deletion success message to the namespace node; The namespace node responds to the deletion success message to delete the condition file to be deleted.

6. The method according to claim 5, wherein sending a second conditional file deletion request to the target metadata node using the namespace node includes: The namespace node is used to respond to the first conditional file deletion request and the delay duration is timed. If the delay time reaches the set time, the namespace node sends a second conditional file deletion request to the target metadata node.

7. The method according to claim 4, further comprising: The metadata node is used to periodically query the condition file of the namespace node according to the set query period; If a conditional file is found in the metadata node that does not exist in the namespace node, the conditional file that does not exist in the namespace node is deleted from the metadata node using the metadata node.

8. A computing device comprising: Memory, processor, and communication components; wherein the memory is used to store computer programs; The processor is coupled to the memory and the communication component for executing the computer program to perform the steps of the method according to any one of claims 3-7.

9. A computer-readable storage medium storing computer instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the method according to any one of claims 3-7.