Arrangement group equipment selection method and device, electronic equipment and storage medium

By obtaining and analyzing the historical information and logs of the subset group, combining with the preset hash algorithm, the selection of execution devices is optimized, the problem of unbalanced equipment distribution after expansion is solved, and the data read and write pressure equalization and data security are achieved Improvement.

CN119045730APending Publication Date: 2024-11-29ZHENGZHOU INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411079624.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

In the expansion scenario of distributed storage systems, the selection of execution devices is concentrated on some nodes, resulting in uneven read and write pressure in the cluster, affecting the efficiency of data reconstruction and increasing data security risks.

Method used

By obtaining the historical interval list and log information of the placement group, determine the target master device and authoritative device, use the preset hash algorithm to select the target pre-allocated device in the pre-allocated device, and select it in the execution device according to the temporary placement group message Target execution equipment to ensure the balanced distribution of execution equipment.

Benefits of technology

It achieves the balance of data reading and writing pressure of cluster equipment, accelerates the data reconstruction process after expansion, reduces the risk of data loss or damage, and ensures data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045730A_ABST
    Figure CN119045730A_ABST
Patent Text Reader

Abstract

The invention provides a collocation group equipment selection method and device, electronic equipment and a storage medium, and the method comprises the steps: responding to a distributed storage cluster expansion triggering peer-to-peer process, obtaining a historical interval list of a collocation group, determining target main equipment of execution equipment, obtaining a collocation group log of collocation group equipment and collocation group log updating time, and determining the collocation group log; determining an authoritative device by using the collocation group log update time and the target master device, comparing the collocation group log corresponding to the master device of the pre-distributed device with the collocation group log corresponding to the authoritative device, determining a target execution device, and if it is monitored that the target execution device is inconsistent with an execution device determined by using the device mapping information in advance, determining that the target execution device is not consistent with the execution device determined by using the device mapping information in advance. And generating a temporary collocation group message, selecting a target pre-distribution device from the pre-distribution devices by adopting a preset Hash algorithm, and selecting a target execution device from the execution devices according to the temporary collocation group message. According to the invention, the execution devices are uniformly distributed on each cluster device after cluster capacity expansion, and the balanced distribution of the arrangement group devices is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, an apparatus, an electronic device and a storage medium for selecting a placement group device. Background Art

[0002] In a distributed storage system, the management of the device member list of the placement group (PG) is a key link. The placement group is mainly used for data distribution and replica management. The member list of the PG is composed of different OSDs (Object-based Storage Devices). During the operation of the distributed storage cluster, if the cluster capacity is insufficient and needs to be expanded, the expansion process will trigger the peering process. Peering is used to reselect the up device and acting device in the PG device. The up device refers to the list of object storage devices currently responsible for processing PG requests, and the acting device refers to the list of object storage devices that actually store PG data.

[0003] At present, in the scenario of cluster expansion, the master device of the up device is usually the object storage device newly added to the cluster, and the master device of the acting device will select the authoritative OSD as the new master. However, when the cluster triggers peering to select the authoritative OSD for the first time, the object storage device newly added to the cluster cannot be selected as the authoritative OSD because the data is incomplete. The authoritative OSDs selected are all object storage devices with a high ranking. In this way, the selected authoritative OSDs are concentrated on nodes with small IDs, resulting in serious imbalance in the read and write pressure of the cluster, affecting the efficiency of data reconstruction, and further increasing the risk of data security. Summary of the invention

[0004] In view of this, the present invention aims to propose a placement group device selection method, apparatus, electronic device and storage medium to solve the problem that the selection of execution devices to concentrate some nodes in the expansion scenario leads to serious imbalance in cluster read and write pressure, affecting data reconstruction efficiency, and realize balanced distribution of placement group devices.

[0005] According to a first aspect of the present invention, a placement group device selection method is provided, which is applied to a distributed storage cluster, wherein the distributed storage cluster includes a placement group, and the placement group includes a pre-allocated device and an execution device. The method includes:

[0006] In response to the distributed storage cluster expansion triggering a peer process, obtaining a historical interval list of a placement group, and using the historical interval list to determine a target master device in the execution device;

[0007] Obtain a placement group log and a placement group log update time of a placement group device, and determine an authoritative device using the placement group log update time and the target master device;

[0008] Compare the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, and determine the target execution device according to the log comparison result;

[0009] It is detected that the target execution device is inconsistent with the execution device determined in advance using the device mapping information, and a temporary placement group message is generated; wherein the temporary placement group message includes the target execution device;

[0010] A preset hash algorithm is used to select a target pre-allocated device from the pre-allocated devices, and a target execution device is selected from the execution devices according to the temporary placement group message.

[0011] Optionally, in response to the distributed storage cluster expansion triggering a peer process, obtaining a historical interval list of a placement group, and using the historical interval list to determine a target master device in the execution device includes:

[0012] A new object storage device is detected in the distributed storage cluster, triggering a peer-to-peer process for selecting the device;

[0013] Responsive to the peer process, obtaining a list of historical intervals for a placement group;

[0014] Traversing the historical interval list, and using a preset data flag to find a target historical interval list;

[0015] Determine the object storage device corresponding to the target history interval list as the target master device of the execution device, and store the target master device information;

[0016] Optionally, after monitoring that a new object storage device is added to the distributed storage cluster and triggering a peer process for selecting a device, and before responding to the peer process and obtaining a historical interval list of a placement group, the method further includes:

[0017] Update device mapping information according to the newly added object storage device of the distributed storage cluster;

[0018] Synchronize the updated device mapping information to the placement group devices.

[0019] Optionally, the obtaining of the placement group log and the placement group log update time of the placement group device, and determining the authoritative device using the placement group log update time and the target master device, includes:

