Data management method and apparatus for distributed storage system, and device and medium

By determining the server where the data of the target task is located in the task tracking management module of the distributed storage system and selecting the corresponding client, the problem of network delay in the blocking network topology is solved, and network performance is improved without increasing costs, making it close to non-blocking networks.

WO2025097729A1PCT designated stage expired Publication Date: 2025-05-15INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/095331
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-09
Filing Date
2024-05-24
Publication Date
2025-05-15

AI Technical Summary

Technical Problem

In large distributed storage systems, the network bandwidth of the blocking fat-tree network topology is blocked, resulting in inconsistent network latency and low cost, but it is difficult to fully utilize the performance of high-speed media.

Method used

In the task tracking and management module of the distributed storage system, the target server where the data corresponding to the target task is located is determined, and the candidate client of the leaf switch connected to the same as the target server is selected, so as to use the target client to perform the target task, shorten the network path and reduce communication between switches.

Benefits of technology

Without increasing network deployment costs, the performance of blocking networks is improved, making its performance close to non-blocking networks, shortening network paths and reducing communication between switches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024095331_15052025_PF_FP_ABST
    Figure CN2024095331_15052025_PF_FP_ABST
Patent Text Reader

Abstract

A data management method and apparatus for a distributed storage system, and a device and a medium, which relate to the technical field of computers. The method is applied to a task tracking management module in a distributed storage system, which comprises a cascaded switch, a plurality of leaf switches, a plurality of clients, a plurality of servers, a metadata server and the task tracking management module, wherein all the leaf switches are connected to the cascaded switch, each leaf switch is connected to the plurality of clients and the plurality of servers, the metadata server is connected to one of the leaf switches, and the task tracking management module is connected to one of the leaf switches. The method comprises: upon receiving a target task, determining a target server where data corresponding to the target task is located (S101); and determining candidate clients which are connected to the same leaf switch as the target server, and selecting, from among the candidate clients, a target client for executing the target task, so as to use the target client to execute the target task (S102). Therefore, the performance of a blocking network is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Data management method, device, equipment and medium for distributed storage system

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on November 9, 2023, with application number 202311483322.1, and entitled “A data management method, device, equipment and medium for a distributed storage system”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present application relates to the field of computer technology, and more specifically, to a data management method, apparatus, device, and medium for a distributed storage system. Background Art

[0004] In large-scale distributed storage, there are many different network topologies, such as non-blocking fat-tree and blocking fat-tree. While the network bandwidth between any two nodes in a non-blocking fat-tree is unblocked, the latency between any two nodes varies. Its main disadvantage is high cost. The network bandwidth between any two nodes in a blocking fat-tree is blocked, and the latency between any two nodes varies. Its advantage is low cost.

[0005] To fully utilize the performance of high-speed media, network latency needs to be optimized. Considering cost factors, the main goal of optimization is to shorten network paths and reduce communication between switches in the case of congested networks.

[0006] Summary of the Invention

[0007] The purpose of this application is to provide a data management method, device, equipment and medium for a distributed storage system, thereby improving the performance of a congested network.

[0008] To achieve the above objectives, the present application provides a data management method for a distributed storage system, which is applied to a task tracking management module in the distributed storage system. The distributed storage system includes a cascade switch, multiple leaf switches, multiple clients, multiple servers, a metadata server, and a task tracking management module. All leaf switches are connected to the cascade switch, each leaf switch is connected to multiple clients and multiple servers, the metadata server is connected to one of the leaf switches, and the task tracking management module is connected to one of the leaf switches.

[0009] Methods include:

[0010] When a target task is received, the target server where the data corresponding to the target task is located is determined;

[0011] Determine candidate clients of the leaf switch connected to the same target server, and select a target client for executing the target task from the candidate clients so that the target task is executed using the target client.

[0012] Determining the target server where the data corresponding to the target task is located includes:

[0013] Query the metadata server or local cache to determine the target server where the data corresponding to the target task is located.

[0014] The candidate clients connected to the same leaf switch as the target server are determined, including:

[0015] The target server or local cache is queried to determine candidate clients connected to the same leaf switch as the target server.

[0016] The target client to be used for executing the target task is selected from the candidate clients, including:

[0017] The candidate client with the lightest load is selected as the target client to execute the target task.

[0018] The metadata server and the task tracking management module are connected to the same leaf switch.

[0019] Determining the target server where the data corresponding to the target task is located includes:

[0020] Obtain the distribution of the data corresponding to the target task, divide the target task into multiple subtasks based on the distribution, and determine the target server where the data corresponding to each subtask is located;

[0021] Accordingly, candidate clients connected to the same leaf switch as the target server are determined, and a target client for executing the target task is selected from the candidate clients so as to execute the target task using the target client, including:

[0022] Determine candidate clients of the leaf switch connected to the same target server, and select a target client for executing the subtask from the candidate clients so that the subtask is executed using the target client.

[0023] Among them, obtaining the distribution of data corresponding to the target task includes:

[0024] Obtain the distribution of data corresponding to the target task by querying the metadata server or local cache.

[0025] If the distributed storage system is a distributed file storage system, the method further includes:

[0026] When a task to create a first target directory is received, a first target client that executes the creation task is determined, so that the first target client queries the first target server and the first leaf switch where the parent directory of the first target directory is located through the metadata server, selects a second target server from the servers connected to other leaf switches except the first leaf switch, and creates the first target directory in the second target server.

[0027] The step of selecting a second target server from servers connected to leaf switches other than the first leaf switch includes:

[0028] Determining a first server number of servers connected to leaf switches other than the first leaf switch;

[0029] A hash value of the directory name of the first target directory is modulo the number of first servers, and a second target server is selected based on the modulo result.

