Disposal group selection method, apparatus, device, and storage medium

CN116243849BActive Publication Date: 2026-08-07NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NEW H3C TECH CO LTD
Filing Date
2022-11-23
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0015]上述传统数据对象到PG的路由方案,每次数据的输入/输出(I/O)即数据读/写都需要计算数据对象到PG的映射关系,会消耗CPU算力

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116243849B_ABST
    Figure CN116243849B_ABST
Patent Text Reader

Abstract

The application provides a method and device for selecting a placement group, an equipment and a storage medium applied to a distributed object storage system. When a storage engine is initialized, a local node PG list and a non-local node PG list of a storage node where the storage engine is located are obtained. When the storage engine receives a write request of a terminal, a smooth weighted round robin selection algorithm is used to select a PG in the local node PG list of the storage node where the storage engine is located to issue the write request. Through the application, CPU computing power can be saved when a data object is routed to a placement group, network delay caused by storing a data object across nodes can be avoided as much as possible, storage performance can be improved, and the selection of the PG can be more balanced and dispersed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage technology, and in particular to a method, apparatus, device and storage medium for selecting placement groups. Background Technology

[0002] In distributed storage systems like Ceph, data of various formats, such as audio / video data, text data, and image data, can be stored as data objects. In the storage cluster of such distributed storage systems, each storage node deploys multiple object storage devices (OSDs), and data objects are stored in the OSDs. For ease of description, this application refers to such distributed storage systems as distributed object storage systems.

[0003] In a distributed object storage system, the process of storing data objects in an OSD mainly includes the following two steps:

[0004] 1. A static hash algorithm is used to calculate the data route from the data object to the Placement Group (PG). A PG is a logical concept in a distributed storage system such as Ceph. It is a logical collection that stores data objects, which facilitates the unified management of customer data by the storage system. Data objects in the same PG will be distributed to the same OSD nodes for storage.

[0005] 2. The CRUSH algorithm is used to calculate the data route from PG to OSD;

[0006] Data objects are stored in logical storage pools. However, when the number of objects issued by the clients of a distributed object storage system becomes too large, the management and maintenance of data objects becomes difficult to scale. Therefore, logical units called Groups (PGs) are introduced to further subdivide the pool into several PGs.

[0007] Assuming the pool name is fs_pool and there are 256 PGs, each PG is numbered 0x0, 0x1, 0xF…0xFF. Each storage object is assigned a unique object name. In traditional schemes, the method to obtain the data route from the data object to the PG is to first use a hash function to perform a hash calculation on the name of the data object, obtaining a string of values, as shown in the example below:

[0008] HASH('data object name 1') = 0x3E0A4162

[0009] HASH('data object name 2') = 0x7FE391A0

[0010] HASH('data object name 1') = 0x3E0A4162

[0011] After hashing the data object name, a hexadecimal output value is obtained, which converts the object name into a numerical value. Data object names with the same hash name will produce the same hash value. Then, the hash value is used to perform a modulo operation with the total number of PGs to obtain the PG number mapped to the data object name. For example:

[0012] 0x3E0A4162%0xFF=0x62

[0013] 0x7FE391A0%0xFF=0xA0

[0014] Then, the CRUSH algorithm is used to calculate the data route from PG to OSD, and finally the data object is saved on OSD.

[0015] The traditional data object-to-PG routing scheme described above requires calculating the mapping relationship between the data object and the PG for each data input / output (I / O), i.e., data read / write, which consumes CPU computing power. Moreover, static hashing may result in calculating a PG that is not on the local node, and the data object will be written to an OSD on a different node. This will cause the data object to be transferred across nodes through the storage network, thereby increasing I / O latency and reducing read / write performance. Summary of the Invention

[0016] In view of this, this application provides a method, apparatus, device and storage medium for improving storage efficiency and the balance and distribution of PG selection.

[0017] Based on one aspect of the embodiments of the present invention, this application provides a placement group selection method, which is applied to storage nodes in a distributed object storage system, the method comprising:

[0018] During storage engine initialization, obtain the local node placement group (PG) list and non-local node PG list of the storage node to which the storage engine belongs;

[0019] When the storage engine receives a write request, it preferentially selects the PG that issues the write request from the PG list of this node based on a smooth weighted round-robin selection algorithm.