[0020] Obtain placement group device information corresponding to the placement group device, traverse the placement group device information, and determine the placement group log of the placement group device and the placement group log update time;

[0021] Sort the placement group log update times of the placement group devices by size, and determine the placement group device and the number of placement group devices corresponding to the maximum placement group log update time;

[0022] If the number of placement group devices corresponding to the maximum placement group log update time is one, determine the placement group device corresponding to the maximum placement group log update time as the authoritative device;

[0023] If the number of placement group devices corresponding to the maximum placement group log update time is at least two, the stored target master device information is obtained, and the target master device is determined as an authoritative device.

[0024] Optionally, comparing the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, and determining the target execution device according to the log comparison result, includes:

[0025] preselecting a master device from among the pre-allocated devices;

[0026] Obtain the placement group log corresponding to the master device in the pre-allocated device and the placement group log corresponding to the authoritative device;

[0027] Compare the placement group log corresponding to the master device in the pre-allocated device with the placement group log corresponding to the authoritative device to generate a log comparison result, and determine whether there is an intersection between the placement group logs according to the log comparison result;

[0028] If there is no intersection between the placement group logs, determining the authoritative device as the target master device of the execution device;

[0029] According to the target master device of the execution device and the preset number of placement group replicas, a target execution device is selected from the placement group devices; wherein the total number of the target execution devices is consistent with the preset number of placement group replicas.

[0030] Optionally, the monitoring that the target execution device is inconsistent with the execution device determined in advance using the device mapping information generates a temporary placement group message; wherein the temporary placement group message includes the target execution device, including:

[0031] Pre-determining the pre-allocated devices and the execution devices in the placement group devices by using the device mapping information in advance;

[0032] Comparing the target execution device with the execution device in the placement group device to determine whether the target execution device is consistent with the execution device;

[0033] If they are inconsistent, a temporary placement group message is generated, and the temporary placement group message is used to send the target execution device to the cluster monitor.

[0034] Optionally, the selecting a target pre-allocated device from the pre-allocated devices by using a preset hash algorithm, and selecting a target execution device according to the temporary placement group message, includes:

[0035] A preset hash algorithm is used to select a target pre-allocated device from the pre-allocated devices; wherein the target pre-allocated device is determined according to the device mapping information;

[0036] Updating the temporary placement group message to the device mapping information;

[0037] The updated device mapping information is used to select a target execution device from the execution devices.

[0038] According to a second aspect of the present invention, a placement group device selection apparatus is provided, which is applied to a distributed storage cluster, wherein the distributed storage cluster includes a placement group, and the placement group includes a pre-allocation device and an execution device, and the apparatus includes:

[0039] An information acquisition module, configured to acquire a historical interval list of a placement group in response to the distributed storage cluster expansion triggering a peer process, and use the historical interval list to determine a target master device in the execution device;

[0040] A device determination module is used to obtain a placement group log and a placement group log update time of a placement group device, and determine an authoritative device using the placement group log update time and the target master device;

[0041] A device determination module is used to compare the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, and determine the target execution device according to the log comparison result;

[0042] A message generating module, configured to detect that the target execution device is inconsistent with the execution device determined in advance using the device mapping information, and to generate a temporary placement group message; wherein the temporary placement group message includes the target execution device;

[0043] The device selection module is used to select a target pre-allocated device from the pre-allocated devices by using a preset hash algorithm, and to select a target execution device from the execution devices according to the temporary placement group message.

[0044] According to another aspect of the present invention, there is also provided an electronic device, comprising:

[0045] processor;

[0046] a memory for storing instructions executable by the processor;

[0047] The processor is configured to execute the instructions to implement the placement group device selection method as described above.

[0048] According to another aspect of the present invention, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the placement group device selection method as described above are implemented.

[0049] The placement group device selection method provided by the embodiment of the present invention triggers a peer process in response to the expansion of a distributed storage cluster, obtains a historical interval list of the placement group, uses the historical interval list to determine a target master device in an execution device, obtains a placement group log of the placement group device and a placement group log update time, uses the placement group log update time and the target master device to determine an authoritative device, compares the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, determines the target execution device according to the log comparison result, monitors that the target execution device is inconsistent with the execution device determined in advance using device mapping information, generates a temporary placement group message, the temporary placement group message includes the target execution device, uses a preset hash algorithm to select the target pre-allocated device from the pre-allocated device, and selects the target execution device from the execution device according to the temporary placement group message. The embodiment of the present invention optimizes the process of selecting execution devices by the placement group. When selecting an authoritative device, the master device on which the last peer process was completed is accurately selected through a historical interval list, ensuring that the target execution devices selected after the cluster is expanded this time can be evenly distributed on various cluster devices, ensuring that the masters of the execution devices are balanced after the expansion, ensuring that the data reading and writing pressures of the cluster devices are balanced, avoiding the problem that the cluster data reading and writing pressures are concentrated on some nodes, and achieving balanced distribution of the placement group devices, thereby accelerating the data reconstruction process after the expansion, reducing the time required for data recovery, effectively ensuring the security of the data, and reducing the risk of data loss or damage.

[0050] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0052] Figure 1 is a flowchart of the steps of a placement group device selection method provided by an embodiment of the present invention;

[0053] Figure 2 yes Figure 1 Flow chart of step 101 in the placement group device selection method provided by an embodiment of the present invention;

[0054] Figure 3 yes Figure 1 A flowchart of step 102 in the placement group device selection method provided in an embodiment of the present invention;

[0055] Figure 4 yes Figure 1 Flow chart of step 103 in the placement group device selection method provided by an embodiment of the present invention;

[0056] Figure 5 yes Figure 1 A flowchart of step 104 in the placement group device selection method provided by an embodiment of the present invention;