[0030] If the distributed storage system is a distributed file storage system, then when a target task is received, determining a target server where data corresponding to the target task is located includes:

[0031] When receiving a read task for the second target directory, determining a third target server where the second target directory is located;

[0032] Accordingly, candidate clients connected to the same leaf switch as the target server are determined, and a target client for executing the target task is selected from the candidate clients so as to execute the target task using the target client, including:

[0033] Determine candidate clients of the leaf switch connected to the same leaf switch as the third target server, and select a second target client that performs a read task from the candidate clients so that the second target client reads the second target directory.

[0034] If the distributed storage system is a distributed file storage system, then when a target task is received, determining a target server where data corresponding to the target task is located includes:

[0035] When receiving a write task for a first target file, determining a fourth target server where a parent directory of the first target file is located;

[0036] Accordingly, candidate clients connected to the same leaf switch as the target server are determined, and a target client for executing the target task is selected from the candidate clients so as to execute the target task using the target client, including:

[0037] Determine candidate clients of the leaf switch connected to the same target server as the fourth target server, and select a third target client that performs a write task from the candidate clients so that the third target client writes the first target file to a server of the leaf switch connected to the same target server as the fourth target server.

[0038] Before the third target client writes the first target file to a server connected to the same leaf switch as the fourth target server, the method further includes:

[0039] The third target client selects a fifth target server from the servers of the leaf switch connected to the same leaf switch as the fourth target server, and writes the metadata of the first target file to the fifth target server.

[0040] The third target client selects a fifth target server from servers on the same leaf switch connected to the fourth target server, including:

[0041] The third target client determines the second server number of servers connected to the same leaf switch as the fourth target server, modulo the hash value of the file name of the first target file by the second server number, and selects the fifth target server based on the modulo result.

[0042] The third target client writes the first target file to a server of the same leaf switch as the fourth target server, including:

[0043] The third target client writes the first block of the first target file to the fifth target server, and writes the remaining blocks of the first target file to the server connected to the same leaf switch as the fourth target server in a round-robin manner.

[0044] If the distributed storage system is a distributed file storage system, then when a target task is received, determining a target server where data corresponding to the target task is located includes:

[0045] When receiving a read task for the second target file, determining a sixth target server where the parent directory of the second target file is located;

[0046] Accordingly, candidate clients connected to the same leaf switch as the target server are determined, and a target client for executing the target task is selected from the candidate clients so as to execute the target task using the target client, including:

[0047] Determine candidate clients of the leaf switch connected to the same target server as the sixth target server, and select a fourth target client that performs a read task from the candidate clients so that the fourth target client reads the second target file.

[0048] The fourth target client reads the second target file, including:

[0049] The fourth target client determines the seventh target server that stores the metadata of the second target file among the servers of the leaf switch connected to the same leaf switch as the sixth target server, and reads the second target file from the servers of the leaf switch connected to the same leaf switch as the sixth target server in a round-robin sequential reading manner starting from the seventh target server.

[0050] The fourth target client determines, from among servers of the same leaf switch connected to the sixth target server, a seventh target server storing metadata of the second target file, including:

[0051] The fourth target client determines the number of third servers among the servers connected to the same leaf switch as the sixth target server, modulo the hash value of the file name of the second target file by the number of the third servers, and selects the seventh target server based on the modulo result.

[0052] If the distributed storage system is a distributed block storage system, then when a target task is received, determining the target server where the data corresponding to the target task is located includes:

[0053] When a read / write task of target data is received, the starting and ending locations corresponding to the read / write task are determined, and the target servers where the starting and ending locations are located are determined;

[0054] Accordingly, candidate clients connected to the same leaf switch as the target server are determined, and a target client for executing the target task is selected from the candidate clients so as to execute the target task using the target client, including:

[0055] If the target server where the starting and ending locations are located is the same, candidate clients connected to the same leaf switch as the target server are determined, and a target client for performing the read / write task is selected from the candidate clients so that the read / write task can be performed using the target client.

[0056] If the target servers of the starting and ending locations are different, the read and write tasks are divided into multiple subtasks, and the target client for executing each subtask is selected from the candidate clients connected to the same leaf switch as the target server corresponding to each subtask, so that each subtask is executed using the target client corresponding to each subtask.

[0057] Determining the target servers where the starting location and the ending location are located includes:

[0058] The fourth server number of all servers included in the distributed block storage system is obtained, the start position and the end position are modulo the fourth server number, and the target servers where the start position and the end position are located are determined according to the modulo results.

[0059] Determining the target servers where the starting location and the ending location are located includes:

[0060] Obtain the fourth server number of all servers included in the distributed block storage system, modulo the hash values ​​of the block object names to which the start position and the end position belong respectively according to the fourth server number, and determine the target servers where the start position and the end position are located respectively according to the modulo results.

[0061] To achieve the above objectives, the present application provides a data management device for a distributed storage system, which is applied to a task tracking management module in the distributed storage system. The distributed storage system includes a cascade switch, multiple leaf switches, multiple clients, multiple servers, a metadata server, and a task tracking management module. All leaf switches are connected to the cascade switch, each leaf switch is connected to multiple clients and multiple servers, the metadata server is connected to one of the leaf switches, and the task tracking management module is connected to one of the leaf switches.

[0062] The device includes:

[0063] a determination unit, configured to, upon receiving a target task, determine a target server where data corresponding to the target task is located;

[0064] The selection unit is configured to determine candidate clients of the leaf switch connected to the same leaf switch as the target server, and select a target client for executing the target task from the candidate clients, so as to execute the target task using the target client.

[0065] To achieve the above objectives, the present application provides an electronic device, comprising:

[0066] Memory for storing computer programs;

