Copy storage method, device, storage medium and computer equipment
By introducing virtual fault subdomains and fault range adjustment technologies into distributed file systems, the impact of storage node failure on system availability is solved, and higher availability and reliability are achieved.
Patent Information
- Application Number
- CN202110948791.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-18
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-08-18
AI Technical Summary
When the existing distributed file system fails in storage nodes, the migration strategy is not flexible enough, which affects the reliability and availability of the system and cannot effectively avoid the impact of failure on read and write services.
By introducing virtual fault subdomains into the distributed file system, determining the fault range and adjusting the replica storage method according to the fault range, to ensure the fully available state of the target data shards and avoiding the impact of storage node failure on read and write services.
Improve the availability and reliability of the distributed file system, ensure that the state of data sharding is fully available when the storage node fails, and avoids the impact on read and write services.
Smart Images

Figure CN113742309B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a copy storage method, device, storage medium and computer equipment. Background Art
[0002] In a distributed file system, files are stored in each storage node of the distributed file system in the form of data shards. To ensure the reliability of the distributed file system, each data shard is stored in different storage nodes in the form of multiple copies, and these different storage nodes belong to different fault domains. Fault domains are divided storage areas. The purpose of dividing fault domains is to avoid that when a storage area fails, all the same copies stored in the storage area will be affected. Usually, the same copies are stored in different fault domains.
[0003] When a storage node to which a copy of a data shard belongs fails, in order to ensure normal read and write services for the data shard, the copy stored on the storage node needs to be stored on another normal storage node. The existing solution for replica storage when a storage node fails can usually only be migrated within the fault domain. The migration strategy is not flexible enough, which affects the reliability and availability of the distributed file system. Summary of the invention
[0004] The embodiment of the present application provides a replica storage method, device, storage medium and computer equipment, which are applied to a distributed file system, wherein the distributed file system includes multiple fault domains, each of which includes at least one virtual fault subdomain, each of which includes multiple storage nodes, and a virtual fault subdomain with the same number of replicas as the target data shard is selected from the at least one virtual fault subdomain to obtain at least one fault group, and the replica of the target data shard is stored in a target fault group in the at least one fault group. The technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a replica storage method, the method being applied to a computer device, the method comprising:
[0006] If at least one storage node storing the replica in the target failure group fails, determining the covered failure range;
[0007] Based on the failure scope, the storage manner of the replica in the target failure group is adjusted to make the state of the target data shard fully available.
[0008] In a second aspect, an embodiment of the present application provides a replica storage device, the replica storage device comprising:
[0009] A fault range determination module, configured to determine a covered fault range if at least one storage node storing the replica in the target fault group fails;
[0010] The replica adjustment module is used to adjust the storage method of the replica in the target fault group based on the fault scope so that the state of the target data shard is fully available.
[0011] In a third aspect, an embodiment of the present application provides a storage medium, wherein the storage medium stores at least one instruction, and the at least one instruction is suitable for being loaded by a processor and executing the above-mentioned method steps.
[0012] In a fourth aspect, an embodiment of the present application provides a computer device, which may include: a processor and a memory; wherein the memory stores at least one instruction, and the at least one instruction is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0013] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0014] By adopting the replica storage method provided in the embodiment of the present application, when at least one storage node storing a replica in a target fault group of a distributed file system fails, the covered fault range is first determined, and based on the fault range, the storage method of the replica in the target fault group is adjusted to make the state of the target data shard fully available, thereby avoiding the impact of the storage node failure on the read and write services of the distributed file system and ensuring the availability and reliability of the distributed file system. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 A schematic diagram of the architecture of a distributed file system in the prior art;
[0017] Figure 2 A system architecture of a distributed file system provided in an embodiment of the present application;
[0018] Figure 3 A flowchart of a replica storage method provided in an embodiment of the present application;
[0019] Figure 4 A flowchart of a replica storage method provided in an embodiment of the present application;
[0020] Figure 5 An example schematic diagram of a replica migration provided in an embodiment of the present application;
[0021] Figure 6 A flowchart of a replica storage method provided in an embodiment of the present application;
[0022] Figure 7 An example schematic diagram of allocating temporary data slices provided in an embodiment of the present application;
[0023] Figure 8 A flowchart of a replica storage method provided for another exemplary embodiment of the present application;
[0024] Fig. 9 A flowchart of a replica storage method provided for another exemplary embodiment of the present application;
[0025] Fig.10 A schematic diagram of a replica storage device provided in an embodiment of the present application
[0026] Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0028] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.
[0029] In order to more clearly describe the technical solution of the embodiment of the present invention, some concepts in the present invention are described in detail before the description to facilitate a better understanding of the solution.
[0030] Distributed file system (DFS): A distributed file system refers to a file system that manages physical storage resources that are not necessarily directly connected to a local node, but are connected to a node (which can be simply understood as a computer) through a computer network. The design of a distributed file system is based on the client / server model. A typical network may include multiple servers for multiple users to access.
[0031] Fault domain (ZONE): An isolated area where copies of a data shard are stored. For a data shard, each fault domain can only store one copy of the data shard.
[0032] Storage node: a data storage node that stores business file data. An object storage device can be regarded as a storage node.
[0033] Virtual fault subdomain (node set): A collection of storage nodes. Multiple object storage devices form a virtual fault subdomain. A fault domain can include multiple virtual fault subdomains.
[0034] Fault group: Several virtual fault subdomains located in different fault domains form a fault group.
[0035] The original file system was only for local data services within the local area network. With the advent of the information age, the data obtained by users has increased exponentially. The method of simply increasing the number of hard disks to expand the storage capacity of the file system has fared poorly in terms of capacity size, capacity growth rate, data backup, and data security. Therefore, the distributed file system came into being, and the distributed file system expanded the service scope to the entire network. It not only changed the way data is stored and managed, but also has advantages such as data backup and data security that the local file system cannot have.
[0036] A distributed file system refers to a file system that manages physical storage resources that are not necessarily directly linked to local nodes, but are connected to nodes through a computer network. The design of a distributed file system is based on the client / server model. A typical network may include multiple servers for multi-user access. A distributed file system can effectively solve the problem of data storage and management: a file system fixed to a certain location is expanded to any number of locations / multiple file systems, and a large number of storage nodes form a file system network. Each storage node can be distributed in different locations, and communication and data transmission between storage nodes are carried out through the network. When using a distributed file system, users do not need to worry about which storage node the data is stored on or from which storage node it is obtained. They only need to manage and store the data in the file system like using a local file system.
[0037] When the amount of data in a single file is too large, there is a problem that a single storage node cannot store it. Therefore, in a distributed file system, the entire file is cut into multiple small data fragments, and the multiple small data fragments are stored on different storage nodes. In order to ensure the high reliability of the distributed file system, a redundant method is used to store data fragments, that is, multiple copies of each data fragment are stored on different storage nodes, and the storage nodes where the multiple copies of each data fragment are stored are isolated according to the set fault domain, ensuring that the distributed file system has better availability and reliability. The fault domain is an artificially divided storage area. The purpose of dividing the fault domain is to avoid that when a storage area fails, the same copy data stored in the area will be affected. Therefore, storing the same copy data in different fault domains can effectively improve the availability and reliability of the distributed file system.
[0038] Therefore, the architecture of a distributed file system is as follows: a distributed file system includes multiple fault domains, each fault domain includes multiple storage nodes, and each storage node stores multiple copies of data shards. The fault domain can be specifically divided according to the system scale and security level of the distributed file system. For example, a data center can be used as a fault domain, a computer room can be used as a fault domain, a rack can be used as a fault domain, etc. The storage node can be regarded as an object storage device. See Figure 1 , Figure 1 FIG. 1 is a schematic diagram of the architecture of a distributed file system in the prior art. Figure 1 As shown, in Figure 1 The number of copies of each data shard in the distributed file system shown is three. Figure 1 The distributed file system shown includes three computer rooms, one computer room is a fault domain, each computer room includes multiple object storage devices, each object storage device is a storage node, that is, three object storage devices storing three copies of a data shard are located in different computer rooms.
[0039] In a distributed file system, the probability of losing all copies of a data shard is usually used as a basis for judging the reliability of the distributed file system. The probability formula for losing R copies of a data shard is known to be: Where R represents the number of replicas, P r It represents the probability that the R storage nodes storing the R copies fail at the same time, N represents the number of storage nodes in the distributed file system, and M represents the number of allocations of the R copies of a data shard in the distributed file system.
[0040] Based on this, a new distributed file system architecture is further proposed, wherein the distributed file system includes multiple fault domains, each of which includes at least one virtual fault subdomain, each of which includes multiple storage nodes, and virtual fault subdomains with the same number of copies as the target data shard are selected from the at least one virtual fault subdomain to obtain at least one fault group, and the copies of the target data shard are stored in the target fault group in the at least one fault group. Figure 2 , Figure 2 A system architecture of a distributed file system provided in an embodiment of the present application.
[0041] like Figure 2As shown, the distributed file system includes four computer rooms, each of which includes three object storage device sets, each of which includes eight object storage devices, that is, each computer room is regarded as a fault domain, the object storage device set in each computer room is regarded as a virtual fault subdomain, the object storage device in each storage device set is a storage node, and a virtual fault subdomain is selected from each fault domain to form a fault group, and three copies of a data shard are respectively stored on any storage node in the three virtual fault subdomains in a fault group. Figure 2 The distributed file system shown is divided into small virtual fault subdomains based on the first-level fault domain, which reduces the value of M in the probability formula of losing R copies of a data shard, that is, reduces the probability of losing R copies of a data shard in the distributed file system, and improves the reliability of the distributed file system.
[0042] This application is in Figure 2 Based on the architecture of the distributed file system shown in the figure, a replica storage method is proposed. When a storage node fails, the fault scope is first determined, and then the storage method of the replica in the fault group is adjusted according to the fault scope to avoid the fault from affecting the normal read and write services of the distributed file system, thereby fully ensuring the availability and reliability of the distributed file system.
[0043] The following is a detailed description in conjunction with specific embodiments. For ease of explanation, the following embodiments are all described by taking the computer device as a smart phone as an example. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. The flowcharts shown in the accompanying drawings are only exemplary and do not have to be executed according to the steps shown. For example, some steps are parallel and there is no strict logical order, so the actual execution order is variable.
[0044] See also Figure 3 , is a flow chart of a replica storage method provided by an embodiment of the present application. The replica storage method is applied to a distributed file system, the distributed file system includes multiple fault domains, each of the fault domains includes at least one virtual fault subdomain, each of the virtual fault subdomains includes multiple storage nodes, and a virtual fault subdomain with the same number of replicas as the target data shard is selected from the at least one virtual fault subdomain to obtain at least one fault group, and the replica of the target data shard is stored in the target fault group in the at least one fault group. Figure 3 As shown, the replica storage method may include the following steps S101-S102.
[0045] S101, if at least one storage node storing a replica in a target failure group fails, determine the covered failure range;
[0046] Specifically, a heartbeat detection mechanism is used to detect in real time whether a fault occurs in the distributed file system. When a storage node is detected to have a fault, the fault scope of the current fault is determined. The fault scope may be a single storage node failure, multiple storage nodes failure, a virtual fault subdomain failure, or multiple virtual fault subdomain failures in the target fault group.
[0047] The failure of the single storage node may be the failure of any storage node in any virtual fault subdomain in the target fault group; the failure of multiple storage nodes may be the failure of multiple storage nodes in one or several virtual fault subdomains in the target fault group; the failure of a virtual fault subdomain may be the failure of all storage nodes in the virtual fault subdomain or the failure of the fault domain where the virtual fault subdomain is located. For example, in a distributed file system where the fault domain is a computer room, the virtual fault subdomain may be a rack in the computer room, then a failure of the virtual fault subdomain means a failure of a rack in the computer room or a failure of the entire computer room; the failure of multiple virtual fault subdomains may be the failure of the fault domains corresponding to the multiple virtual fault subdomains. In a distributed file system where the fault domain is a computer room and the virtual fault subdomain is a rack in the computer room, that is, multiple computer rooms fail.
[0048] S102, based on the fault scope, adjusting the storage method of the replica in the target fault group so that the state of the target data shard is fully available;
[0049] Specifically, the storage method of the replica in the target fault group is adjusted in different ways according to the fault scope, so that the state of the target data shard is fully available. The target data shard is a general concept, which does not only represent a certain data shard in the distributed file system, but can generally refer to any data shard in the distributed file system. In the embodiment of the present application, the target data shard refers to the data shard corresponding to the replica stored on the failed storage node. If the fault scope is a single storage node failure or multiple storage nodes failure in the target fault group, the replica stored on the failed storage node is stored in the non-failed storage node in the virtual fault subdomain; if the fault scope is a partial virtual fault subdomain failure in the target fault group, the target data shard has a replica lost, and some services of the target data shard are affected, which is not in a fully available state, then a temporary data shard is reallocated, and a copy of the temporary data shard is stored in a non-failed virtual fault subdomain in the target fault group, and the temporary data shard is used to replace the affected service of the target data shard.
[0050] In a possible implementation, if the fault range is that a storage node in a virtual fault subdomain within the target fault group fails, a copy of the target data shard stored in the failed storage node is stored in a normal storage node that has not failed within the virtual fault subdomain.
[0051] In one possible implementation, if the fault range is a virtual fault subdomain within the target fault group, a temporary data shard is reallocated, and a copy of the temporary data shard is stored in a virtual fault subdomain in the target fault group where no fault has occurred. The temporary data shard is used to take over the affected service function of the target data shard.
[0052] In an embodiment of the present application, when at least one storage node storing a replica in a target fault group of a distributed file system fails, the covered fault range is first determined, and based on the fault range, the storage method of the replica in the target fault group is adjusted to make the state of the target data shard fully available, thereby avoiding the impact of the storage node failure on the read and write services of the distributed file system, and ensuring the availability and reliability of the distributed file system.
[0053] In one embodiment, the number of replica configurations of the distributed file system may be 3. The following embodiment focuses on a replica storage method when a storage node fails when the number of replica configurations is 3.
[0054] See also Figure 4 , is a flow chart of a replica storage method provided by an embodiment of the present application. The replica storage method is applied to a distributed file system, the distributed file system includes multiple fault domains, each of the fault domains includes at least one virtual fault subdomain, each of the virtual fault subdomains includes multiple storage nodes, and a virtual fault subdomain with the same number of replicas as the target data shard is selected from the at least one virtual fault subdomain to obtain at least one fault group, and the replica of the target data shard is stored in the target fault group in the at least one fault group. Figure 4 As shown, the replica storage method may include the following steps.
[0055] S201, if at least one storage node storing a replica in a target failure group fails, determine the covered failure range;
[0056] Specifically, a heartbeat detection mechanism is used to detect in real time whether a fault occurs in the distributed file system. When a storage node is detected to have a fault, the fault scope of the current fault is determined. The fault scope may be a single storage node failure, multiple storage nodes failure, a virtual fault subdomain failure, or multiple virtual fault subdomain failures in the target fault group.
[0057] The heartbeat detection mechanism sends heartbeat messages to each storage node in the virtual fault subdomain of each fault domain of the distributed file system in real time. If a message reply can be received, it proves that the storage node that replies to the message has not failed. If no message reply is received, it proves that the storage node that did not reply to the message has failed.
[0058] S202, if the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, then the replicas stored on the failed storage nodes are stored in the non-failed storage nodes in the virtual fault subdomain, and some storage nodes include storage nodes storing replicas;
[0059] Specifically, when the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, the replicas stored on the failed storage nodes are stored in the non-failed storage nodes in the same virtual fault subdomain.
[0060] In a distributed file system with a replica configuration of 3, the target fault group includes three virtual fault subdomains, and the failure of some storage nodes in the virtual fault subdomains in the target fault group may be the failure of one or more storage nodes in one of the virtual fault subdomains of the target fault group, or one or more storage nodes in two virtual fault subdomains in the target fault group respectively fail, or one or more storage nodes in three virtual fault subdomains in the target fault group respectively fail. As can be seen from the foregoing, three copies of a target data shard are stored in the three virtual fault subdomains of the target fault group, and one of the storage nodes in each virtual fault subdomain stores a copy of the target data shard. Then the failure of some storage nodes in the virtual fault subdomains in the target fault group may correspond to the three situations in which the copies of the target data shards are lost, which may correspond to steps S2021 to S2023.
[0061] S2021, if the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, and the some storage nodes include a storage node storing a replica, then adjust the state of the target data shard to a first partially available state, where the first partially available state includes allowing only reading and overwriting;
[0062] Specifically, if the part of the storage nodes includes a storage node that stores the replica, the number of lost replicas of the target data shard is 1. Since the number of replicas of the target data shard does not meet the preset replica configuration quantity, the original replica configuration quantity is 3, and the current number of available replicas is 2, the state of the target data shard is adjusted to the first partially available state, and the first partially available state includes only allowing reading and overwriting.
[0063] S2022, if the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, and the some storage nodes include storage nodes storing two copies, then adjust the state of the target data shard to a second partially available state, where the second partially available state includes allowing only reading;
[0064] Specifically, if the part of the storage nodes includes two storage nodes that store the replicas, the number of lost replicas of the target data shard is 2. Since the number of replicas of the target data shard does not meet the preset replica configuration quantity, the original replica configuration quantity is 3, and the current number of available replicas is 1, the state of the target data shard is adjusted to the second partially available state, and the second partially available state includes only allowing reads.
[0065] S2023, if the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, and some storage nodes include storage nodes storing three replicas, then the state of the target data shard is adjusted to an unavailable state, and the unavailable state includes not allowing reading, not allowing overwriting, and not allowing new writing;
[0066] Specifically, if the part of the storage nodes includes three storage nodes that store the replicas, the number of lost replicas of the target data shard is 3. Since the number of replicas of the target data shard does not meet the preset replica configuration quantity, the original replica configuration quantity is 3, and the number of existing available replicas is 0, all replicas of the target data shard are lost, and the state of the target data shard is adjusted to an unavailable state, and the unavailable state includes not allowing reading, not allowing overwriting, and not allowing new writing.
[0067] It is understandable that in a distributed file system, in order to ensure the high reliability of the distributed file system, the target data shard is stored using a multi-copy strategy, where the number of copies can represent the security level of the target data shard. For example, in the embodiment of the present application, a 3-copy storage strategy is adopted, and the corresponding security level of the target data shard is 3. When some of the 3 copies fail, in order to continue to ensure that the security level of the target data shard reaches 3, the failed copies will be repaired, and during the copy repair period, new data may be written or overwritten on the target data shard at the same time. At this time, the new writing or overwriting occurs on the copy that has not failed. For the copy that has failed and is being repaired, it is necessary to synchronize the data between the copies after the copy repair is completed, and the task complexity of data synchronization for the new writing task is higher than the task complexity of data synchronization for the overwriting task. Therefore, in order to reduce the task complexity of data synchronization of the target data shard during the period from the failure of some copies to the completion of copy repair, when a copy fails, the state of the target data shard is usually adjusted. In an embodiment of the present application, in a distributed file system with a copy configuration of 3, when 1 copy fails, new writes to the target data shard are restricted, that is, the state of the target data shard is adjusted to allow only reading and overwriting; when 2 copies fail, new writes and overwriting to the target data shard are restricted, that is, the state of the target data shard is adjusted to allow only reading; when 3 copies fail, there are no available copies, and no operation can be performed on the target data shard, then the state of the target data shard is adjusted to not allow reading, not allow overwriting, and not allow new writing.
[0068] S203, adjusting the state of the target data shard to a fully available state, where the fully available state includes allowing reading, overwriting, and new writing.
[0069] Specifically, step S203 is after step S202, after which the replicas stored on the storage node that is about to fail are stored in the storage nodes that have not failed in the virtual fault subdomain, and the three replicas of the target data shard are restored to normal availability, then the state of the target data shard is adjusted to a fully available state, and the fully available state includes allowing reading, overwriting and new writing.
[0070] Please also see Figure 5 , is an example schematic diagram of a replica migration provided in an embodiment of the present application. Figure 5 As shown, in the target failure group, Figure 5The target failure group shown includes virtual failure subdomain 1, virtual failure subdomain 2 and virtual failure subdomain 3. One copy of the target data shard is stored on object storage device 2 in virtual failure subdomain 1, one is stored on object storage device 6 in virtual failure subdomain 2, and the other is stored on object storage device 4 in virtual failure subdomain 3. At this time, object storage device 1, object storage device 2 and object storage device 3 in virtual failure subdomain 1 fail. Then, the copy of the target data shard that should have been stored on object storage device 2 can be stored on object storage device 6 in virtual failure subdomain 1. Figure 5 The object storage device is the storage node.
[0071] In an embodiment of the present application, when at least one storage node storing a replica in a target fault group of a distributed file system fails, the covered fault range is first determined. When the fault range is that some storage nodes in a virtual fault subdomain in the target fault group fail and the availability of the target data shard is affected, the replica stored on the failed storage node is stored in a non-failed storage node in the same virtual fault subdomain, so that the target data shard is restored to a fully available state, thereby ensuring the availability of the distributed file system.
[0072] See also Figure 6 , is a flow chart of a replica storage method provided by an embodiment of the present application. The replica storage method is applied to a distributed file system, the distributed file system includes multiple fault domains, each of the fault domains includes at least one virtual fault subdomain, each of the virtual fault subdomains includes multiple storage nodes, and a virtual fault subdomain with the same number of replicas as the target data shard is selected from the at least one virtual fault subdomain to obtain at least one fault group, and the replica of the target data shard is stored in the target fault group in the at least one fault group. Figure 6 As shown, the replica storage method may include the following steps.
[0073] S301, if at least one storage node storing a replica in the target failure group fails, determine the covered failure range;
[0074] Specifically, a heartbeat detection mechanism is used to detect in real time whether a fault occurs in the distributed file system. When a storage node is detected to have a fault, the fault scope of the current fault is determined. The fault scope may be a single storage node failure, multiple storage nodes failure, a virtual fault subdomain failure, or multiple virtual fault subdomain failures in the target fault group.
[0075] The heartbeat detection mechanism sends heartbeat messages to each storage node in the virtual fault subdomain of each fault domain of the distributed file system in real time. If a message reply can be received, it proves that the storage node that replies to the message has not failed. If no message reply is received, it proves that the storage node that did not reply to the message has failed.
[0076] S302, if the fault range is that some virtual fault subdomains in the target fault group have failed, then reallocate the temporary data shards, determine the same number of storage nodes as the number of copies in the virtual fault subdomains that have not failed in the target fault group, and store the copies of the temporary data shards in the storage nodes;
[0077] It is not difficult to understand that if the fault range is that some virtual fault subdomains in the target fault group fail, the copy of the target data shard stored in the virtual fault subdomain where the fault occurs is lost, and the lost copy cannot be restored in the virtual fault subdomain where the fault occurs, then the temporary data shard is reallocated to store three copies of the temporary data shard in the remaining virtual fault subdomains in the target fault group that have not failed. The virtual fault subdomain failure may be a single virtual fault subdomain failure or the entire fault domain to which the virtual fault subdomain belongs may fail.
[0078] Specifically, if the fault range is that some virtual fault subdomains in the target fault group fail, the temporary data shards are reallocated, and storage nodes are selected cyclically in each virtual fault subdomain that has not failed in the target fault group in a random order. One storage node is selected each time until the number of selected storage nodes is equal to the number of replicas, and the replicas of the temporary data shards are stored in the selected storage nodes.
[0079] The temporary data shard can take over the service content that cannot be realized due to the loss of the target data shard copy. For example, if the copy of the target data shard is lost, the new write service for the target data shard cannot continue to be written on the target data shard, and the temporary data shard takes over the new write service of the target data shard.
[0080] S303: If the virtual fault subdomain in the target fault group recovers to normal, a copy of the temporary data shard is stored in the target fault group according to the dispersion principle, and one copy is stored in each virtual fault subdomain in the target fault group.
[0081] Specifically, if the failed virtual fault subdomain is repaired and returns to normal, the copies of the temporary data slices are stored in all virtual fault subdomains in the target fault group according to the dispersion principle, and each of the virtual fault subdomains stores a copy of the temporary data slice.
[0082] Please also see Figure 7, is a schematic diagram of an example of allocating temporary data slices provided in an embodiment of the present application. Figure 7 As shown, in Figure 7 The target fault group shown includes virtual fault subdomain 1, virtual fault subdomain 2 and virtual fault subdomain 3. One copy of the target data shard is stored on object storage device 2 in virtual fault subdomain 1, one is stored on object storage device 6 in virtual fault subdomain 2, and another is stored on object storage device 4 in virtual fault subdomain 3. If virtual fault subdomain 1 fails at this time, temporary data shards can be reallocated, and the three copies of the temporary data shards are stored on object storage device 2, object storage device 3 and object storage device 5 in virtual fault subdomain 2 where no failure has occurred and virtual fault subdomain 3.
[0083] Furthermore, after the copy of the temporary data shard is reallocated in the target fault group, the state of the target data shard is adjusted to a fully available state, and the state of the temporary data shard is adjusted to a first partially available state, wherein the fully available state includes allowing reading, overwriting, and new writing, and the first partially available state includes only allowing reading and overwriting.
[0084] It is not difficult to understand that the temporary data shard is a data shard that is temporarily allocated when the target data shard fails, and is used to take over the new write service of the target data shard when the target data shard fails, that is, during the failure of the target data shard, the newly written data for the target data shard will be stored in the temporary data shard, and after the copy of the target data shard is repaired, the target data shard can continue to provide new write services, then the new write service of the temporary data shard is closed, so that the data storage continues to maintain the original rules. Therefore, the status of the temporary data shard is adjusted to allow only reading and overwriting.
[0085] In an embodiment of the present application, when at least one storage node storing a replica in a target fault group of a distributed file system fails, the covered fault range is first determined. If the fault range is a fault in some virtual fault subdomains in the target fault group, by allocating temporary data shards, copies of the temporary data shards are stored in virtual fault subdomains in the target fault group that have not failed, so that the temporary data shards take over the services of the target data shards that are affected by the loss of the replica, thereby ensuring the availability of the distributed file system. When the virtual fault subdomain that failed returns to normal, the storage method of the copies of the temporary data shards is adjusted in the target fault group according to the principle of dispersion, thereby further ensuring the reliability of the distributed file system.
[0086] based on Figure 6The solution disclosed in the embodiment should also adjust the available status of the target data slice and the temporary data slice during the process from the virtual fault subdomain failure to the fault recovery. Please refer to the following embodiment.
[0087] See also Figure 8 , Figure 8 A flowchart of a replica storage method provided by another exemplary embodiment of the present application. The replica storage method can be applied to Figure 2 In the system shown. The replica storage method is applied to a distributed file system, the distributed file system includes multiple fault domains, each of the fault domains includes at least one virtual fault subdomain, each of the virtual fault subdomains includes multiple storage nodes, and a virtual fault subdomain with the same number of replicas as the target data shard is selected from the at least one virtual fault subdomain to obtain at least one fault group, and the replica of the target data shard is stored in the target fault group in the at least one fault group. Figure 8 As shown, the replica storage method includes:
[0088] S401, if at least one storage node storing a replica in a target failure group fails, determine the covered failure range;
[0089] S402, if the fault range is a virtual fault subdomain in the target fault group, the state of the target data shard is adjusted to a first partially available state, where the first partially available state includes only allowing reading and overwriting;
[0090] It is not difficult to understand that a copy of the target data shard is stored in each virtual fault subdomain in the target fault group. If the fault range is a virtual fault subdomain in the target fault group, it indicates that the number of copies of the target data shard lost is 1. In a distributed file system with a replica configuration of 3, the state of the target data shard needs to be adjusted to allow only reading and overwriting.
[0091] S403, reallocate the temporary data shards, determine storage nodes with the same number as the replicas in the virtual fault subdomains that have not failed in the target fault group, and store the replicas of the temporary data shards in the storage nodes;
[0092] S404, setting the state of the temporary data shard to a fully available state, where the fully available state includes allowing reading, overwriting, and new writing;
[0093] S405, if the virtual fault subdomain in the target fault group recovers to normal, a copy of the temporary data shard is stored in the target fault group according to the dispersion principle, and one copy is stored in each virtual fault subdomain in the target fault group.
[0094] In an embodiment of the present application, when a virtual fault subdomain in a target fault group fails, the target data shard is adjusted to a first available state that only allows reading and overwriting, and then a temporary data shard is allocated, a copy of the temporary data shard is saved in a virtual fault subdomain in the target fault group where no fault has occurred, and the temporary data shard is set to a fully available state that allows reading, overwriting, and new writing, so that the temporary data shard takes over the new write service of the target data shard. By using an embodiment of the present application, even if a virtual fault subdomain fails, the available state of the target data shard can be guaranteed, thereby ensuring the reliability and availability of the distributed file system.
[0095] See also Fig. 9 , Fig. 9 A flowchart of a replica storage method provided by another exemplary embodiment of the present application. The replica storage method can be applied to Figure 2 In the system shown. The replica storage method is applied to a distributed file system, the distributed file system includes multiple fault domains, each of the fault domains includes at least one virtual fault subdomain, each of the virtual fault subdomains includes multiple storage nodes, and a virtual fault subdomain with the same number of replicas as the target data shard is selected from the at least one virtual fault subdomain to obtain at least one fault group, and the replica of the target data shard is stored in the target fault group in the at least one fault group. Fig. 9 As shown, the replica storage method includes:
[0096] S501, if at least one storage node storing a replica in a target failure group fails, determine the covered failure range;
[0097] S502, if the fault range is that two virtual fault subdomains in the target fault group fail, the state of the target data shard is adjusted to a second partial available state, where the second partial available state includes allowing only reading;
[0098] It is not difficult to understand that a copy of the target data shard is stored in each virtual fault subdomain in the target fault group. If the fault range is that two virtual fault subdomains in the target fault group fail, it indicates that the number of copies of the target data shard lost is 2. In a distributed file system with a copy configuration of 3, the state of the target data shard needs to be adjusted to allow only reading.
[0099] S503, reallocate the temporary data shards, determine storage nodes with the same number as the replicas in the virtual fault subdomains that have not failed in the target fault group, and store the replicas of the temporary data shards in the storage nodes;
[0100] S504, setting the state of the temporary data shard to a fully available state, where the fully available state includes allowing reading, overwriting, and new writing;
[0101] S505, if the virtual fault subdomain in the target fault group recovers to normal, a copy of the temporary data shard is stored in the target fault group according to the dispersion principle, and one copy is stored in each virtual fault subdomain in the target fault group.
[0102] In an embodiment of the present application, when two virtual fault subdomains in the target fault group fail, the target data shard is adjusted to the second available state that only allows reading, and then a temporary data shard is allocated, a copy of the temporary data shard is saved in a virtual fault subdomain in the target fault group where no failure has occurred, and the temporary data shard is set to a fully available state that allows reading, overwriting, and new writing, so that the temporary data shard takes over the new write service of the target data shard. By using an embodiment of the present application, even if a virtual fault subdomain fails, the available state of the target data shard can be guaranteed, thereby ensuring the reliability and availability of the distributed file system.
[0103] See also Fig.10 , is a schematic diagram of the structure of a replica storage device provided in an embodiment of the present application. Fig.10 As shown, the replica storage device 1 can be implemented as all or part of a computer device through software, hardware, or a combination of both. According to some embodiments, the replica storage device 1 includes a fault range determination module 11 and a replica adjustment module 12, specifically including:
[0104] A fault range determination module 11 is used to determine the covered fault range if at least one storage node storing the replica in the target fault group fails;
[0105] The replica adjustment module 12 is used to adjust the storage method of the replica in the target fault group based on the fault scope, so that the state of the target data shard is fully available.
[0106] Optionally, the replica adjustment module 12 includes:
[0107] The first replica adjustment unit 121 is configured to store the replica stored on the failed storage node to the non-failed storage nodes in the virtual fault subdomain if the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, and the some storage nodes include the storage nodes storing the replica;
[0108] The second replica adjustment unit 122 is used to reallocate temporary data slices if the fault range is a partial virtual fault subdomain in the target fault group, and store the replicas of the temporary data slices in the virtual fault subdomains in the target fault group where no fault occurs.
[0109] Optionally, the replica adjustment module 12 further includes a first state adjustment unit 123, wherein the first state adjustment unit 123 is specifically configured to:
[0110] If the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, and the some storage nodes include a storage node storing the replica, then the state of the target data shard is adjusted to a first partially available state, where the first partially available state includes allowing only reading and overwriting;
[0111] If the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, and the some storage nodes include two storage nodes storing the replicas, then the state of the target data shard is adjusted to a second partially available state, and the second partially available state includes allowing only reading;
[0112] If the fault range is that some storage nodes in the virtual fault subdomain of the target fault group fail, and the some storage nodes include three storage nodes storing the replicas, the state of the target data shard is adjusted to an unavailable state, and the unavailable state includes not allowing reading, overwriting and new writing.
[0113] Optionally, the replica adjustment module 12 further includes a second state adjustment unit 124, and the second state adjustment unit 124 is specifically configured to:
[0114] The state of the target data shard is adjusted to a fully available state, where the fully available state includes allowing reading, overwriting, and new writing.
[0115] Optionally, the replica adjustment module 12 further includes a third state adjustment unit 125, and the third state adjustment unit 125 is specifically configured to:
[0116] If the fault range is a virtual fault subdomain in the target fault group, the state of the target data shard is adjusted to a first partially available state, where the first partially available state includes only allowing reading and overwriting;
[0117] If the fault range is that two virtual fault subdomains in the target fault group fail, the state of the target data shard is adjusted to a second partially available state, where the second partially available state includes allowing only reading.
[0118] Optionally, the replica adjustment module 12 further includes a fourth state adjustment unit 126, and the fourth state adjustment unit 126 is specifically configured to:
[0119] If the fault range is a virtual fault subdomain in the target fault group, the state of the temporary data shard is set to a fully available state;
[0120] If the fault scope is that two virtual fault subdomains in the target fault group fail, the state of the temporary data shard is set to a fully available state.
[0121] Optionally, the second replica adjusting unit 122 is specifically configured to:
[0122] If the fault range is that some virtual fault subdomains in the target fault group fail, the temporary data shards are reallocated, and storage nodes with the same number of copies as the copies are determined in the virtual fault subdomains in the target fault group that have not failed, and the copies of the temporary data shards are stored in the storage nodes.
[0123] Optionally, the second replica adjusting unit 122 is specifically configured to:
[0124] Storage nodes are cyclically selected in each virtual fault subdomain in the target fault group where no fault occurs in a random order, and one storage node is selected each time until the number of selected storage nodes is equal to the number of replicas.
[0125] Optionally, the replica adjustment module 12 further includes a fault recovery unit 127, and the fault recovery unit 127 is specifically used to:
[0126] If the virtual fault subdomain in the target fault group recovers to normal, a copy of the temporary data shard is stored in the target fault group according to the dispersion principle, and one copy is stored in each virtual fault subdomain in the target fault group.
[0127] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0128] In an embodiment of the present application, when at least one storage node storing a replica in a target fault group of a distributed file system fails, the covered fault range is first determined, and based on the fault range, the storage method of the replica in the target fault group is adjusted to make the state of the target data shard fully available, thereby avoiding the impact of the storage node failure on the read and write services of the distributed file system, and ensuring the availability and reliability of the distributed file system.
[0129] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figures 1 to 9 The replica storage method of the embodiment shown in the figure can be specifically executed by referring to Figures 1 to 9The specific description of the illustrated embodiment will not be repeated here.
[0130] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor as described above. Figures 1 to 9 The replica storage method of the embodiment shown in the figure can be specifically executed by referring to Figures 1 to 9 The specific description of the illustrated embodiment will not be repeated here.
[0131] Please refer to Fig.11 , which shows a block diagram of a computer device provided by an exemplary embodiment of the present application. The computer device in the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected via the bus 150.
[0132] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire computer device, and executes various functions and processes data of the computer device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0133] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets.
[0134] The input device 130 is used to receive input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes but is not limited to a display device and a speaker. In the embodiment of the present application, the input device 130 can be a temperature sensor for obtaining the operating temperature of the computer device. The output device 140 can be a speaker for outputting audio signals.
[0135] In addition, those skilled in the art will appreciate that the structure of the computer device shown in the above drawings does not constitute a limitation on the computer device, and the computer device may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the computer device also includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a Bluetooth module, and other components, which will not be described in detail here.
[0136] In the embodiment of the present application, the execution subject of each step may be the computer device described above. Optionally, the execution subject of each step is the operating system of the computer device. The operating system may be an Android system, an IOS system, or other operating systems, which is not limited in the embodiment of the present application.
[0137] exist Fig.11 In the computer device shown, the processor 110 can be used to call the replica storage program stored in the memory 120 and execute it to implement the replica storage method as described in the various method embodiments of the present application.
[0138] In an embodiment of the present application, when at least one storage node storing a replica in a target fault group of a distributed file system fails, the covered fault range is first determined, and based on the fault range, the storage method of the replica in the target fault group is adjusted to make the state of the target data shard fully available, thereby avoiding the impact of the storage node failure on the read and write services of the distributed file system, and ensuring the availability and reliability of the distributed file system.
[0139] Those skilled in the art can clearly understand that the technical solution of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.
[0140] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0141] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0142] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0143] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0144] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0145] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct the relevant hardware. The program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0146] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A replica storage method, characterized in that: Applied to a distributed file system, the distributed file system includes multiple fault domains, each of the fault domains includes at least one virtual fault subdomain, each of the virtual fault subdomains includes multiple storage nodes, a virtual fault subdomain having the same number of copies as the target data shard is selected from the at least one virtual fault subdomain to obtain at least one fault group, the copy of the target data shard is stored in a target fault group in the at least one fault group, the method includes: If at least one storage node storing the replica in the target failure group fails, determining the covered failure range; If the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, and the some storage nodes include a storage node storing the replica, then the state of the target data shard is adjusted to a first partially available state, where the first partially available state includes allowing only reading and overwriting; If the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, and the some storage nodes include two storage nodes storing the replicas, then the state of the target data shard is adjusted to a second partially available state, and the second partially available state includes allowing only reading; If the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, and the some storage nodes include three storage nodes storing the replicas, the state of the target data shard is adjusted to an unavailable state, and the unavailable state includes not allowing reading, not allowing overwriting, and not allowing new writing; Based on the failure scope, adjusting the storage mode of the replica in the target failure group so that the state of the target data shard is fully available; Wherein, adjusting the storage mode of the replica in the target failure group based on the failure scope includes: If the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, the replica stored on the failed storage node is stored in the non-failed storage nodes in the virtual fault subdomain, and the some storage nodes include the storage nodes storing the replica; If the fault range is that some virtual fault subdomains in the target fault group fail, the temporary data slices are reallocated, and the copies of the temporary data slices are stored in the virtual fault subdomains in the target fault group where no fault occurs.
2. The method according to claim 1, characterized in that: After storing the replica stored on the failed storage node to a storage node that has not failed in the virtual failure subdomain, the method further includes: The state of the target data shard is adjusted to a fully available state, where the fully available state includes allowing reading, overwriting, and new writing.
3. The method according to claim 1, characterized in that The method further comprises: If the fault range is a virtual fault subdomain in the target fault group, the state of the target data shard is adjusted to a first partially available state, where the first partially available state includes only allowing reading and overwriting; If the fault scope is that two virtual fault subdomains in the target fault group fail, the state of the target data shard is adjusted to a second partially available state, where the second partially available state includes allowing only reading.
4. The method according to claim 3, characterized in that After storing the copy of the temporary data slice in the virtual fault subdomain in the target fault group where no fault occurs, the method further includes: If the fault range is a virtual fault subdomain in the target fault group, the state of the temporary data shard is set to a fully available state, where the fully available state includes allowing reading, overwriting, and new writing; If the fault scope is that two virtual fault subdomains in the target fault group fail, the state of the temporary data shard is set to a fully available state, and the fully available state includes allowing reading, overwriting, and new writing.
5. The method according to claim 1, characterized in that If the fault range is that some virtual fault subdomains in the target fault group fail, reallocating temporary data slices and storing copies of the temporary data slices in virtual fault subdomains in the target fault group where no fault occurs, includes: If the fault range is that some virtual fault subdomains in the target fault group fail, the temporary data shards are reallocated, and storage nodes with the same number of copies as the copies are determined in the virtual fault subdomains in the target fault group that have not failed, and the copies of the temporary data shards are stored in the storage nodes.
6. The method according to claim 5, characterized in that The determining of storage nodes having the same number as the replicas in the virtual failure subdomains in the target failure group where no failure has occurred includes: Storage nodes are cyclically selected in each virtual fault subdomain in the target fault group where no fault occurs in a random order, and one storage node is selected each time until the number of selected storage nodes is equal to the number of replicas.
7. The method according to claim 1 or 4, characterized in that: If the fault range is that some virtual fault subdomains in the target fault group fail, then reallocating temporary data slices and storing copies of the temporary data slices in virtual fault subdomains in the target fault group where no fault occurs, the method further includes: If the virtual fault subdomain in the target fault group recovers to normal, a copy of the temporary data shard is stored in the target fault group according to the dispersion principle, and one copy is stored in each virtual fault subdomain in the target fault group.
8. A replica storage device, characterized in that: Applied to a distributed file system, the distributed file system includes multiple fault domains, each of the fault domains includes at least one virtual fault subdomain, each of the virtual fault subdomains includes multiple storage nodes, a virtual fault subdomain having the same number of copies as a target data shard is selected from the at least one virtual fault subdomain to obtain at least one fault group, the copy of the target data shard is stored in a target fault group in the at least one fault group, the device includes: A fault range determination module, configured to determine a covered fault range if at least one storage node storing the replica in the target fault group fails; A replica adjustment module, for adjusting the state of the target data shard to a first partially available state if the fault range is a fault of some storage nodes in a virtual fault subdomain in the target fault group, and the some storage nodes include a storage node storing the replica; if the fault range is a fault of some storage nodes in a virtual fault subdomain in the target fault group, and the some storage nodes include two storage nodes storing the replica, adjusting the state of the target data shard to a second partially available state, and the second partially available state includes only reading; if the fault range is a fault of some storage nodes in a virtual fault subdomain in the target fault group, and the some storage nodes include three storage nodes storing the replica, adjusting the state of the target data shard to an unavailable state, and the unavailable state includes not allowing reading, not allowing overwriting, and not allowing new writing; The replica adjustment module is further used to adjust the storage mode of the replica in the target fault group based on the fault range, so that the state of the target data shard is fully available; The replica adjustment module is further used for: If the fault range is that some storage nodes in the virtual fault subdomain in the target fault group fail, the replica stored on the failed storage node is stored in the non-failed storage nodes in the virtual fault subdomain, and the some storage nodes include the storage nodes storing the replica; If the fault range is that some virtual fault subdomains in the target fault group fail, the temporary data slices are reallocated, and the copies of the temporary data slices are stored in the virtual fault subdomains in the target fault group where no fault occurs.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method as claimed in any one of claims 1 to 7.