[0057] Figure 6 yes Figure 1 A flowchart of step 105 in the placement group device selection method provided by an embodiment of the present invention;

[0058] Figure 7 It is a structural schematic diagram of a placement group device selection apparatus provided by an embodiment of the present invention;

[0059] Figure 8 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0060] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0061] Reference Figure 1 , shows a flowchart of the steps of a placement group device selection method provided by an embodiment of the present invention, which is applied to a distributed storage cluster, wherein the distributed storage cluster includes a placement group, and the placement group includes a pre-allocated device and an execution device. The method may include:

[0062] Step 101 : in response to the distributed storage cluster expansion triggering a peer process, obtaining a historical interval list of a placement group, and using the historical interval list to determine a target master device in the execution device.

[0063] In an embodiment of the present invention, in order to solve the problem that the selection of concentrated execution devices in the expansion scenario causes serious imbalance in cluster read and write pressure, affecting the efficiency of data reconstruction, this embodiment triggers a peer process in a distributed storage cluster. In the process of selecting execution device members, specifically when selecting an authoritative device, the master device that completed the last triggering of the peer process is given priority as the authoritative device, and the master device that completed the peer process is obtained using a historical interval list, so that the master devices of the target execution devices are balanced after expansion, ensuring the balance of data read and write pressure, while also accelerating data reconstruction after expansion to ensure data security.

[0064] Specifically, a cluster monitor is used to monitor the addition of a new object storage device to the distributed storage cluster, triggering a peer process for selecting the device. After the peer process starts, a historical interval list of the placement group is obtained, the historical interval list is traversed, and the historical interval list that meets the preset data flag is found as the target historical interval list. The object storage device corresponding to the target historical interval list is determined as the target master device of the execution device, and the target master device information is stored.

[0065] It should be noted that when a new object storage device is detected in the distributed storage cluster, the peer process of selecting the device is triggered, and the historical interval list past_intervals list related to the placement group is obtained. The historical interval list records the historical data distribution and status changes of the placement group devices. After obtaining the historical interval list, the historical interval list is traversed in reverse to find the first past_interval with a write preset data flag of true. It should be noted that the write preset data flag of true indicates that the device in this interval must have completed the peer process, that is, the data of the device has been synchronized and consistent. In this embodiment, the historical interval list related to the placement group is used to determine the master device of the execution device at that time, and the object storage device corresponding to the target historical interval list is determined as the target master device of the execution device.

[0066] Step 102, obtaining a placement group log and a placement group log update time of a placement group device, and determining an authoritative device using the placement group log update time and the target master device.

[0067] In an embodiment of the present invention, an authoritative device is selected through the placement group log and the placement group log update time of the placement group device. The authoritative device is considered to be an object storage device with the latest and most reliable data status. Specifically, the placement group device information corresponding to the placement group device is obtained, the placement group device information is traversed, the placement group log and the placement group log update time of the placement group device are determined, the placement group log update time of the placement group devices is sorted by size, and the placement group device and the number of placement group devices corresponding to the maximum placement group log update time are determined. If the number of placement group devices corresponding to the maximum placement group log update time is one, the placement group device corresponding to the maximum placement group log update time is determined as the authoritative device. If the number of corresponding placement group devices is at least two, the stored target master device information is obtained, and the target master device is determined as the authoritative device.

[0068] It should be noted that, in the peering process of this embodiment, the initial primary object storage device is responsible for coordinating and ensuring the data consistency of all replicas. The placement group device information is the info information of all object storage devices that have participated in the placement group. The info information contains key data such as the historical data status and update timestamp of each object storage device. By traversing the info information of all osds that have participated in the placement group pg, the maximum value of the placement group log pglog, the placement group log update time last_update, is extracted, where the placement group log update time last_update represents the timestamp of the last time the osd updated the placement group log.

[0069] In this embodiment, when traversing the placement group log update time of the placement group devices, the master osd compares the last_update values ​​of all osds, sorts the placement group log update time of the placement group devices by size, determines the placement group device corresponding to the maximum placement group log update time and the number of placement group devices, if there is more than one placement group device that meets the maximum placement group log update time, the placement group device corresponding to the maximum placement group log update time is determined, so as to select the osd with the largest last_update as the authoritative osd, because the larger the placement group log update time last_update, the newer the data of the osd, and the more likely it is to have the latest data status, if there are multiple osds with the same last_update value and all are the largest, the target master device is preferentially selected as the authoritative device, where the target master device is the previously stored device that served as the master osd in the last peering process, and has higher data consistency and reliability.

[0070] Step 103 : Compare the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, and determine the target execution device according to the log comparison result.

[0071] In an embodiment of the present invention, the placement group log corresponding to the master device of the pre-allocated device is compared with the placement group log corresponding to the authoritative device, and the target execution device is determined according to the log comparison result. Specifically, if the authoritative device has been selected in the peering process, the execution device is selected to determine which OSDs will actually participate in data processing and storage. It is determined whether there is an intersection based on the placement group log corresponding to the master device in the pre-allocated device and the placement group log corresponding to the authoritative device. If there is an intersection, it means that the data status of the master device in the pre-allocated device is consistent with the authoritative device and can continue to serve as the master device. If there is no intersection, the authoritative device is selected as the target master device of the execution device to ensure data consistency and reliability.

[0072] Step 104: It is monitored that the target execution device is inconsistent with the execution device determined in advance using the device mapping information, and a temporary placement group message is generated; wherein the temporary placement group message includes the target execution device.