[0067] The processor is used to implement the steps of the data management method of the distributed storage system when executing the computer program.

[0068] To achieve the above objectives, the present application provides a computer non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data management method of the distributed storage system as described above are implemented.

[0069] From the above scheme, it can be seen that a data management method for a distributed storage system provided by the present application is applied to a task tracking management module in a distributed storage system. The distributed storage system includes a cascade switch, multiple leaf switches, multiple clients, multiple servers, a metadata server and a task tracking management module. All leaf switches are connected to the cascade switch, each leaf switch is connected to multiple clients and multiple servers respectively, the metadata server is connected to one of the leaf switches, and the task tracking management module is connected to one of the leaf switches; the method includes: when a target task is received, determining the target server where the data corresponding to the target task is located; determining the candidate clients connected to the same leaf switch as the target server, and selecting the target client that executes the target task from the candidate clients, so as to use the target client to execute the target task.

[0070] This application is applied to blocking networks. Compared with non-blocking networks, it reduces the cascading of switches and reduces network deployment costs. In the data management method for a distributed storage system provided by this application, server tasks are completed by clients connected to the same leaf switch, shortening the network path and reducing communication between switches. While not increasing the network deployment cost, it improves the performance of the blocking network and makes the performance of the blocking network comparable to that of the non-blocking network. This application also discloses a data management device for a distributed storage system, an electronic device, and a computer non-volatile readable storage medium, which can also achieve the above-mentioned technical effects.

[0071] It should be understood that the foregoing general description and the following detailed description are merely illustrative and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings are used to provide a further understanding of the present disclosure and constitute part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure, but do not constitute a limitation of the present disclosure. In the drawings:

[0073] FIG1 is a structural diagram of a distributed storage system according to an exemplary embodiment;

[0074] FIG2 is a flow chart showing a data management method of a distributed storage system according to an exemplary embodiment;

[0075] FIG3 is a structural diagram of a data management device of a distributed storage system according to an exemplary embodiment;

[0076] Fig. 4 is a structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0077] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0078] First, the distributed storage system used in this application is introduced. As shown in Figure 1, the distributed storage system includes a cascade switch, multiple leaf switches, multiple clients (C1-C16), multiple servers (S1-S12), a metadata server and a task tracking management module (JT, job tracker). All leaf switches are connected to the cascade switch, each leaf switch is connected to multiple clients and multiple servers, the metadata server is connected to one of the leaf switches, and the task tracking management module is connected to one of the leaf switches.

[0079] In a distributed storage system, there are generally three roles: client, server, and metadata server. The server can be understood as an IO (Input / Output) server. In this application, each IO server is added with a function to track and record the shortest network path length to each client, and this information is recorded. A new interface is added to each IO server for external nodes to query the information recorded in the IO server through the interface. A new interface is added to the metadata server for querying the IO server where the data is located. These two new interfaces enable external nodes to query the above two pieces of information, but do not provide interfaces for modification and deletion.

[0080] The task tracking management module is responsible for receiving tasks, splitting them into subtasks, assigning them to different physical nodes, and tracking their completion status. One of JT's most important responsibilities is job scheduling. By querying these two pieces of information, its debugging process will be more rational, ensuring that work is completed more efficiently.

[0081] The embodiment of the present application discloses a data management method for a distributed storage system, which improves the performance of a congested network.

[0082] 2 is a flowchart of a data management method for a distributed storage system according to an exemplary embodiment. As shown in FIG2 , the method includes:

[0083] S101: When a target task is received, determining a target server where data corresponding to the target task is located;

[0084] The execution subject of this embodiment is the task tracking management module in the above distributed storage system. In a specific implementation, the task tracking management module receives a target task and queries a metadata server or a local cache to determine the target server where the data corresponding to the target task is located.

[0085] S102: Determine candidate clients of the leaf switch connected to the same target server, and select a target client for executing the target task from the candidate clients, so as to execute the target task using the target client.

[0086] In a specific implementation, the task tracking management module finds the nearest set of candidate clients, that is, queries the target server or local cache to determine the candidate clients that are connected to the same leaf switch as the target server, and selects the target client that performs the target task from all candidate clients. In some embodiments, the candidate client with the lightest load can be selected as the target client that performs the target task.

[0087] In some embodiments, the metadata server and the task tracking management module are connected to the same leaf switch. In a specific implementation, the metadata server and the task tracking management module can be connected to the same leaf switch to further shorten the network path.

[0088] In some embodiments, determining the target server where the data corresponding to the target task is located includes: obtaining the distribution of the data corresponding to the target task, dividing the target task into multiple subtasks according to the distribution, and determining the target server where the data corresponding to each subtask is located; accordingly, determining the candidate clients of the leaf switch connected to the same as the target server, and selecting the target client that executes the target task from the candidate clients so as to utilize the target client to execute the target task, including: determining the candidate clients of the leaf switch connected to the same as the target server, and selecting the target client that executes the subtask from the candidate clients so as to utilize the target client to execute the subtask.

[0089] In specific implementations, the task tracking management module obtains the distribution of data corresponding to the target task by querying the metadata server or local cache. Based on the distribution of data, the target task is divided into multiple subtasks. The metadata server stored by the task tracking management module or obtained from the local cache finds the IO server where the corresponding data of the subtask is located. The task tracking management module queries the stored IO server or obtains it from the local cache to find the nearest client set and selects a specific client in a load balancing manner to execute the corresponding subtask. In the above process, the task tracking management module will have multiple network interactions with the metadata server and IO server, but in fact the number of interactions is very small, because after obtaining the relevant information once, JT will cache it locally and there is no need to query it repeatedly.