[0020] Furthermore, the method for obtaining the local PG list and non-local PG list of the storage node to which the storage engine belongs is as follows:

[0021] Send a local node object storage device OSD list request message to the master monitoring node in the storage cluster, in order to request and receive the local node OSD list of the storage node to which the storage engine belongs from the master monitoring node; the local node OSD refers to the OSD deployed on the storage node where the storage engine is located;

[0022] Send a PG list request message carrying the OSD list of the local node to the master management node in the storage cluster, in order to request and receive the local node PG list and non-local node PG list of the storage node to which the storage engine belongs; wherein, the local node PG refers to the PG in which the master OSD of the PG is deployed on the storage node where the storage engine is located.

[0023] Furthermore, when the storage engine receives a write request and finds that the local PG list of its storage node is empty, it selects the PG to issue the write request from the non-local PG list based on a smooth weighted round-robin selection algorithm.

[0024] Furthermore, the smooth weighted round-robin selection algorithm is as follows:

[0025] During initialization, the current effective weight of each PG is initialized to its configured weight, and the sum of the configured weights is calculated.

[0026] In each poll after initialization, the PG with the largest current effective weight is selected as the PG selected in this poll. After selecting the PG, the current effective weight of the selected PG is subtracted from the configured weight. Then, the current effective weight of each PG is added to its configured weight. The current effective weight of each PG is used as the basis for the next poll.

[0027] Based on one aspect of the present invention, this application provides a placement group selection device, which is applied to a storage node in a distributed object storage system. The device can be implemented in software, hardware, or a combination of both. When implemented as a software module, when the program code of the software module is loaded into the storage medium of the device, the processor reads the program code from the storage medium and executes it, thereby realizing the functions of each component module in the device. The device includes:

[0028] The PG list acquisition module is used to acquire the local node placement group PG list and non-local node PG list of the storage node to which the storage engine belongs during storage engine initialization.

[0029] The PG selection module is used to select the PG that issues the write request from the PG list of this node based on a smooth weighted round-robin selection algorithm when the storage engine receives a write request.

[0030] Furthermore, the PG list acquisition module includes:

[0031] The OSD list acquisition unit is used to send a local node object storage device OSD list request message to the main monitoring node in the storage cluster, in order to request and receive the local node OSD list of the storage node to which the storage engine belongs, returned by the main monitoring node; the local node OSD refers to the OSD deployed on the storage node where the storage engine is located;

[0032] The PG list acquisition unit is used to send a PG list request message carrying the OSD list of the current node to the master management node in the storage cluster, so as to request and receive the current node PG list and non-current node PG list of the storage node to which the storage engine belongs from the master management node; wherein, the current node PG refers to the PG in which the master OSD of the PG is deployed on the storage node where the storage engine is located.

[0033] Furthermore, the PG selection module is also used to select the PG that will issue the write request from the list of PGs outside the local node based on a smooth weighted round-robin selection algorithm when the storage engine receives a write request and finds that the local node's PG list is empty.

[0034] Furthermore, the PG selection module includes:

[0035] The initialization unit is used to initialize the current effective weight of each PG to its configured weight during initialization, and to calculate the sum of the configured weights.

[0036] The polling selection unit is used to select the PG with the largest current effective weight in each poll after initialization as the PG selected in this poll. After selecting the PG, the current effective weight of the selected PG is subtracted from the configured weight, and then the current effective weight of each PG is added to its configured weight. The current effective weight of each PG is used as the basis for the next poll.

[0037] Based on another aspect of the embodiments of the present invention, this application also provides an electronic device, including a processor, a communication interface, a storage medium and a communication bus, wherein the processor, the communication interface and the storage medium communicate with each other through the communication bus;

[0038] Storage medium used to store computer programs;

[0039] A processor, when executing a computer program stored on a storage medium, implements the method steps of the placement group selection method provided in this application.

[0040] It should be noted that the method of this application can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of the multiple devices may execute only one or more steps of the method of this application. The multiple devices will interact with each other to jointly complete the method and achieve the inventive purpose of this application, and a mutual command and control relationship will exist between the multiple devices. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments of this application or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings of the embodiments of this application.

[0042] Figure 1 A schematic diagram illustrating a distributed storage cluster structure and a storage engine for obtaining a PG list, provided in an embodiment of this application;

[0043] Figure 2 The step flow of the placement group selection method provided in an embodiment of this application;