[0073] In the embodiment of the present invention, after selecting the target execution device, it will be verified whether these target execution devices are consistent with the pre-allocated devices and execution device members determined by the device mapping information to ensure the accuracy and consistency of data distribution. If the selected target execution device members are consistent with the execution device members calculated by osdmap, data synchronization and consistency check will continue; if it is detected that the target execution device is inconsistent with the execution device determined in advance using the device mapping information, a temporary placement group message is generated, wherein the temporary placement group message includes the target execution device, and a pgtemp message needs to be sent to the cluster monitor to send the selected target execution device member information to the cluster monitor, and notify mon of the current placement group status and the selection of the target execution device member, so that the cluster monitor can perform corresponding configuration updates.

[0074] Step 105: Select a target pre-allocated device from the pre-allocated devices using a preset hash algorithm, and select a target execution device from the execution devices according to the temporary placement group message.

[0075] In an embodiment of the present invention, after determining the target execution device, a preset hash algorithm is used to select the target pre-allocated device from the pre-allocated devices, and a target execution device is selected from the execution device according to the temporary placement group message. Specifically, the preset hash algorithm is used to select the target pre-allocated device from the pre-allocated devices, the target pre-allocated device is determined according to the device mapping information, the temporary placement group message is updated to the device mapping information, and the updated device mapping information is used to select the target execution device from the execution device.

[0076] It should be noted that the preset hash algorithm (Controlled Replication Under Scalable Hashing, CRUSH) used in this embodiment is an algorithm for data distribution and replication in a distributed storage system. It controls data replication through a scalable hash function to ensure that data is evenly distributed on the storage device while maintaining the scalability and fault tolerance of the system. The process of calculating members by the CRUSH algorithm: The CRUSH algorithm uses a pseudo-random hash function to map the data identifier to an integer in a fixed range, and uses a hierarchical selection algorithm to select the osd according to the storage policy and cluster mapping. Specifically, according to the fault domain setting in the storage policy, one or more fault domains are selected. In each selected fault domain, a specific osd is selected according to the hash value and the CRUSH rule. According to the number of copies in the storage policy, the CRUSH algorithm will repeat the above selection process, select a different osd for each copy, and ensure that the copies are distributed in different fault domains. Finally, a group of osds are output as up members, i.e., pre-allocated devices and acting members, i.e., execution devices. This embodiment does not specifically limit the selection of the target pre-allocated device in the pre-allocated device using the preset hash algorithm.

[0077] The placement group device selection method provided by the embodiment of the present invention triggers a peer process in response to the expansion of a distributed storage cluster, obtains a historical interval list of the placement group, uses the historical interval list to determine a target master device in an execution device, obtains a placement group log of the placement group device and a placement group log update time, uses the placement group log update time and the target master device to determine an authoritative device, compares the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, determines the target execution device according to the log comparison result, monitors that the target execution device is inconsistent with the execution device determined in advance using device mapping information, generates a temporary placement group message, the temporary placement group message includes the target execution device, uses a preset hash algorithm to select the target pre-allocated device from the pre-allocated device, and selects the target execution device from the execution device according to the temporary placement group message. The embodiment of the present invention optimizes the process of selecting execution devices by the placement group. When selecting an authoritative device, the master device on which the last peer process was completed is accurately selected through a historical interval list, ensuring that the target execution devices selected after the cluster is expanded this time can be evenly distributed on various cluster devices, ensuring that the masters of the execution devices are balanced after the expansion, ensuring that the data reading and writing pressures of the cluster devices are balanced, avoiding the problem that the cluster data reading and writing pressures are concentrated on some nodes, and achieving balanced distribution of the placement group devices, thereby accelerating the data reconstruction process after the expansion, reducing the time required for data recovery, effectively ensuring the security of the data, and reducing the risk of data loss or damage.

[0078] Further, see Figure 2, showing Figure 1 A flowchart of step 101 in a placement group device selection method is provided. The method is substantially the same as the placement group device selection method provided in the first embodiment of the present invention. Step 101 may include:

[0079] Step 201: It is detected that a new object storage device is added to the distributed storage cluster, triggering a peer process for selecting a device.

[0080] Step 202: In response to the peer process, obtain a historical interval list of the placement group.

[0081] Step 203, traverse the historical interval list and use the preset data mark to find the target historical interval list.

[0082] Step 204: determine the object storage device corresponding to the target history interval list as the target master device of the execution device, and store the target master device information.

[0083] In the embodiment of the present invention, when a new object storage device is detected in the distributed storage cluster, the OSD will trigger the peering process of selecting the device on the primary osd (primary osd), wherein the peering process is used to ensure the consistency of all replica data. After triggering peering, the past_intervals list of the historical interval list related to the placement group is obtained. The historical interval list records the historical data distribution and state changes of the placement group device. After obtaining the historical interval list, the list will be traversed in reverse, that is, starting from the most recent interval, backtracking to the past time point. During the traversal process, the first past_interval with a write preset data flag of true is found. It should be noted that the write preset data flag is true, which means that the peering process must have been completed during this interval, that is, the data of the device has been synchronized and consistent. In this embodiment, the historical interval list related to the placement group is used to determine the primary device of the execution device at that time, and the object storage device corresponding to the target historical interval list is determined as the target primary device of the execution device, and the information of the target primary device of the execution device is saved in the last_primary variable for quick call.

[0084] The embodiment of the present invention preferentially determines the target master device of the execution device through the historical interval list related to the placement group, optimizes the selection process of the osd member, ensures the data consistency and security in the peering process, and improves the processing efficiency and accuracy of the device selection.

[0085] Specifically, after the step of monitoring that a new object storage device is added to the distributed storage cluster and triggering a peer process for selecting a device, the step of responding to the peer process and before obtaining a historical interval list of a placement group further includes:

[0086] Update device mapping information according to the newly added object storage device of the distributed storage cluster;

[0087] Synchronize the updated device mapping information to the placement group devices.