[0090] The embodiments of the present application are applied to blocking networks, reducing the number of switches connected and network deployment costs compared to non-blocking networks. The data management method for a distributed storage system provided by the embodiments of the present application allows server tasks to be completed by clients connected to the same leaf switch, shortening network paths and reducing communication between switches. This improves the performance of blocking networks without increasing network deployment costs, making the performance of blocking networks comparable to that of non-blocking networks.

[0091] This embodiment introduces a data management method in a distributed file storage system. In the distributed file storage system, a directory and all the files under it are evenly distributed on all IO servers on the same switch, and the subdirectories under the directory are evenly distributed on the remaining switches. Files are concentrated on one switch as much as possible to improve performance; directories are distributed on different switches to improve scalability and load balancing. Most of the IO of an IO server is completed by clients on the same switch, and it is avoided as much as possible to be completed by clients on other switches, thereby reducing network overhead. For example, in Figure 1, the IO operations on "S1" and "S2" are mainly completed by the three clients "C1", "C2", and "C3".

[0092] The process of creating a directory in a distributed file storage system is as follows: when a task to create a first target directory is received, a first target client that executes the creation task is determined, so that the first target client queries the first target server and the first leaf switch where the parent directory of the first target directory is located through the metadata server, selects a second target server from the servers connected to other leaf switches except the first leaf switch, and creates the first target directory in the second target server.

[0093] For example, when creating the sub_dir1 directory, JT randomly selects a client from all clients to perform this operation, prioritizing clients with light loads. The selected client queries the metadata server for the I / O server and switch where its parent directory resides. For example, the parent directory of sub_dir1 resides on I / O server "S1" and switch "Leaf Switch 1."

[0094] In some embodiments, selecting a second target server from servers connected to other leaf switches except the first leaf switch includes: determining the first server number of servers connected to other leaf switches except the first leaf switch; modulo the hash value of the directory name of the first target directory according to the first server number, and selecting the second target server based on the modulo result.

[0095] In practice, the IO servers where the subdirectory and parent directory reside cannot be on the same switch. The selected client calculates the hash value of the subdirectory name and modulo it to determine which IO server to write to. SHA-2 (secure hash algorithm 2) is used to calculate the hash value of sub_dir1, which is then modulo 8 to determine which server among "S3" to "S10" to place it on, ultimately placing it on "S5." The selected client then performs the directory creation operation. Subdirectory sub_dir1 is created on "S5." Because this operation consumes little bandwidth, it can be performed across switches. Directory write operations should be dispersed as much as possible so that all clients can run them.

[0096] The process of reading directories in a distributed file storage system is as follows: when a reading task for a second target directory is received, the third target server where the second target directory is located is determined; candidate clients connected to the same leaf switch as the third target server are determined, and the second target client that performs the reading task is selected from the candidate clients so that the second target client can read the second target directory.

[0097] In practice, JT queries the metadata server to find the I / O server where the subdirectory resides. For example, sub_dir1 is located on "S5." JT then queries the I / O server to find that the clients on the same switch as "S5" are "C7" through "C9." Based on the load of "C7" through "C9," JT assigns the task to a client with a lighter load. The selected client then performs the directory read operation. Directory reads often require opening the corresponding directory or file for the corresponding I / O operation, so the selected client must be close to the directory.

[0098] The process of writing files in a distributed file storage system is as follows: when a write task for a first target file is received, a fourth target server where the parent directory of the first target file is located is determined; candidate clients connected to the same leaf switch as the fourth target server are determined, and a third target client that performs the write task is selected from the candidate clients so that the third target client writes the first target file to a server connected to the same leaf switch as the fourth target server.

[0099] For example, when writing file1, JT queries the metadata server for the I / O server and switch where its parent directory resides. For example, the I / O server where file1's parent directory resides is S1, and the switch is Leaf Switch 1. JT queries the I / O server and finds that the clients on the same switch as S1 are C1-C3. JT selects a client from the optimal set of clients. It randomly selects a client between C1-C3 as the initiator of the write operation.

[0100] In some embodiments, before the third target client writes the first target file to a server connected to the same leaf switch as the fourth target server, the process further includes: the third target client selecting a fifth target server from among the servers connected to the same leaf switch as the fourth target server, and writing metadata for the first target file to the fifth target server. In a specific implementation, the selected client calculates a hash value of the file name and modulo the hash value to determine the IO server to which the metadata is written.

[0101] In some embodiments, the third target client selects a fifth target server from servers connected to the same leaf switch as the fourth target server, including: the third target client determines the second server number of servers connected to the same leaf switch as the fourth target server, modulo the hash value of the file name of the first target file by the second server number, and selects the fifth target server based on the modulo result. In a specific implementation, because it must be on the same switch as "S1", it can only be placed on "S1" or "S2". SHA-2 is used to calculate the hash value of file1, and then the hash value is modulo 2 to determine which IO server between "S1" and "S2" to place it on, and after calculation, it is placed on "S1".

[0102] In some embodiments, the third target client writes the first target file to the server of the same leaf switch connected to the fourth target server, including: the third target client writes the first block of the first target file to the fifth target server, and writes the remaining blocks of the first target file to the server of the same leaf switch connected to the fourth target server in a rotating sequential manner. In a specific implementation, the selected client writes the data in the file to all IO servers on the same switch in a balanced manner. The data blocks are written to the corresponding IO servers according to the sequence number. The first block and the metadata of the file are placed on the same IO server, and the subsequent blocks will be written sequentially in a rotating manner. The first block of file1 will be written to "S1", and then written in the order of "S2", "S1", "S2". The written data must be scattered to all IO servers on a switch to ensure high concurrency and high performance. This operation involves a large number of IO operations, and the distance between the selected client and the data must be close.