[0044] Figure 3 This is a schematic diagram illustrating the process by which the storage engine obtains the local node's PG list and non-local node's PG list during initialization in one embodiment of this application;

[0045] Figure 4 This is a schematic diagram of the deployment structure of a storage cluster PG and OSD provided in an embodiment of this application;

[0046] Figure 5 This is a schematic diagram illustrating a method for selecting a placement group when a storage engine receives a write request, according to one embodiment of this application.

[0047] Figure 6 This is a schematic diagram of an electronic device structure for implementing the placement group selection method provided in this application, as an embodiment of the present application. Detailed Implementation

[0048] The terminology used in the embodiments of this application is for the purpose of describing specific embodiments only and is not intended to limit the embodiments of this application. The singular forms "a," "the," and "the" used in the embodiments of this application are also intended to include the plural forms unless the context clearly indicates otherwise. It should be understood that although the terms first, second, third, etc., may be used to describe various information in the embodiments of this application, this information should not be limited to these terms. These terms are only used to distinguish similar information, entities, or steps, and are not used to describe a specific order or sequence. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Furthermore, the word "if" used can be interpreted as "when," "when," or "in response to a determination." "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. And, in the description of this application, unless otherwise stated, "multiple" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can be expressed as: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0049] To improve the performance of distributed object storage systems, this application provides a placement group selection method, apparatus, and device for distributed object storage systems. The core idea of ​​this application is: during storage engine initialization, the local PG list and non-local PG lists of the storage node where the storage engine resides are obtained. When the storage engine receives a write request from a terminal, a smooth weighted round-robin selection algorithm is preferentially used to select the PG that will issue the write request from the local PG list of the storage node where the storage engine resides. This technical solution can save CPU computing power when routing data objects to placement groups, minimize network latency caused by storing data objects across nodes, improve storage performance, and make PG selection more balanced and distributed.

[0050] Figure 1This diagram illustrates a distributed storage cluster structure and a storage engine's method for obtaining a PG list, as provided in an embodiment of this application. The example distributed storage cluster includes storage nodes node1, node2, and node3. Each storage node deploys a storage engine, a monitoring node (MON), a management node (Mgr), and multiple object storage devices (OSDs). The MON and Mgr can be deployed separately on different storage nodes or on the same storage node. When deployed on the same storage node, the Mgr can be integrated as a sub-module of the MON within a single process, collectively referred to as the MON node. Of the three storage nodes, the primary MON is located on node2, and the MONs on the other storage nodes are secondary MONs. The primary Mgr is located on node3, and the Mgrs on the other storage nodes are secondary Mgrs.

[0051] The MON function includes maintaining and managing the Object Storage Device Map (OSDMap) and Metadata Service Map (MDSMap). Through the MON, you can obtain the architecture and status information of the storage nodes, and know the storage node where each OSD is located and its status.

[0052] The functions of the Manager include maintaining and managing the Placement Group Map (PGMAP). Through the Manager, you can know the status and attributes of each PG, including which OSDs are contained in each PG, the status of the PG, and which OSD is the master OSD in the PG.

[0053] The primary MON and primary Mgr nodes are typically used to carry the control flow services of a distributed storage cluster. The selection of the primary MON and primary Mgr nodes is usually based on the configuration strategy during cluster deployment.

[0054] Figure 2 The following is a flowchart of a placement group selection method provided in an embodiment of this application. The method includes:

[0055] Step 201. During storage engine initialization, send messages to the primary monitoring node (MON) and the primary management node (Mgr) to obtain the local PG list and non-local PG list of the storage node to which the storage engine belongs;

[0056] Figure 3 This is a schematic diagram illustrating the process by which the storage engine obtains the local node's PG list and non-local node's PG list during initialization, according to an embodiment of this application. The specific process includes the following steps:

[0057] Step 301. The storage engine sends a local OSD list request message to the master monitoring node (MON2) in the storage cluster to request the master monitoring node to return the OSD list of the storage node to which the storage engine belongs;

[0058] During initialization, each storage engine in the cluster (storage engine 1, storage engine 2, storage engine 3) sends a local OSD list request message to the master monitoring node (MON2) in the storage cluster, requesting the master monitoring node to return the OSD list of the storage node where the storage engine is located.