[0088] It should be noted that in the above steps, when the distributed storage cluster needs to be expanded, that is, new object storage devices are added to the distributed storage cluster, it will trigger a change in the device mapping information osdmap, that is, the configuration mapping information of the distributed storage cluster is updated to reflect the addition of the new object storage device. The cluster monitor is responsible for managing the device mapping information osdmap, and after the device mapping information osdmap is updated, it will synchronously push the latest device mapping information to all osd nodes in the distributed storage cluster.

[0089] Further, see Figure 3 , showing Figure 1 A flowchart of step 102 in a placement group device selection method is provided. The method is substantially the same as the placement group device selection method provided in the first embodiment of the present invention. Step 102 may include:

[0090] Step 301: obtain placement group device information corresponding to a placement group device, traverse the placement group device information, and determine a placement group log of the placement group device and a placement group log update time.

[0091] It should be noted that in the peering process of this embodiment, the initial primary object storage device is responsible for coordinating and ensuring the data consistency of all replicas. To this end, it is necessary to obtain the placement group device information corresponding to the placement group device. Specifically, the placement group device information is the info information of all object storage devices that have participated in the placement group. The info information contains key data such as the historical data status and update timestamp of each object storage device, which is an important basis for selecting authoritative object storage devices. Selecting an authoritative device is a key step. The authoritative device will be responsible for coordinating subsequent data synchronization and recovery operations. By traversing the info information of all osds that have participated in the placement group pg, the maximum value of the placement group log pglog, the placement group log update time last_update, is extracted from each info information, where last_update represents the timestamp of the last time the osd updated the placement group log.

[0092] Step 302: sort the placement group log update times of the placement group devices by size, and determine the placement group device and the number of placement group devices corresponding to the maximum placement group log update time.

[0093] In this embodiment, when traversing the placement group log update time of the placement group devices, the main osd compares the last_update values ​​of all osds, sorts the placement group log update time of the placement group devices by size, determines the placement group device corresponding to the maximum placement group log update time and the number of placement group devices, if there is more than one placement group device that meets the maximum placement group log update time, the placement group device corresponding to the maximum placement group log update time is determined, so as to select the osd with the largest last_update as the authoritative osd, because the larger the placement group log update time last_update, the newer the data of the osd, and the more likely it is to have the latest data status.

[0094] Step 303: If the number of placement group devices corresponding to the maximum placement group log update time is one, determine the placement group device corresponding to the maximum placement group log update time as the authoritative device.

[0095] Step 304: If the number of placement group devices corresponding to the maximum placement group log update time is at least two, obtain the stored target master device information, and determine the target master device as an authoritative device.

[0096] It should be noted that, in an embodiment of the present invention, if the number of placement group devices corresponding to the maximum placement group log update time is one, the placement group device corresponding to the maximum placement group log update time is determined as the authoritative device; if the number of placement group devices corresponding to the maximum placement group log update time is at least two, the stored target master device information is obtained, and the target master device is determined as the authoritative device. Specifically, if there are multiple osds with the same last_update value and all are the largest, the target master device in last_primary is preferentially selected as the authoritative device, wherein last_primary is the previously recorded device that served as the main osd in the last peering process, and has higher data consistency and reliability; if last_primary is not in the candidate list, or there is no last_primary record, the first eligible osd will be selected as the authoritative device in the traversal order.

[0097] The embodiment of the present invention ensures that the most reliable and up-to-date data source is used in the peering process by selecting an authoritative OSD strategy, while taking into account the historical status and accurate records of the placement group, and utilizing the placement group log update time to preferentially select the device that served as the main OSD in the last peering process as the authoritative device, thereby improving data consistency.

[0098] Further, see Figure 4 , showing Figure 1 A flowchart of step 103 in a placement group device selection method is provided. The method is substantially the same as the placement group device selection method provided in the first embodiment of the present invention. Step 103 may include:

[0099] Step 401: pre-select a master device from among the pre-allocated devices.

[0100] It should be noted that in this embodiment, the master device in the pre-allocated device is selected using a preset hash algorithm. Please refer to the aforementioned process of selecting a device in the pre-allocated device using the preset hash algorithm. This embodiment does not specifically limit the master device of the pre-allocated device.

[0101] Step 402: Obtain the placement group log corresponding to the master device in the pre-allocated device and the placement group log corresponding to the authoritative device.

[0102] Step 403: Obtain the placement group log corresponding to the master device in the pre-allocated device and the placement group log corresponding to the authoritative device.

[0103] Step 404: If there is no intersection between the placement group logs, the authoritative device is determined as the target master device of the execution device.

[0104] Step 405 , selecting a target execution device from the placement group devices according to the target master device of the execution device and the preset number of placement group replicas; wherein the total number of the target execution devices is consistent with the preset number of placement group replicas.

[0105] In the embodiment of the present invention, an authoritative device has been selected according to the info information and the last_update value during the peering process. The authoritative device is considered to be the object storage device with the latest and most reliable data status. After the determination, the execution device is selected to determine which osds will actually participate in data processing and storage. The determination is based on whether there is an intersection between the placement group log corresponding to the master device in the pre-allocated device and the placement group log corresponding to the authoritative device. If there is an intersection, it means that the data status of the master device in the pre-allocated device is consistent with the authoritative device and can continue to serve as the master device. If there is no intersection, the authoritative device is selected as the target master device of the execution device to ensure data consistency and reliability.

[0106] It should be noted that after the target master device of the execution device is successfully selected, the target execution device will be selected from the remaining pre-allocated device members, execution device members and all_info in the placement group device in turn until the number of selected target execution device members is equal to the preset number of placement group replicas of the placement group. During the selection process, the data status, availability and load of each osd will be considered to ensure that the selected osd can effectively process data and maintain the high performance and stability of the system. Among them, this embodiment does not specifically limit the number of placement group replicas of the placement group, which can be set according to the cluster data storage requirements.