[0103] The process of reading files in a distributed file storage system is as follows: when a reading task for a second target file is received, the sixth target server where the parent directory of the second target file is located is determined; candidate clients connected to the same leaf switch as the sixth target server are determined, and a fourth target client that performs the reading task is selected from the candidate clients so that the fourth target client can read the second target file.

[0104] For example, when reading file1, JT queries the metadata server for the I / O server and switch where its parent directory resides. For example, the I / O server where file1's parent directory resides is S1, and the switch is Leaf Switch 1. JT queries the I / O server and finds that the clients on the same switch as S1 are C1-C3. JT selects a client from the optimal set of clients. It randomly selects a client between C1-C3 as the initiator of the read operation.

[0105] In some embodiments, the fourth target client reads the second target file, including: the fourth target client determines, from among the servers of the same leaf switch connected to the sixth target server, a seventh target server storing metadata for the second target file; and, starting with the seventh target server, sequentially reads the second target file from among the servers of the same leaf switch connected to the sixth target server in a round-robin manner. In some embodiments, the fourth target client determines, from among the servers of the same leaf switch connected to the sixth target server, a seventh target server storing metadata for the second target file; and includes: the fourth target client determines the number of a third server of the servers of the same leaf switch connected to the sixth target server; modulo a hash value of the file name of the second target file by the number of the third servers; and selecting the seventh target server based on the modulo result.

[0106] In practice, the selected client calculates the hash value of the file name and modulo it to determine which I / O server the metadata is located on. Because its parent directory is on S1, the file's metadata will be on either S1 or S2. The SHA-2 hash value of file1 is calculated, and then the hash value is modulo 2, indicating that the metadata is on S1. The selected client then calculates which I / O server the block to be read is located on. Because the first block is located with the metadata, and subsequent blocks are placed in a rotating manner, odd-numbered blocks are on S1, and even-numbered blocks are on S2. Knowing the data's location, the selected client can perform the corresponding read operation.

[0107] This embodiment introduces a data management method for a distributed block storage system. In this distributed block storage system, all data is broken up into large granularity, such as 128MB units, to evenly distribute the load / capacity across the various IO servers while maintaining sequential IO performance. Most IO operations for an IO server are completed by clients on the same switch, minimizing the need for clients on other switches to complete the operations, thereby reducing network overhead. For example, in Figure 1, IO operations on "S1" and "S2" are primarily completed by clients "C1," "C2," and "C3."

[0108] The process of reading and writing data in a distributed block storage system is as follows: when a read or write task for target data is received, the starting position and ending position corresponding to the read or write task are determined, and the target servers where the starting position and ending position are located are determined respectively; if the target servers where the starting position and ending position are located are the same, the candidate clients of the leaf switch connected to the same target server are determined, and the target client that executes the read or write task is selected from the candidate clients so that the read or write task is executed using the target client; if the target servers where the starting position and ending position are located are different, the read or write task is divided into multiple subtasks, and the target client that executes each subtask is selected from the candidate clients of the leaf switch connected to the same target server corresponding to each subtask so that each subtask is executed using the target client corresponding to each subtask.

[0109] In some embodiments, determining the target servers where the starting position and the ending position are respectively located includes: obtaining a fourth server number of all servers included in the distributed block storage system, taking a modulus of the starting position and the ending position according to the fourth server number, and determining the target servers where the starting position and the ending position are respectively located based on the modulo result.

[0110] In a specific implementation, a static modulo method can be used to modulo the start position and the end position according to the fourth server number of all servers included in the distributed block storage system, and the target servers where the start position and the end position are located are determined according to the modulo results.

[0111] For example, a 100MB data read / write request starts at 500MB. JT queries the I / O server to read / write the data by dividing the starting and ending points by the data granule size and then taking the value modulo the number of I / O servers plus 1. Since the starting point is 500MB, 500 / 128 mod 12+1 = 4, and 600 / 128 mod 12+1 = 5, the request must be split into two requests to read / write "S4" and "S5," respectively. JT queries the I / O server to obtain its optimal client and selects a client from among them, if splitting the user request is necessary. Since "S4" and "S5" belong to different leaf switches, the user request must be split into 500MB-512MB and 512MB-600MB, respectively, and a client must be found on leaf switches 2 and 3, respectively. The client is selected based on the lightest load. The selected client accepts the request and reads / writes the data.

[0112] In some embodiments, determining the target servers where the starting position and the ending position are respectively located includes: obtaining a fourth server number of all servers included in the distributed block storage system, taking a modulus of the hash values ​​of the block object names to which the starting position and the ending position respectively belong according to the fourth server number, and determining the target servers where the starting position and the ending position respectively are located based on the modulo results.

[0113] In a specific implementation, the CH (consistent hashing) method can be adopted to calculate the hash values ​​of the block object names to which the starting position and the ending position belong respectively using the consistent hashing algorithm, and the hash values ​​of the block object names to which the starting position and the ending position belong respectively are modulo the fourth server number of all servers included in the distributed block storage system, and determine the target servers where the starting position and the ending position are respectively located according to the modulo result.

[0114] The following introduces a data management device for a distributed storage system provided in an embodiment of the present application. The data management device for a distributed storage system described below and the data management method for a distributed storage system described above can be referenced to each other.

[0115] 3 , which is a structural diagram of a data management device for a distributed storage system according to an exemplary embodiment, includes:

[0116] The determining unit 301 is configured to determine the target server where the data corresponding to the target task is located when receiving the target task;

[0117] The selection unit 302 is configured to determine candidate clients connected to the same leaf switch as the target server, and select a target client for executing the target task from the candidate clients, so as to execute the target task using the target client.