[0059] Step 302. The storage engine sends a PG list request message carrying the OSD list of this node to the master management node in the storage cluster, in order to request the master management node to return the PG list of this node and the PG list of non-this node of the storage node to which the storage engine belongs;

[0060] During initialization, each storage engine (storage engine 1, storage engine 2, storage engine 3) in the storage cluster sends a PG list request message carrying the OSD list of its node to the master management node (Mgr3) in the cluster, requesting the master management node to return the PG list of its own node and the PG list of non-its own node belonging to the storage node where the storage engine is located.

[0061] Step 303. After receiving the PG list request message, the master management node (Mgr3) obtains the local PG list and non-local PG list of the storage node where the storage engine that sent the PG list request message is located based on the OSD list and the global PG list of the entire storage cluster carried in the message. Then, it returns the local PG list and non-local PG list to the storage engine that sent the PG list request message.

[0062] The master management node (Mgr3) manages the global PGMAP for the entire storage cluster. Assuming each PG contains 3 OSDs (1 master OSD and 2 slave OSDs), each PG object is considered a local PG for the storage node to which the master OSD belongs, but a non-local PG for the storage node to which the slave OSD belongs. Upon receiving a PG list request message from a storage engine, the master management node iterates through each OSD object carried in the message and each PG object in the global storage pool (PGMAP). It determines whether the OSD in the message is the master OSD of the traversed PG. If it is, the PG is considered a local PG of the storage node where the storage engine that sent the PG list request message resides. If it is not a master OSD of the traversed PG, the PG is considered a non-local PG of the storage node where the storage engine that sent the PG list request message resides.

[0063] Figure 4 This is a schematic diagram of the storage cluster PG and OSD deployment structure provided in an embodiment of this application. (In conjunction with...) Figure 1 and Figure 4This resource view example illustrates a storage cluster employing a 3-replica mechanism. Each placement group uses one locally deployed OSD as the primary OSD, and then selects two OSDs deployed on other storage nodes as secondary OSDs for that placement group. A placement group contains a total of 3 OSDs, and a single piece of business data is replicated into 3 replicas and stored on each of the 3 OSDs. The primary MON node maintains an OSDMAP, which provides information on the storage node where each OSD resides and its status. The primary management node maintains a PGMAP for the storage cluster, which provides a global list of PGs and the OSDs contained within each PG. There is a PG1.1 object in the global PG list. The OSD list contained in PG1.1 is {OSD1, OSD2, OSD13}. During the initialization process, the storage engine of node1 first sends a request message for the OSD list of this node to the master MON node located on node2. It obtains the OSD list of all OSDs deployed on node1 from the master MON node as {OSD1, OSD3, OSD5, OSD7, OSD9, OSD11}. After the storage engine on node1 obtains the OSD list for its local node, it sends a PG list request message to the master manager on node3. This message carries the OSD list containing {OSD1, OSD3, OSD5, OSD7, OSD9, OSD11}. The master manager sequentially retrieves each OSD from the OSD list and iterates through the global PG list. When it reaches OSD1 and pg1.1, it finds that OSD1 is the master OSD of pg1.1. Since OSD1 belongs to node1, pg1.1 is a local PG for node1, and is added to node1's local PG list. When it reaches pg1.2, it finds that the master OSD of pg1.2 is OSD8. Since OSD8 belongs to node2 and not node1, pg1.2 is a non-local PG for node1. Therefore, pg1.2 is added to node1's non-local PG list. The processing of other PGs in the global PG list is the same and will not be elaborated here. Similarly, for other storage nodes, the local PG list and non-local PG list of each storage node are obtained in the same way as described above, which will not be repeated here.

[0064] Step 202. When the storage engine receives a write request, it preferentially selects the PG that issues the write request from the PG list on this node based on the smooth weighted round-robin selection algorithm;

[0065] When a storage node receives a write request from a storage client, it first selects a PG from its local PG list using a smooth weighted round-robin selection algorithm. This ensures that the primary OSD of the selected PG is located on the local storage node, avoiding the overhead of an extra network traversal when writing data objects to three replicas based on the write request, thus reducing latency and improving write performance. The smooth weighted round-robin selection algorithm guarantees that the probability of a PG being selected from the local PG list is balanced and random, preventing the possibility of a single PG being selected multiple times. This also avoids the risk of single-point bottlenecks or downtime due to writing to the same OSD, ensuring load balancing.