[0107] The embodiment of the present invention ensures the use of the most appropriate and reliable OSD during data processing and storage by selecting the target master device of the execution device and the strategy of the target execution device, thereby improving data consistency and system stability, making data distribution and processing more efficient and reliable.

[0108] Further, see Figure 5 , showing Figure 1 A flowchart of step 104 in a placement group device selection method is provided. The method is substantially the same as the placement group device selection method provided in the first embodiment of the present invention. Step 104 may include:

[0109] Step 501, using device mapping information to determine pre-allocated devices and execution devices in a placement group device in advance;

[0110] In an embodiment of the present invention, when the placement group device in the distributed storage cluster receives updated device mapping information, it calculates the pre-allocated device and the execution device based on the latest device mapping information. Normally, the selection process of the pre-allocated device (the currently active object storage device) and the execution device (the object storage device responsible for data processing) is the same, and both are calculated by the CRUSH algorithm to ensure uniform distribution of data and load balancing.

[0111] Step 502, comparing the target execution device with the execution devices in the placement group device to determine whether the target execution device is consistent with the execution device;

[0112] Step 503: If they are inconsistent, a temporary placement group message is generated, and the temporary placement group message is used to send the target execution device to the cluster monitor.

[0113] In an embodiment of the present invention, after selecting the target execution device, it will be verified whether these target execution devices are consistent with the pre-allocated devices and execution device members determined by the device mapping information to ensure the accuracy and consistency of data distribution. If the selected target execution device members are consistent with the execution device members calculated by osdmap, the next step of peering will be continued, that is, data synchronization and consistency check; if they are inconsistent, it is necessary to send a pgtemp message to the cluster monitor, send the selected target execution device member information to the cluster monitor, and notify mon of the current state of the placement group and the selection of the target execution device members, so that the cluster monitor can perform corresponding configuration updates. For the expansion scenario, due to the addition of new osds, the selection of the target execution devices of most placement groups may be inconsistent with the execution device members calculated by osdmap, so the process of sending pgtemp will be followed. After sending the pgtemp message, this peering process is terminated and the new osdmap push will be waited for to obtain the latest configuration information.

[0114] The embodiment of the present invention optimizes the selection of device members and data distribution, and uses pgtemp information to ensure data consistency and security during the peering process. At the same time, the selection of devices is suitable for capacity expansion scenarios and can effectively handle configuration changes and data distribution adjustments brought about by the addition of new OSDs.

[0115] Further, see Figure 6 , showing Figure 1 A flowchart of step 105 in a placement group device selection method is provided. The method is substantially the same as the placement group device selection method provided in the first embodiment of the present invention. Step 105 may include:

[0116] Step 601: Select a target pre-allocated device from the pre-allocated devices using a preset hash algorithm; wherein the target pre-allocated device is determined according to device mapping information.

[0117] Step 602: Update the temporary placement group message to the device mapping information.

[0118] Step 603: Select a target execution device from the execution devices using the updated device mapping information.

[0119] In an embodiment of the present invention, after the cluster monitor receives a temporary placement group message, i.e., a pgtemp message, it generates pgtemp in the current osdmap, that is, updates the temporary placement group message to the device mapping information, records the temporary status of the current placement group and the execution device member information, and pushes the updated device mapping information osdmap to all devices so as to adjust according to the latest configuration information. When the device receives the updated osdmap, it will restart the calculation of the target pre-allocated device members and target execution devices of the placement group. At this time, the target pre-allocated device is still a member calculated according to the preset hash algorithm CRUSH algorithm, and the target execution device is obtained from the temporary placement group message pgtemp to ensure that it is consistent with the status recorded by the cluster monitor. After recalculating the device members, the triggering of peering will be performed on the master osd of the target execution device. The master osd will be responsible for coordinating data synchronization and consistency checks to ensure that the data status of all replicas is consistent.

[0120] The embodiment of the present invention optimizes the distribution of execution devices after cluster expansion, ensuring balanced data distribution. The load of data access and processing is evenly distributed to the execution devices, reducing the impact of expansion on data services, greatly improving the efficiency of data reconstruction, and enabling the cluster to return to a normal state more quickly, thereby improving data security.

[0121] In some embodiments, after detecting an osd failure, the cluster will start a recovery process, use the target execution device information to quickly locate the data state of the failed osd, and determine the number of WAL objects to be replayed based on the target execution device information. In the aggregated append write architecture, data is written to the storage system in an appended manner, and WAL is used to record all write operations to ensure data persistence and consistency. When an osd fails, data needs to be quickly restored and business continuity is ensured. This embodiment can use the accuracy of last_primary to quickly locate the execution device where peering was completed last time, thereby reducing the number of WAL objects that need to be replayed during the fault recovery process. Reducing this operation can release more load resources for other tasks. At the same time, reducing the amount of WAL playback also shortens the fault recovery time.

[0122] Reference Figure 7 , shows a schematic diagram of the structure of a placement group device selection device provided by an embodiment of the present invention, which is applied to a distributed storage cluster, wherein the distributed storage cluster includes a placement group, and the placement group includes a pre-allocation device and an execution device, wherein the device includes:

[0123] An information acquisition module 701 is used to acquire a historical interval list of a placement group in response to the distributed storage cluster expansion triggering a peer process, and use the historical interval list to determine a target master device in the execution device;

[0124] A first determination module 702 is used to obtain a placement group log and a placement group log update time of a placement group device, and determine an authoritative device using the placement group log update time and the target master device;

[0125] The second device determination module 703 is used to compare the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, and determine the target execution device according to the log comparison result;