[0118] The embodiments of the present application are applied to blocking networks, reducing the number of switches connected and network deployment costs compared to non-blocking networks. In the data management device for a distributed storage system provided by the embodiments of the present application, server tasks are completed by clients connected to the same leaf switch, shortening network paths and reducing communication between switches. This improves the performance of blocking networks without increasing network deployment costs, making the performance of blocking networks comparable to that of non-blocking networks.

[0119] In some embodiments, the determining unit 301 is specifically configured to: when receiving a target task, query a metadata server or a local cache to determine a target server where data corresponding to the target task is located.

[0120] In some embodiments, the selection unit 302 is specifically configured to query the target server or the local cache to determine a candidate client connected to the same leaf switch as the target server.

[0121] In some embodiments, the selection unit 302 is specifically configured to select a candidate client with the lightest load as a target client for executing the target task.

[0122] In some embodiments, the metadata server and the task tracking management module are connected to the same leaf switch.

[0123] In some embodiments, the determining unit 301 is specifically configured to: upon receiving a target task, obtain the distribution of data corresponding to the target task, divide the target task into multiple subtasks according to the distribution, and determine the target server where the data corresponding to each subtask is located;

[0124] Accordingly, the selection unit 302 is specifically configured to determine candidate clients of the leaf switch connected to the same target server, and select a target client for executing the subtask from the candidate clients, so as to execute the subtask using the target client.

[0125] In some embodiments, the determining unit 301 is specifically configured to: when receiving a target task, obtain the distribution of data corresponding to the target task by querying a metadata server or a local cache.

[0126] In some embodiments, if the distributed storage system is a distributed file storage system, the apparatus further includes:

[0127] A creation unit is used to determine a first target client that executes the creation task when receiving a creation task for a first target directory, so that the first target client queries the first target server and the first leaf switch where the parent directory of the first target directory is located through the metadata server, selects a second target server from the servers connected to other leaf switches except the first leaf switch, and creates the first target directory in the second target server.

[0128] In some embodiments, the creation unit is specifically used to: determine the first server number of servers connected to other leaf switches except the first leaf switch; modulo the hash value of the directory name of the first target directory according to the first server number, and select the second target server based on the modulo result.

[0129] In some embodiments, if the distributed storage system is a distributed file storage system, the determining unit 301 is specifically configured to: upon receiving a read task for the second target directory, determine a third target server where the second target directory is located;

[0130] Accordingly, the selection unit 302 is specifically configured to determine candidate clients connected to the same leaf switch as the third target server, and select a second target client that performs the read task from the candidate clients, so that the second target client reads the second target directory.

[0131] In some embodiments, if the distributed storage system is a distributed file storage system, the determining unit 301 is specifically configured to: upon receiving a write task for a first target file, determine a fourth target server where a parent directory of the first target file is located;

[0132] Correspondingly, the selection unit 302 is specifically used to: determine the candidate clients of the leaf switch connected to the same leaf switch as the fourth target server, and select the third target client that performs the write task among the candidate clients, so that the third target client writes the first target file to the server of the leaf switch connected to the same leaf switch as the fourth target server.

[0133] In some embodiments, the third target client selects a fifth target server from servers on the same leaf switch as the fourth target server, and writes metadata of the first target file to the fifth target server.

[0134] In some embodiments, the third target client determines the second server number of the servers connected to the same leaf switch as the fourth target server, modulo the hash value of the file name of the first target file according to the second server number, and selects the fifth target server based on the modulo result.

[0135] In some embodiments, the third target client writes the first block of the first target file to the fifth target server, and writes the remaining blocks of the first target file to the server connected to the same leaf switch as the fourth target server in a round-robin manner.

[0136] In some embodiments, if the distributed storage system is a distributed file storage system, the determining unit 301 is specifically configured to: upon receiving a read task for a second target file, determine a sixth target server where a parent directory of the second target file is located;

[0137] Accordingly, the selection unit 302 is specifically configured to determine candidate clients connected to the same leaf switch as the sixth target server, and select a fourth target client that performs a read task from the candidate clients, so that the fourth target client reads the second target file.

[0138] In some embodiments, the fourth target client determines a seventh target server that stores metadata of the second target file among the servers of the leaf switch connected to the same leaf switch as the sixth target server, and reads the second target file from the servers of the leaf switch connected to the same leaf switch as the sixth target server in a round-robin sequential reading manner starting from the seventh target server.

[0139] In some embodiments, the fourth target client determines the number of the third server among the servers connected to the same leaf switch as the sixth target server, modulo the hash value of the file name of the second target file according to the number of the third server, and selects the seventh target server based on the modulo result.

[0140] In some embodiments, if the distributed storage system is a distributed block storage system, the determining unit 301 is specifically configured to: upon receiving a read or write task for target data, determine a start position and an end position corresponding to the read or write task, and determine the target servers where the start position and the end position are located respectively;

[0141] Correspondingly, the selection unit 302 is specifically used to: if the target servers where the starting position and the ending position are located are the same, determine the candidate clients of the leaf switch connected to the same target server, and select the target client that performs the read and write tasks from the candidate clients so that the read and write tasks can be performed using the target client; if the target servers where the starting position and the ending position are located are different, divide the read and write tasks into multiple subtasks, and select the target client that performs each subtask from the candidate clients of the leaf switch connected to the same target server corresponding to each subtask so that each subtask can be performed using the target client corresponding to each subtask.

[0142] In some embodiments, the selection unit 302 is specifically configured to:

[0143] The fourth server number of all servers included in the distributed block storage system is obtained, the start position and the end position are modulo the fourth server number, and the target servers where the start position and the end position are located are determined according to the modulo results.