[0066] Figure 5 This is a schematic diagram illustrating a method for a storage engine to select a placement group when receiving a write request, according to one embodiment of this application. In this example, it is assumed that the storage engine in storage node 1 obtains a local PG list including placement group PG1.1, and the OSD list of PG1.1 is {OSD1, OSD2, OSD13}. OSD1 is the primary OSD located on this storage node node1, and OSD2 and OSD13 are secondary OSDs located on node2 and node3, respectively. Assuming that after receiving a write request from the storage system's client, the storage engine on node1 selects PG1.1 from the local PG list of node1 using a smooth weighted round-robin selection algorithm as the PG to issue the write request, the data object will first be written to OSD1, and then, according to the PG configuration, the data object written to OSD1 will be copied to OSD2 and OSD13 via the storage network.

[0067] In another embodiment of this application, when the storage engine receiving the write request finds that the local PG list of its storage node is empty, it selects a PG from the list of non-local PGs based on a smooth weighted round-robin selection algorithm to issue the write request. Figure 5 For example, assuming the local PG list of storage node2 is empty, when the storage engine of node2 receives a write request from the storage client, it will select the PG to issue the write request from the list of non-local PGs based on a smooth weighted round-robin selection algorithm. Assuming PG1.1 is selected as the PG to issue the write request, since the primary OSD of PG1.1 is located on node1, the data object generated based on the write request will first be written to OSD1 of node1 through the storage network, and then, according to the PG configuration, the data object written to OSD1 will be copied to OSD2 and OSD13 respectively through the storage network.

[0068] The placement group selection method provided in this application prioritizes writing data objects to PGs in the local node's PG list when the storage engine receives a write request, increasing the affinity for local disk writes and improving storage efficiency. Furthermore, when selecting PGs from the local node's PG list and non-local node PG lists, a smooth weighted round-robin selection algorithm is used to choose the PG that issues the write request, resulting in a more balanced and distributed PG selection.

[0069] In another embodiment of this application, a novel smooth weighted round-robin selection algorithm is provided for evenly writing data objects to PGs within a storage cluster. The load balancing algorithm for writing data objects to persistent disk media needs to consider the data balance among PGs within the cluster; it should not allow PGs with large amounts of data to remain unwritten for extended periods, nor should it allow PGs with small amounts of data to remain written to for extended periods. Data should be distributed across different PGs as much as possible.

[0070] For example, suppose node1 obtains the following list of PGs (PGs) from the master manager: {PG1.1:5, PG1.8:1, PG1.21:1}, where the numbers after the colons represent the weights of the PGs. If a traditional weighted round-robin selection algorithm is used, the write requests issued by the client will be based on the weight of each PG, preferentially selecting the PG with the highest weight to send the write request. Therefore, the sequence of PGs sent would be {PG1.1, PG1.1, PG1.1, PG1.1, PG1.1, PG1.8, PG2.1}. It is evident that the traditional weighted round-robin selection algorithm can lead to hot data in the same PG within a short period, thus becoming a performance bottleneck, as data cannot be distributed across different PGs in the cluster.

[0071] The smooth weighted round-robin selection algorithm provided in this application introduces currently effective weights to achieve a relatively smooth allocation sequence, based on the traditional weighted round-robin selection algorithm based on configuration weights. The algorithm is described in detail below:

[0072] Assume that, based on the OSD health status reported by the OSDs, there are N healthy primary PGs {pg1, pg2, ..., pgn}. These PGs have configuration weights w = {w1, w2, ..., wi, ..., wn} and effective weights cw = {cw1, ​​cw2, ..., cwi, ..., cwn}. Each PG instance i, in addition to its configuration weight wi, also has a current effective weight cwi, initialized to wi. The configuration weights of each PG are generated by the storage engine based on a preset algorithm after obtaining the PG list. For example, they can be randomly assigned to each PG in the list using a random function, or generated based on the amount of remaining available space in the PG. The current position variable currentPos indicates the currently selected PG, and the sum of the configuration weights of all PG instances is weightSum.

[0073] The steps to implement this algorithm are as follows:

[0074] (1) During initialization, the current effective weight of each PG is initialized to the configuration weight of each PG, and the configuration weight and weightSum are calculated.