[0126] A message generating module 704 is used to detect that the target execution device is inconsistent with the execution device determined in advance using the device mapping information, and generate a temporary placement group message; wherein the temporary placement group message includes the target execution device;

[0127] The device selection module 705 is used to select a target pre-allocated device from the pre-allocated devices by using a preset hash algorithm, and to select a target execution device from the execution devices according to the temporary placement group message.

[0128] Furthermore, the information acquisition module 701 includes:

[0129] A monitoring submodule, used to monitor the newly added object storage device in the distributed storage cluster and trigger a peer-to-peer process for selecting the device;

[0130] A first acquisition submodule, configured to acquire a historical interval list of a placement group in response to the peer process;

[0131] A search submodule, used to traverse the historical interval list and use a preset data mark to find a target historical interval list;

[0132] The storage submodule is used to determine the object storage device corresponding to the target history interval list as the target main device of the execution device, and store the target main device information.

[0133] Furthermore, the information acquisition module 701 further includes:

[0134] A first updating submodule, configured to update device mapping information according to a newly added object storage device in the distributed storage cluster;

[0135] The synchronization submodule is used to synchronize the updated device mapping information to the placement group devices.

[0136] Furthermore, the first determining module 702 includes:

[0137] A second acquisition submodule is used to acquire placement group device information corresponding to the placement group device, traverse the placement group device information, and determine the placement group log of the placement group device and the placement group log update time;

[0138] A sorting submodule, used to sort the placement group log update time of the placement group devices by size, and determine the placement group device and the number of placement group devices corresponding to the maximum placement group log update time;

[0139] A first determination submodule is configured to determine the placement group device corresponding to the maximum placement group log update time as an authoritative device if the number of placement group devices corresponding to the maximum placement group log update time is one;

[0140] The second determination submodule is configured to obtain stored target master device information and determine the target master device as an authoritative device if the number of placement group devices corresponding to the maximum placement group log update time is at least two.

[0141] Furthermore, the second determining module 703 includes:

[0142] A pre-selection submodule, used for pre-selecting a master device among the pre-allocated devices;

[0143] A third acquisition submodule is used to obtain the placement group log corresponding to the master device in the pre-allocated device and the placement group log corresponding to the authoritative device;

[0144] A comparison submodule is used to obtain the placement group log corresponding to the master device in the pre-allocated device and the placement group log corresponding to the authoritative device;

[0145] A third determination submodule is used to determine the authoritative device as the target master device of the execution device if there is no intersection between the placement group logs;

[0146] A selection submodule is used to select a target execution device from the placement group devices according to a target master device of the execution device and a preset number of placement group replicas; wherein the total number of the target execution devices is consistent with the preset number of placement group replicas.

[0147] Furthermore, the message generating module 704 includes:

[0148] A pre-determination submodule, used to pre-determine a pre-allocated device and an execution device in a placement group device using device mapping information;

[0149] A judgment submodule, used for comparing the target execution device with the execution device in the placement group device to judge whether the target execution device is consistent with the execution device;

[0150] The generating submodule is used to generate a temporary placement group message if there is inconsistency, and the temporary placement group message is used to send the target execution device to the cluster monitor.

[0151] Furthermore, the device selection module 705 includes:

[0152] A first selection submodule is used to select a target pre-allocated device from the pre-allocated devices by using a preset hash algorithm; wherein the target pre-allocated device is determined according to the device mapping information;

[0153] A second updating submodule, configured to update the temporary placement group message to the device mapping information;

[0154] The second selection submodule is used to select a target execution device from the execution devices using the updated device mapping information.

[0155] The placement group device selection device provided by the embodiment of the present invention triggers a peer process in response to the expansion of a distributed storage cluster, obtains a historical interval list of the placement group, uses the historical interval list to determine a target master device in an execution device, obtains a placement group log of the placement group device and a placement group log update time, uses the placement group log update time and the target master device to determine an authoritative device, compares the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, determines the target execution device according to the log comparison result, monitors that the target execution device is inconsistent with the execution device determined in advance using device mapping information, generates a temporary placement group message, the temporary placement group message includes the target execution device, uses a preset hash algorithm to select the target pre-allocated device from the pre-allocated device, and selects the target execution device from the execution device according to the temporary placement group message. The embodiment of the present invention optimizes the process of selecting execution devices by the placement group. When selecting an authoritative device, the master device on which the last peer process was completed is accurately selected through a historical interval list, ensuring that the target execution devices selected after the cluster is expanded this time can be evenly distributed on various cluster devices, ensuring that the masters of the execution devices are balanced after the expansion, ensuring that the data reading and writing pressures of the cluster devices are balanced, avoiding the problem that the cluster data reading and writing pressures are concentrated on some nodes, and achieving balanced distribution of the placement group devices, thereby accelerating the data reconstruction process after the expansion, reducing the time required for data recovery, effectively ensuring the security of the data, and reducing the risk of data loss or damage.

[0156] Reference Figure 8 , an embodiment of the present invention further provides an electronic device, such as Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.

[0157] Memory 803, used for storing computer programs;

[0158] The processor 801 is used to execute the program stored in the memory 803, and implements the following steps:

[0159] In response to the distributed storage cluster expansion triggering a peer process, obtaining a historical interval list of a placement group, and using the historical interval list to determine a target master device in the execution device;

[0160] Obtain a placement group log and a placement group log update time of a placement group device, and determine an authoritative device using the placement group log update time and the target master device;

[0161] Compare the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, and determine the target execution device according to the log comparison result;

[0162] It is detected that the target execution device is inconsistent with the execution device determined in advance using the device mapping information, and a temporary placement group message is generated; wherein the temporary placement group message includes the target execution device;

[0163] A preset hash algorithm is used to select a target pre-allocated device from the pre-allocated devices, and a target execution device is selected from the execution devices according to the temporary placement group message.