[0144] In some embodiments, the selection unit 302 is specifically used to: obtain the fourth server number of all servers included in the distributed block storage system, modulo the hash values ​​of the block object names to which the starting position and the ending position respectively belong according to the fourth server number, and determine the target servers where the starting position and the ending position are respectively located based on the modulo results.

[0145] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0146] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present application, the embodiment of the present application further provides an electronic device. FIG4 is a structural diagram of an electronic device according to an exemplary embodiment. As shown in FIG4 , the electronic device includes:

[0147] Communication interface 1, capable of exchanging information with other devices such as network devices;

[0148] The processor 2 is connected to the communication interface 1 to implement information exchange with other devices and is used to execute the data management method of the distributed storage system provided by one or more of the above technical solutions when running a computer program. The computer program is stored in the memory 3.

[0149] Of course, in actual applications, the various components in the electronic device are coupled together via bus system 4. It will be appreciated that bus system 4 is used to enable communication between these components. In addition to a data bus, bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in FIG4 , all of these buses are labeled as bus system 4.

[0150] The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.

[0151] It is understood that the memory 3 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a magnetic disk memory or a magnetic tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memory 3 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.

[0152] The method disclosed in the above-mentioned embodiment of the present application can be applied to processor 2 or implemented by processor 2. Processor 2 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above-mentioned method can be completed by the integrated logic circuit of the hardware in processor 2 or instructions in the form of software. The above-mentioned processor 2 can be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 2 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in memory 3. Processor 2 reads the program in memory 3 and completes the steps of the above-mentioned method in combination with its hardware.

[0153] When the processor 2 executes the program, the corresponding processes in each method of the embodiment of the present application are implemented. For the sake of brevity, they are not repeated here.

[0154] In an exemplary embodiment, the present application also provides a storage medium, namely, a computer storage medium, specifically a non-volatile computer-readable storage medium, such as a memory 3 storing a computer program. The computer program can be executed by a processor 2 to perform the aforementioned method steps. The non-volatile computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, CD-ROM, or the like.

[0155] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, ROM, RAM, disks or optical disks, etc. Various media that can store program codes.

[0156] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for an electronic device (which can be a personal computer, server, network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0157] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A data management method for a distributed storage system, characterized in that: A task tracking management module applied to the distributed storage system, wherein the distributed storage system includes a cascade switch, multiple leaf switches, multiple clients, multiple servers, a metadata server and the task tracking management module, all of the leaf switches are connected to the cascade switch, each of the leaf switches is respectively connected to multiple clients and multiple servers, the metadata server is connected to one of the leaf switches, and the task tracking management module is connected to one of the leaf switches; The method comprises: When a target task is received, determining a target server where data corresponding to the target task is located; Determine candidate clients of the leaf switch connected to the same target server, and select a target client for executing the target task from among the candidate clients, so as to execute the target task using the target client.

2. The data management method according to claim 1, characterized in that: The determining the target server where the data corresponding to the target task is located includes: The metadata server or the local cache is queried to determine the target server where the data corresponding to the target task is located.

3. The data management method according to claim 1, characterized in that: The determining of a candidate client connected to the same leaf switch as the target server includes: The target server or the local cache is queried to determine a candidate client that is connected to the same leaf switch as the target server.

4. The data management method according to claim 1, characterized in that: Selecting a target client to execute the target task from among the candidate clients includes: The candidate client with the lightest load is selected as the target client for executing the target task.

5. The data management method according to claim 1, characterized in that: The metadata server and the task tracking management module are connected to the same leaf switch.

6. The data management method according to claim 1, characterized in that: The determining the target server where the data corresponding to the target task is located includes: Obtaining the distribution of data corresponding to the target task, dividing the target task into a plurality of subtasks according to the distribution, and determining a target server where the data corresponding to each subtask is located; Accordingly, determining a candidate client connected to the same leaf switch as the target server, and selecting a target client that performs the target task from among the candidate clients, so as to use the target client to perform the target task, includes: Determine candidate clients of the leaf switch connected to the same leaf switch as the target server, and select a target client for executing the subtask from the candidate clients, so as to execute the subtask using the target client.

7. The data management method according to claim 6, characterized in that: The obtaining the distribution of the data corresponding to the target task includes: The distribution of the data corresponding to the target task is obtained by querying the metadata server or the local cache.

8. The data management method according to claim 1, characterized in that: If the distributed storage system is a distributed file storage system, the method further includes: When a task to create a first target directory is received, a first target client that executes the creation task is determined so that the first target client queries the first target server and the first leaf switch where the parent directory of the first target directory is located through the metadata server, selects a second target server from the servers connected to other leaf switches except the first leaf switch, and creates the first target directory in the second target server.

9. The data management method according to claim 8, characterized in that: The selecting a second target server from servers connected to other leaf switches except the first leaf switch includes: Determine a first server quantity of servers connected to leaf switches other than the first leaf switch; A hash value of the directory name of the first target directory is modulo the number of the first servers, and a second target server is selected according to the modulo result.

10. The data management method according to claim 1, characterized in that: If the distributed storage system is a distributed file storage system, then when receiving a target task, determining a target server where data corresponding to the target task is located includes: When receiving a read task for a second target directory, determining a third target server where the second target directory is located; Accordingly, determining candidate clients connected to the same leaf switch as the target server, and selecting a target client that performs the target task from the candidate clients so as to use the target client to perform the target task includes: Determine a candidate client connected to the same leaf switch as the third target server, and select a second target client that performs the read task from the candidate clients so that the second target client reads the second target directory.