[0075] For example, initialize the current effective weight cwi of PG instance i, configure its weight wi, and calculate the sum of the configured weights of all PG instances participating in the round-robin, i.e., weightSum.

[0076] (2) Select the PG with the largest current effective weight, point the current position variable currentPos to the PG, and subtract the configuration weight and weightSum from the current effective weight cwi of the PG;

[0077] (3) Add the configured weight wi to the current effective weight cwi of each PG;

[0078] (4) Get the PG pointed to by the current position variable currentPos as the selected PG;

[0079] (5) Repeat steps 2, 3, and 4 above each time PG is selected in the poll after initialization.

[0080] Table 1 illustrates the process by which the storage engine selects a PG using the smooth weighted round-robin selection algorithm provided in this application after receiving a write request from a client.

[0081] Table 1

[0082]

[0083]

[0084] Based on Table 1, assuming the local PG list for node1 is {PG1.1, PG1.8, PG1.21}, the initial configuration weights of these PGs are {5, 1, 1}, and the current effective weight of each PG is initialized to its configuration weight. Before receiving the first write request, the current effective weights of these PGs are {5, 1, 1}, and the configuration weight and weightSum are 7.

[0085] In the first round of the loop, PG1.1 has the largest weight value, so currentPos is set to PG1.1. PG1.1 is the selected PG in this round and is used to store the data object of the first write request. After selection, the current effective weight of PG1.1 is subtracted from the configured weight and 7, so that the current effective weight of all PGs is {-2, 1, 1}. Then, the current effective weight of all PGs is added to the configured weight {5, 1, 1}, so that the current effective weight of all PGs becomes {3, 2, 2}.

[0086] In the third round of the loop, the initial effective weights of all PGs are {1, 3, 3}. The PGs with the largest weights are PG1.8 and PG1.21, both with a weight of 3. When multiple PGs have the same weight and the largest weight, the PG with the largest weight is selected first. Therefore, currentPos is set to PG1.8, which is the PG selected in this round and is used to store the data object of the third write request. After selection, the current effective weight of PG1.8 is subtracted from the configured weight and 7, resulting in the current effective weights of all PGs being {1, -4, 3}. Then, the current effective weights of all PGs are added to the configured weights {5, 1, 1}, resulting in the current effective weights of all PGs being {6, -3, 4}.

[0087] Similarly, the other loops follow the same pattern. See Table 1 for changes in the current effective weights and selected PGs.

[0088] Figure 6 This is a schematic diagram of an electronic device 600 for implementing the placement group selection method provided in this application, according to an embodiment of the present application. The device includes a processor 610 (such as a central processing unit (CPU), a communication bus 620, a communication interface 640, and a memory 630. The processor 610 and the memory 630 can communicate with each other via the communication bus 620. The memory 630 stores a computer program, which, when executed by the processor 610, can implement one or more steps of the placement group selection method provided in this application.

[0089] Memory refers to a device based on a storage medium used to store computer programs and / or data. It can be volatile memory (VM, often called main memory) or non-volatile memory (NVM). Main memory refers to internal storage that directly exchanges data with the processor. It can read and write data at any time and at high speed, serving as a storage medium for temporary data of the operating system and other running programs. Main memory can be Synchronous Dynamic Random Access Memory (SDRAM), Dynamic Random Access Memory (DRAM), etc. Non-volatile memory refers to memory that uses persistent storage media, characterized by large capacity and persistent data retention. It can be Storage Class Memory (SCM), Solid State Drive (SSD), NAND flash memory, hard disks, etc. SCM is an industry term for a new type of storage medium that falls between main memory and flash memory. It is a composite storage technology that combines the characteristics of persistent storage and main memory, with access speeds slower than DRAM but faster than SSDs.

[0090] The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0091] It should be understood that embodiments of this application can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in non-transitory (or non-persistent) memory. The methods can be implemented using standard programming techniques, including a non-transitory storage medium configured with a computer program within the computer program, wherein such a storage medium causes the computer to operate in a specific and predefined manner. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit. Furthermore, the operations of the processes described in this application can be performed in any suitable order unless otherwise indicated by this application or otherwise clearly contradicted by the context. The processes described in this application (or variations and / or combinations thereof) can be executed under the control of one or more computer systems configured with executable instructions and can be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program includes a plurality of instructions executable by one or more processors.