[0164] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0165] The communication interface is used for communication between the above terminal and other devices.

[0166] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0167] The above-mentioned 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, discrete hardware components.

[0168] In another embodiment of the present invention, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes the placement group device selection method described in any of the above embodiments.

[0169] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0170] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0171] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0172] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for selecting a placement group device, characterized in that: Applied to a distributed storage cluster, the distributed storage cluster includes a placement group, the placement group includes a pre-allocation device and an execution device, the method includes: In response to the distributed storage cluster expansion triggering a peer process, obtaining a historical interval list of a placement group, and using the historical interval list to determine a target master device in the execution device; Obtain a placement group log and a placement group log update time of a placement group device, and determine an authoritative device using the placement group log update time and the target master device; Compare the placement group log corresponding to the master device in the pre-allocated device with the placement group log corresponding to the authoritative device, and determine the target execution device according to the log comparison result; It is detected that the target execution device is inconsistent with the execution device determined in advance using the device mapping information, and a temporary placement group message is generated; wherein the temporary placement group message includes the target execution device; A preset hash algorithm is used to select a target pre-allocated device from the pre-allocated devices, and a target execution device is selected from the execution devices according to the temporary placement group message.

2. The method according to claim 1, characterized in that The step of triggering a peer-to-peer process in response to the distributed storage cluster expansion, acquiring a historical interval list of a placement group, and using the historical interval list to determine a target master device in the execution device includes: A new object storage device is detected in the distributed storage cluster, triggering a peer-to-peer process for selecting the device; Responsive to the peer process, obtaining a list of historical intervals for a placement group; Traversing the historical interval list, and using a preset data flag to find a target historical interval list; The object storage device corresponding to the target history interval list is determined as the target master device of the execution device, and the target master device information is stored.

3. The method according to claim 2, characterized in that After the distributed storage cluster is detected to have a new object storage device added, triggering a peer process for selecting a device, and before the historical interval list of a placement group is obtained in response to the peer process, the method further includes: Update device mapping information according to the newly added object storage device of the distributed storage cluster; Synchronize the updated device mapping information to the placement group devices.

4. The method according to claim 1, characterized in that: The step of obtaining a placement group log and a placement group log update time of a placement group device, and determining an authoritative device using the placement group log update time and the target master device, comprises: Obtain placement group device information corresponding to the placement group device, traverse the placement group device information, and determine the placement group log of the placement group device and the placement group log update time; Sort the placement group log update times of the placement group devices by size, and determine the placement group device and the number of placement group devices corresponding to the maximum placement group log update time; If the number of placement group devices corresponding to the maximum placement group log update time is one, determine the placement group device corresponding to the maximum placement group log update time as the authoritative device; If the number of placement group devices corresponding to the maximum placement group log update time is at least two, the stored target master device information is obtained, and the target master device is determined as an authoritative device.

5. The method according to claim 1, characterized in that The step of comparing the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, and determining the target execution device according to the log comparison result, includes: preselecting a master device from among the pre-allocated devices; Obtain the placement group log corresponding to the master device in the pre-allocated device and the placement group log corresponding to the authoritative device; Compare the placement group log corresponding to the master device in the pre-allocated device with the placement group log corresponding to the authoritative device to generate a log comparison result, and determine whether there is an intersection between the placement group logs according to the log comparison result; If there is no intersection between the placement group logs, determining the authoritative device as the target master device of the execution device; According to the target master device of the execution device and the preset number of placement group replicas, a target execution device is selected from the placement group devices; wherein the total number of the target execution devices is consistent with the preset number of placement group replicas.

6. The method according to claim 1, characterized in that The monitoring that the target execution device is inconsistent with the execution device determined in advance using the device mapping information generates a temporary placement group message; wherein the temporary placement group message includes the target execution device, including: Pre-determining the pre-allocated devices and the execution devices in the placement group devices by using the device mapping information in advance; Comparing the target execution device with the execution device in the placement group device to determine whether the target execution device is consistent with the execution device; If they are inconsistent, a temporary placement group message is generated, and the temporary placement group message is used to send the target execution device to the cluster monitor.

7. The method according to claim 1, characterized in that The method of selecting a target pre-allocated device from the pre-allocated devices by using a preset hash algorithm, and selecting a target execution device according to the temporary placement group message, includes: A preset hash algorithm is used to select a target pre-allocated device from the pre-allocated devices; wherein the target pre-allocated device is determined according to the device mapping information; Updating the temporary placement group message to the device mapping information; The updated device mapping information is used to select a target execution device from the execution devices.

8. A device for selecting a placement group device, characterized in that: Applied to a distributed storage cluster, the distributed storage cluster includes a placement group, the placement group includes a pre-allocation device and an execution device, the apparatus includes: An information acquisition module, configured to acquire a historical interval list of a placement group in response to the distributed storage cluster expansion triggering a peer process, and use the historical interval list to determine a target master device in the execution device; A first determination module is used to obtain a placement group log and a placement group log update time of a placement group device, and determine an authoritative device using the placement group log update time and the target master device; A second determination module is used to compare the placement group log corresponding to the master device of the pre-allocated device with the placement group log corresponding to the authoritative device, and determine the target execution device according to the log comparison result; A message generating module, configured to detect that the target execution device is inconsistent with the execution device determined in advance using the device mapping information, and to generate a temporary placement group message; wherein the temporary placement group message includes the target execution device; The device selection module is used to select a target pre-allocated device from the pre-allocated devices by using a preset hash algorithm, and to select a target execution device from the execution devices according to the temporary placement group message.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the instructions to implement the placement group device selection method according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the placement group device selection method according to any one of claims 1 to 7 is implemented.