11. The data management method according to claim 1, characterized in that: If the distributed storage system is a distributed file storage system, then when receiving a target task, determining a target server where data corresponding to the target task is located includes: When receiving a write task for a first target file, determining a fourth target server where a parent directory of the first target file is located; Accordingly, determining a candidate client connected to the same leaf switch as the target server, and selecting a target client that performs the target task from among the candidate clients, so as to use the target client to perform the target task, includes: Determine a candidate client of the leaf switch connected to the same leaf switch as the fourth target server, and select a third target client that performs the write task from the candidate clients so that the third target client writes the first target file to a server of the leaf switch connected to the same leaf switch as the fourth target server.

12. The data management method according to claim 11, characterized in that: Before the third target client writes the first target file into a server connected to the same leaf switch as the fourth target server, the method further includes: The third target client selects a fifth target server from the servers of the leaf switch connected to the same leaf switch as the fourth target server, and writes the metadata of the first target file to the fifth target server.

13. The data management method according to claim 12, characterized in that: The third target client selects a fifth target server from the servers of the leaf switch connected to the same leaf switch as the fourth target server, including: The third target client determines the second server number of the server connected to the same leaf switch as the fourth target server, modulo the hash value of the file name of the first target file according to the second server number, and selects the fifth target server according to the modulo result.

14. The data management method according to claim 12, characterized in that: The third target client writes the first target file to a server of the same leaf switch as the fourth target server, including: The third target client writes the first block of the first target file to the fifth target server, and writes the remaining blocks of the first target file to the server connected to the same leaf switch as the fourth target server in a round-robin sequential write manner.

15. The data management method according to claim 1, characterized in that: If the distributed storage system is a distributed file storage system, then when receiving a target task, determining a target server where data corresponding to the target task is located includes: When receiving a read task for a second target file, determining a sixth target server where a parent directory of the second target file is located; Accordingly, determining candidate clients connected to the same leaf switch as the target server, and selecting a target client that performs the target task from the candidate clients so as to use the target client to perform the target task includes: Determine a candidate client connected to the same leaf switch as the sixth target server, and select a fourth target client that performs the reading task from the candidate clients so that the fourth target client reads the second target file.

16. The data management method according to claim 15, characterized in that: The fourth target client reads the second target file, including: The fourth target client determines the seventh target server storing the metadata of the second target file among the servers of the leaf switch connected to the same leaf switch as the sixth target server, and reads the second target file from the servers of the leaf switch connected to the same leaf switch as the sixth target server in a round-robin sequential reading manner starting from the seventh target server.

17. The data management method according to claim 16, characterized in that: The fourth target client determines, from among the servers of the leaf switch connected to the same leaf switch as the sixth target server, a seventh target server storing metadata of the second target file, including: The fourth target client determines the number of the third servers among the servers connected to the same leaf switch as the sixth target server, modulo the hash value of the file name of the second target file according to the number of the third servers, and selects the seventh target server according to the modulo result.

18. The data management method according to claim 1, characterized in that: If the distributed storage system is a distributed block storage system, then when receiving a target task, determining a target server where data corresponding to the target task is located includes: When receiving a read / write task of target data, determining a start position and an end position corresponding to the read / write task, and determining a target server where the start position and the end position are located respectively; Accordingly, determining candidate clients connected to the same leaf switch as the target server, and selecting a target client that performs the target task from the candidate clients so as to use the target client to perform the target task includes: If the target server where the starting position and the ending position are located is the same, then determining candidate clients of the leaf switch connected to the same target server, and selecting a target client that performs the read and write task from among the candidate clients, so as to use the target client to perform the read and write task; If the target servers where the starting position and the ending position are located are different, the read and write task is divided into multiple subtasks, and the target client for executing each subtask is selected from the candidate clients connected to the same leaf switch as the target server corresponding to each subtask, so that each subtask is executed using the target client corresponding to each subtask.

19. The data management method according to claim 18, characterized in that: The determining of the target servers where the starting position and the ending position are located respectively includes: The fourth server number of all the servers included in the distributed block storage system is obtained, the starting position and the ending position are modulo the fourth server number, and the target servers where the starting position and the ending position are located are determined according to the modulo results.

20. The data management method according to claim 18, characterized in that: The determining of the target servers where the starting position and the ending position are located respectively includes: Obtain a fourth server number of all the servers included in the distributed block storage system, perform modulo operations on hash values ​​of block object names to which the starting position and the ending position belong respectively according to the fourth server number, and determine the target servers where the starting position and the ending position are located respectively according to the modulo operation results.

21. A data management device for a distributed storage system, characterized in that: A task tracking management module applied to the distributed storage system, wherein the distributed storage system includes a cascade switch, multiple leaf switches, multiple clients, multiple servers, a metadata server and the task tracking management module, all of the leaf switches are connected to the cascade switch, each of the leaf switches is respectively connected to multiple clients and multiple servers, the metadata server is connected to one of the leaf switches, and the task tracking management module is connected to one of the leaf switches; The device comprises: A determination unit, configured to, when receiving a target task, determine a target server where data corresponding to the target task is located; The selection unit is used to determine candidate clients connected to the same leaf switch as the target server, and select a target client that performs the target task from the candidate clients, so as to use the target client to perform the target task.

22. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data management method for a distributed storage system as claimed in any one of claims 1 to 20 when executing the computer program.

23. A computer non-volatile readable storage medium, characterized in that: The computer non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data management method of the distributed storage system as claimed in any one of claims 1 to 20 are implemented.

Citation Information

Patent Citations

  • Integrated cloud storage system and storage method thereof

    CN103763383A

  • Storage management method, device and equipment and machine readable storage medium

    CN114785662A

  • Method and device for selecting target storage server and electronic equipment

    CN115834587A

  • Data management method and device for distributed storage system, equipment and medium

    CN117234428A

  • Server for torus network-based distributed file system and method using the same

    US20190155922A1