[0092] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices. Aspects of this application can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, which, when read by the computer, can be used to configure and operate the computer to perform the processes described herein. Additionally, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention described in this application includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. This application also includes the computer itself when programmed according to the methods and techniques described herein.

[0093] The above description is merely an embodiment of this application and is not intended to limit 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 protection scope of this application.

Claims

1. A method for selecting placement groups, characterized in that, This method is applied to storage nodes in a distributed object storage system, and the method includes: During storage engine initialization, the local node placement group (PG) list and non-local node PG list of the storage node to which the storage engine belongs are obtained; wherein, the local node PG refers to the PG in which the primary object storage device (OSD) in the PG is deployed on the storage node where the storage engine is located, and the local node PG list includes at least one PG; When the storage engine receives a write request, it preferentially selects the PG that issues the write request from the PG list in this node based on a smooth weighted round-robin selection algorithm. The smooth weighted round-robin selection algorithm is as follows: During initialization, the current effective weight of each PG is initialized to its configured weight, and the sum of the configured weights is calculated. In each poll after initialization, the PG with the largest current effective weight is selected as the PG selected in this poll. After selecting the PG, the current effective weight of the selected PG is subtracted from the configured weight. Then, the current effective weight of each PG is added to its configured weight. The current effective weight of each PG is used as the basis for the next poll.

2. The method according to claim 1, characterized in that, The method for obtaining the local PG list and non-local PG list of the storage node to which the storage engine belongs is as follows: Send a local node OSD list request message to the primary monitoring node in the storage cluster to request and receive the local node OSD list of the storage node to which the storage engine belongs; the local node OSD refers to the OSD deployed on the storage node where the storage engine is located; Send a PG list request message carrying the OSD list of this node to the master management node in the storage cluster, in order to request and receive the PG list of this node and the PG list of non-this node of the storage node to which the storage engine belongs from the master management node.

3. The method according to claim 1, characterized in that, When the storage engine receives a write request and finds that the local PG list of its storage node is empty, it selects a PG from the non-local PG list to issue the write request based on a smooth weighted round-robin selection algorithm.

4. A sorting group selection device, characterized in that, This device is used in storage nodes of a distributed object storage system, and the device includes: The PG list acquisition module is used to acquire the local node placement group PG list and non-local node PG list of the storage node to which the storage engine belongs during storage engine initialization; wherein, the local node PG refers to the PG in which the primary object storage device (OSD) of the PG is deployed on the storage node where the storage engine is located; The PG selection module is used to select the PG that issues the write request from the PG list of this node based on a smooth weighted round-robin selection algorithm when the storage engine receives a write request. The PG selection module includes: The initialization unit is used to initialize the current effective weight of each PG to its configured weight during initialization, and to calculate the sum of the configured weights. The polling selection unit is used to select the PG with the largest current effective weight in each poll after initialization as the PG selected in this poll. After selecting the PG, the current effective weight of the selected PG is subtracted from the configured weight, and then the current effective weight of each PG is added to its configured weight. The current effective weight of each PG is used as the basis for the next poll.

5. The apparatus according to claim 4, characterized in that, The PG list acquisition module includes: The OSD list acquisition unit is used to send a local node OSD list request message to the main monitoring node in the storage cluster, in order to request and receive the local node OSD list of the storage node to which the storage engine belongs, returned by the main monitoring node; the local node OSD refers to the OSD deployed on the storage node where the storage engine is located. The PG list acquisition unit is used to send a PG list request message carrying the OSD list of the current node to the master management node in the storage cluster, so as to request and receive the PG list of the current node and the non-current node of the storage node to which the storage engine belongs from the master management node.

6. The apparatus according to claim 4, characterized in that, The PG selection module is also used to select the PG that will issue the write request from the list of PGs that are not in the local node based on a smooth weighted round-robin selection algorithm when the storage engine receives a write request and finds that the local node's PG list is empty.

7. An electronic device, characterized in that, It includes a processor, a communication interface, a storage medium, and a communication bus, wherein the processor, the communication interface, and the storage medium communicate with each other through the communication bus; Storage medium used to store computer programs; A processor, when executing a computer program stored on a storage medium, performs the method steps of any one of claims 1-3.

8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Data object storage method and device and storage medium

    CN112596973A

  • Distributed storage method and electronic equipment

    CN115033183A