Data processing method and device, equipment and medium
By receiving write data requests and response information in the dual-active storage cluster to update the survival status of the storage cluster, the resource overhead and waiting time extension problems caused by network failure are solved, and the efficiency of the storage system is improved.
Patent Information
- Application Number
- CN202411865266.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-17
AI Technical Summary
In a dual-active storage cluster, network failure causes a large amount of heartbeat information in the heartbeat connection to cause resource overhead and extends the waiting time of the client.
By receiving a client's write data request for the first storage cluster and sending the request to the first storage cluster and the second storage cluster, receiving response information to determine whether the write data is successful, updating the survival status of the dual-active storage cluster based on the response information without relying on a heartbeat connection.
It reduces network resource overhead, shortens the waiting time of clients, and improves the operation efficiency of the storage system.
Smart Images

Figure CN119781682A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, device, equipment and medium. Background Art
[0002] With the advancement of digitalization in various industries, data has gradually become the core of enterprise operations, and distributed storage technology has gradually become one of the main research directions of the industry due to its advantages of high availability and reliability.
[0003] Active-Active storage cluster is a resource-saving data disaster recovery solution in distributed storage systems. Its implementation mode is to let the primary storage cluster and the backup storage cluster take on the user's data business at the same time. At this time, the two storage clusters back up each other in real time and provide data reading and writing services to users at the same time. Since the two storage clusters are in working state at the same time and back up each other, it not only improves resource utilization but also ensures business continuity, which can meet the user's business stability and business continuity requirements.
[0004] In the related art, it is necessary to adjust the survival state of the active-active storage cluster through the heartbeat connection established between the storage clusters in the active-active storage cluster so that the active-active storage cluster meets the actual business needs. However, when a network failure occurs, a large amount of heartbeat information in the heartbeat connection between the storage clusters will cause great resource overhead and prolong the waiting time of the client. Summary of the invention
[0005] In view of the above problems, a data processing method, device, equipment, and medium are proposed to overcome the above problems or at least partially solve the above problems, including:
[0006] A data processing method is applied to a storage system, wherein the storage system includes a first storage cluster and a second storage cluster, wherein the first storage cluster and the second storage cluster constitute an active-active storage cluster, and the method includes:
[0007] receiving a write data request from a client for a first storage cluster, and sending the write data request to the first storage cluster and a second storage cluster;
[0008] Receiving response information returned by the first storage cluster and the second storage cluster in response to the data writing request; wherein the response information is used to indicate whether the data writing is successful;
[0009] According to the response information, the survival status of the active-active storage cluster is updated.
[0010] Optionally, updating the survival status of the active-active storage cluster according to the response information includes:
[0011] Determine a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and stop the service of the target storage cluster;
[0012] The live state of the target storage cluster is updated to a non-live state.
[0013] Optionally, the storage system further includes an arbitration server, the first storage cluster and the second storage cluster respectively establish a stateful monitoring connection with the arbitration server, and determining a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and stopping the service of the target storage cluster includes:
[0014] Determining whether the arbitration service provided by the arbitration server is normal through the status monitoring connection;
[0015] If the arbitration service is normal, determining a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and notifying the first storage cluster to stop the service, and / or notifying the arbitration server to stop the service of the second storage cluster;
[0016] If the arbitration service is abnormal, obtaining preset configuration information;
[0017] The target storage cluster is determined in the first storage cluster and the second storage cluster according to the configuration information and the response information, and the target storage cluster is notified to stop the service.
[0018] Optionally, if the arbitration service is normal, determining a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and notifying the first storage cluster to stop the service, and / or notifying the arbitration server to stop the service of the second storage cluster, includes:
[0019] If the response information indicates that both the first storage cluster and the second storage cluster fail to write data, the first storage cluster and the second storage cluster are determined as the target storage clusters;
[0020] Notify the first storage cluster to stop service, and notify the arbitration server to stop service of the second storage cluster;
[0021] If the response information indicates that the first storage cluster fails to write data and the second storage cluster succeeds in writing data, determining the first storage cluster as the target storage cluster, and notifying the first storage cluster to stop service;
[0022] If the response information indicates that the first storage cluster writes data successfully and the second storage cluster fails to write data, determining whether the network connection between the first storage cluster and the second storage cluster is normal;
[0023] If the network connection is abnormal, the second storage cluster is determined as the target storage cluster, and the arbitration server is notified to stop the service of the second storage cluster.
[0024] Optionally, determining the target storage cluster in the first storage cluster and the second storage cluster according to the configuration information and the response information includes:
[0025] If the response information indicates that the first storage cluster and the second storage cluster fail to write data, the first storage cluster and the second storage cluster are determined as the target storage clusters;
[0026] If the response information indicates that the first storage cluster fails to write data and the second storage cluster succeeds in writing data, determining the first storage cluster as the target storage cluster;
[0027] If the response information indicates that the first storage cluster successfully writes data and the second storage cluster fails to write data, determining whether the first storage cluster is a preferred end through the configuration information;
[0028] If the first storage cluster is the preferred end, determining the second storage cluster as the target storage cluster;
[0029] If the first storage cluster is not the preferred end, the first storage cluster and the second storage cluster are determined as the target storage clusters.
[0030] Optionally, the status monitoring connection is a heartbeat connection between the multiple nodes in the at least two storage clusters and the arbitration server, and determining whether the service provided by the arbitration server is normal through the status monitoring connection includes:
[0031] Obtaining a judgment result of the multiple nodes judging whether the arbitration service is normal through the heartbeat connection;
[0032] According to the judgment result, determining the number of target nodes for which the arbitration service is judged to be abnormal;
[0033] If the number of the target nodes is greater than or equal to a preset number, determining that the arbitration service is abnormal;
[0034] If the number of the target nodes is less than the preset number, it is determined that the arbitration service is normal, and the service of the target nodes is stopped.
[0035] Optionally, after determining whether the network connection between the first storage cluster and the second storage cluster is normal, the method further includes:
[0036] If the network connection is normal, retry sending the write data request to the second storage cluster;
[0037] When the number of retries reaches a preset number, the second storage cluster is determined as the target storage cluster, and the arbitration server is notified to stop the service of the second storage cluster.
[0038] A data processing device is applied to a storage system, wherein the storage system includes a first storage cluster and a second storage cluster, wherein the first storage cluster and the second storage cluster constitute an active-active storage cluster, and the device includes:
[0039] A write data processing module, configured to receive a write data request from a client for a first storage cluster, and send the write data request to the first storage cluster and a second storage cluster;
[0040] a response information receiving module, configured to receive response information returned by the first storage cluster and the second storage cluster in response to the data writing request; wherein the response information is used to indicate whether the data writing is successful;
[0041] A survival status update module is used to update the survival status of the active-active storage cluster according to the response information.
[0042] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the data processing method as described above when executed by the processor.
[0043] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data processing method described above is implemented.
[0044] The embodiments of the present invention have the following advantages: by receiving a write data request from a client for a first storage cluster, and sending the write data request to the first storage cluster and the second storage cluster, receiving response information returned by the first storage cluster and the second storage cluster for the write data request, wherein the response information is used to indicate whether the write data is successful, and updating the survival status of the active-active storage cluster according to the response information, there is no need to establish a heartbeat connection between the first storage cluster and the second storage cluster to update the survival status of the active-active storage cluster, but the survival status of the active-active storage cluster is updated through the response information, which effectively reduces network resource overhead and shortens the waiting time of the client, thereby improving the operating efficiency of the storage system. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0046] Figure 1 is a flowchart of a data processing method provided by an embodiment of the present invention;
[0047] Figure 2 It is a schematic diagram of a client requesting data processing from a storage cluster according to an embodiment of the present invention;
[0048] Figure 3 It is a structural block diagram of a data processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] Reference Figure 1 , shows a flowchart of the steps of a data processing method provided by an embodiment of the present invention, which is applied to a storage system, wherein the storage system includes a first storage cluster and a second storage cluster, wherein the first storage cluster and the second storage cluster constitute an active-active storage cluster, and the data processing method may specifically include the following steps:
[0051] Step 101, receiving a write data request from a client for a first storage cluster, and sending the write data request to the first storage cluster and a second storage cluster;
[0052] In this embodiment, the first storage cluster and the second storage cluster form an active-active storage cluster, that is, both the first storage cluster and the second storage cluster are in a live state, and can simultaneously provide the client with basic data services such as data reading and writing, or data services that require high permissions such as data updating and deletion. Moreover, the data between the first storage cluster and the second storage cluster is in a synchronized state, and when the first storage cluster writes data in response to the client's data write request, the second storage cluster will also perform the same data write processing through the replication network (i.e., a network that is separately networked for the data synchronization function).
[0053] Step 102, receiving response information returned by the first storage cluster and the second storage cluster in response to the data writing request; wherein the response information is used to indicate whether the data writing is successful;
[0054] In step 102, by receiving the response information, it can be determined whether the data is written successfully to the first storage cluster and the second storage cluster, and further whether the survival state of the active-active storage cluster needs to be changed.
[0055] For example, Figure 2 As shown in the figure, when client A initiates a write data request to the server of cluster A, the storage system will send the write data request to cluster A, and the server of cluster A will write the data to the storage backend of cluster A, and send the write data request to the server of cluster B through the replication network to synchronously write the data to the storage backend of cluster B ( Figure 2 The server and storage backend of cluster B are omitted).
[0056] If cluster A, cluster B, and the replication network between them are all functioning normally, the storage backend of cluster A writes data successfully and sends feedback to the server of cluster A; the storage backend of cluster B writes data successfully and sends feedback to the server of cluster B, and then the server of cluster B sends feedback to the server of cluster A. At this time, the storage system can receive the response information of clusters A and cluster B to the write data request through the server of cluster A to determine whether the data is written successfully.
[0057] Then, the server of cluster A returns the write success information to the client, and the data writing process ends.
[0058] Step 103: Update the survival status of the active-active storage cluster according to the response information.
[0059] The survival status is used to indicate whether the storage cluster in the active-active storage cluster is alive. If it is alive, the storage cluster continues to provide services such as data reading and writing. If it is not alive, it stops providing services such as data reading and writing, and the client can no longer access it.
[0060] Since the client initiates a write data request to the first storage cluster, the first storage cluster can be regarded as the local end, and the second storage cluster can be regarded as the opposite end. The updated survival status can be: local single active (the first storage cluster is alive, and the second storage cluster is not alive), opposite end single active (the first storage cluster is not alive, and the second storage cluster is alive), deactivated (both the first storage cluster and the second storage cluster are not alive).
[0061] In this embodiment, the survival status of the active-active storage cluster is quickly updated by responding to the difference in whether the data is written successfully, that is, the feedback on whether the actual business is successful. There is no need to establish a heartbeat connection between the first storage cluster and the second storage cluster to detect whether the other end (that is, the second storage cluster) can provide services normally to update the survival status of the active-active storage cluster, which saves system resource overhead and shortens the waiting time of the client.
[0062] In some embodiments of the present invention, step 103 includes:
[0063] Determine a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and stop the service of the target storage cluster;
[0064] The live state of the target storage cluster is updated to a non-live state.
[0065] In this embodiment, the target storage cluster refers to a storage cluster in the active-active storage cluster that is determined to be unable to continue providing services and needs to stop its services. Its survival state is then updated to a non-survival state to update the survival state of the active-active storage cluster, so that the client can understand the survival state of the active-active storage cluster (such as single active, deactivated, etc. on the local side) the next time it needs to access any storage cluster in the active-active storage cluster, so as to avoid initiating requests to the non-survival storage cluster and affecting normal business.
[0066] In some embodiments of the present invention, the storage system further includes an arbitration server, the first storage cluster and the second storage cluster respectively establish a stateful monitoring connection with the arbitration server, and determining a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and stopping the service of the target storage cluster includes:
[0067] Determining whether the arbitration service provided by the arbitration server is normal through the status monitoring connection;
[0068] If the arbitration service is normal, determining a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and notifying the first storage cluster to stop the service, and / or notifying the arbitration server to stop the service of the second storage cluster;
[0069] If the arbitration service is abnormal, obtaining preset configuration information;
[0070] The target storage cluster is determined in the first storage cluster and the second storage cluster according to the configuration information and the response information, and the target storage cluster is notified to stop the service.
[0071] The arbitration server can be an independent server node or a cluster of multiple server nodes. The arbitration server plays the role of a decision maker in the distributed storage system, ensuring that multiple server nodes in the system provide arbitration services when disagreements occur to make consistent decisions.
[0072] The status monitoring connection is a connection established to monitor the status of the arbitration server. It can monitor whether it is online and whether the arbitration service it provides is normal.
[0073] In this embodiment, when the arbitration service is normal, after determining the target storage cluster in the first storage cluster and the second storage cluster according to the response information, if the target storage cluster includes the opposite end (i.e., the second storage system), the arbitration server is notified, and the arbitration server stops the service of the opposite end. In this way, when the second storage cluster also receives data requests from other clients, and in some cases it is necessary to stop the service of the first storage (i.e., at this time, the second storage cluster is regarded as the local end, and the first storage cluster is regarded as the opposite end), the arbitration server can make arbitration on which end to stop the service.
[0074] In actual applications, in the case where the arbitration server receives a first notification that the first storage cluster regards the second storage cluster as a peer and needs to stop the service of the second storage cluster, and a second notification that the second storage cluster regards the first storage cluster as a peer and needs to stop the service of the first storage cluster, the arbitration winner can be determined based on the timestamps of the first notification and the second notification. For example, if the timestamp of the first notification is greater than the timestamp of the second notification, it is determined that the first storage cluster has won the arbitration, and it is finally determined to stop the service of the second storage cluster, further accelerating the update of the survival status of the active-active storage cluster and shortening the waiting time of the client.
[0075] When the arbitration service is abnormal, the target storage cluster that needs to stop service is determined based on the response information and the preset configuration information, and the target storage cluster is notified to stop service. Exemplarily, the configuration information can define the relevant configuration items that map different target storage clusters according to different response information; it can also define that when the first storage cluster and the second storage cluster are both regarded as the opposite end that needs to stop service, the default arbitration winner is used to play a certain role corresponding to the arbitration server.
[0076] In this embodiment, the survival status of the active-active storage cluster can be quickly and flexibly updated only through the status monitoring connection and configuration information between the storage cluster and the arbitration server, effectively saving network resource overhead and networking costs.
[0077] In some embodiments of the present invention, if the arbitration service is normal, determining a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and notifying the first storage cluster to stop the service, and / or notifying the arbitration server to stop the service of the second storage cluster, includes:
[0078] If the response information indicates that both the first storage cluster and the second storage cluster fail to write data, the first storage cluster and the second storage cluster are determined as the target storage clusters;
[0079] Notify the first storage cluster to stop service, and notify the arbitration server to stop service of the second storage cluster;
[0080] If the response information indicates that the first storage cluster fails to write data and the second storage cluster succeeds in writing data, determining the first storage cluster as the target storage cluster, and notifying the first storage cluster to stop service;
[0081] If the response information indicates that the first storage cluster writes data successfully and the second storage cluster fails to write data, determining whether the network connection between the first storage cluster and the second storage cluster is normal;
[0082] If the network connection is abnormal, the second storage cluster is determined as the target storage cluster, and the arbitration server is notified to stop the service of the second storage cluster.
[0083] In some examples, such as Figure 2 As shown in the figure, cluster A and cluster B form an active-active storage cluster in the storage cluster, and the arbitration service provided by the arbitration server is confirmed to be normal. When the client writes data to cluster A (referred to as the local end), the storage system uses the arbitration mode to update the survival status of the storage cluster, as follows:
[0084] If data fails to be written to the storage backend of cluster A, but is successfully written to the storage backend of cluster B (remembered as the peer), cluster A is the target storage cluster. Then cluster A is notified to stop the service and the survival state of the active-active storage cluster is updated to the peer single-active state.
[0085] If data fails to be written to the storage backend of cluster A, and synchronous writing to the storage backend of cluster B also fails, and cluster A and cluster B are the target storage clusters, cluster A is notified to stop the service, and the arbitration server is notified to stop the data service of cluster B, and the survival status of the active-active storage cluster is updated to deactivated; a response is returned to the client indicating that data writing failed.
[0086] If data is successfully written to the storage backend of cluster A, but synchronous writing to the storage backend of cluster B fails, determine whether the network connection between cluster A and cluster B is normal. For example, notify each node in cluster A to establish a heartbeat connection with each node in cluster B and send heartbeat information, and determine whether the network connection between cluster A and cluster B is abnormal based on cluster B's reply to the heartbeat information.
[0087] If the network connection is determined to be abnormal, for example, the number of cluster A nodes that receive abnormal replies exceeds half of the total number of cluster A nodes, it can be determined that the network connection is abnormal. At this time, cluster B is confirmed as the target storage cluster, and the arbitration server is notified to stop the service of cluster B and update the survival status of the active-active storage cluster to single active on the local end.
[0088] In this embodiment, when the arbitration server is normal, the arbitration server stops the service of the other end, which can effectively avoid system conflicts and further speed up the update of the survival status of the active-active storage system.
[0089] In some embodiments of the present invention, after determining whether the network connection between the first storage cluster and the second storage cluster is normal, the method further includes:
[0090] If the network connection is normal, retry sending the write data request to the second storage cluster;
[0091] When the number of retries reaches a preset number, the second storage cluster is determined as the target storage cluster, and the arbitration server is notified to stop the service of the second storage cluster.
[0092] In some examples, such as Figure 2 As shown, when it is determined that the network connection is normal, for example, when the number of cluster A nodes that receive abnormal heartbeat information replies does not exceed half of the total number of cluster A nodes, it is determined that there is no abnormality in the network connection, and a write data request is retried to be sent to cluster B until cluster B returns a response message indicating that the data is successfully written; if the retries reach a preset number of times (for example, 3 times), and cluster B still returns a response message indicating that the data write failed, cluster B is determined to be the target storage cluster, and the arbitration server is notified to stop the data service of cluster B, and the survival status of the active-active storage cluster is updated to single active on this end.
[0093] In some embodiments of the present invention, determining the target storage cluster in the first storage cluster and the second storage cluster according to the configuration information and the response information includes:
[0094] If the response information indicates that the first storage cluster and the second storage cluster fail to write data, the first storage cluster and the second storage cluster are determined as the target storage clusters;
[0095] If the response information indicates that the first storage cluster fails to write data and the second storage cluster succeeds in writing data, determining the first storage cluster as the target storage cluster;
[0096] If the response information indicates that the first storage cluster successfully writes data and the second storage cluster fails to write data, determining whether the first storage cluster is a preferred end through the configuration information;
[0097] If the first storage cluster is the preferred end, determining the second storage cluster as the target storage cluster;
[0098] If the first storage cluster is not the preferred end, the first storage cluster and the second storage cluster are determined as the target storage clusters.
[0099] In this embodiment, the preferred end refers to a storage cluster that can independently and preferentially provide services, and when it is regarded as a peer end and requested to stop data services by the other party at the same time, it is the default arbitration winner.
[0100] In some examples, such as Figure 2 As shown in the figure, cluster A and cluster B form an active-active storage cluster in the storage cluster, and it is confirmed that the arbitration service provided by the arbitration server is abnormal. When the client writes data to cluster A (recorded as the local end), the storage system uses the static mode to update the survival status of the storage cluster, as follows:
[0101] If data fails to be written to the storage backend of cluster A, but is successfully written to the storage backend of cluster B (remembered as the peer), cluster A is the target storage cluster. Then cluster A is notified to stop the service and the survival state of the active-active storage cluster is updated to the peer single-active state.
[0102] If data fails to be written to the storage backend of cluster A, and synchronous writing to the storage backend of cluster B also fails, and cluster A and cluster B are the target storage clusters, cluster A and cluster B are notified to stop service, and the survival status of the active-active storage cluster is updated to deactivated; a response indicating that the client failed to write data is returned.
[0103] If data is successfully written to the storage backend of cluster A, but synchronous writing to the storage backend of cluster B fails, determine whether cluster A is the preferred end through configuration information. If cluster A is the preferred end, cluster B is the target storage cluster, and cluster B is notified to stop service. The survival status of the active-active storage cluster is updated to single active on the local end.
[0104] If cluster A is not the preferred end, cluster A and cluster B are the target storage clusters, and cluster A and cluster B are notified to stop service, and the survival state of the active-active storage cluster is updated to deactivation, and a response of data write failure is returned to the client.
[0105] In this embodiment, when the arbitration service provided by the arbitration server is abnormal, the preferred end is quickly determined through a static configuration method, without the need to send a heartbeat connection to the opposite storage cluster to confirm its status, thereby effectively improving the timeliness and flexibility of the survival status adjustment of the active-active storage cluster.
[0106] In some embodiments of the present invention, the status monitoring connection is a heartbeat connection between the multiple nodes in the at least two storage clusters and the arbitration server, and determining whether the service provided by the arbitration server is normal through the status monitoring connection includes:
[0107] Obtaining a judgment result of the multiple nodes judging whether the arbitration service is normal through the heartbeat connection;
[0108] According to the judgment result, determining the number of target nodes for which the arbitration service is judged to be abnormal;
[0109] If the number of the target nodes is greater than or equal to a preset number, determining that the arbitration service is abnormal;
[0110] If the number of the target nodes is less than the preset number, it is determined that the arbitration service is normal, and the service of the target nodes is stopped.
[0111] In this embodiment, a plurality of nodes establish a heartbeat connection with the arbitration server, and each node sends a heartbeat message to the arbitration server, and judges whether the arbitration service provided by the arbitration server is normal according to the reply of the arbitration server to the heartbeat message, and obtains a judgment result. The storage system then determines whether the arbitration service is abnormal by judging the number of target nodes that judge the arbitration service as abnormal.
[0112] In some examples, multiple nodes receive responses from the arbitration server to the heartbeat information and make corresponding judgments in the following situations:
[0113] (1) After receiving a normal response from the arbitration server, the heartbeat timeout count heart_count is set to 0, and the next heartbeat message is waited for;
[0114] (2) The arbitration server receives an abnormal reply, determines that the arbitration service is abnormal, and reports the judgment result of "arbitration service abnormality" to the alarm;
[0115] (3) If the response received from the arbitration server times out, that is, if the heartbeat response from the arbitration service is not received for a preset period of time (e.g., 5 seconds), the heartbeat timeout count heart_count is increased by 1; if heart_count is greater than a certain value (i.e., the total timeout period reaches a certain value, such as 30 seconds), and the heartbeat response from the arbitration server is still not received, the arbitration server is judged to be abnormal.
[0116] When it is determined that the number of target nodes is greater than or equal to a preset number, such as half of the total number of all nodes, it is determined that the arbitration service provided by the arbitration server is abnormal.
[0117] Further, if the number of target nodes is less than a preset number, it is determined that the arbitration service is normal, and the service of the target nodes is stopped.
[0118] In this embodiment, whether the arbitration service is normal is finally determined by the "voting system" of the number of target nodes, which can improve the fault tolerance of the arbitration service judgment. When the total number of target nodes that are judged to have an abnormal arbitration service is less than the preset number, the arbitration service is finally determined to be normal. At this time, the node that is judged to have an abnormal arbitration server may be judged as abnormal because it cannot connect to the arbitration server due to network connection problems. In order to avoid blocking the client's data business due to the arbitration server's inability to arbitrate, it is necessary to stop the data service of these nodes.
[0119] In actual applications, when more than a preset number of target nodes have received normal heartbeat replies from the arbitration server again, for example, more than 2 / 3 of the target nodes have received normal heartbeat replies from the arbitration server, it can be determined that the arbitration service has returned to normal.
[0120] The embodiments of the present invention have the following advantages: by receiving a write data request from a client for a first storage cluster, and sending the write data request to the first storage cluster and the second storage cluster, receiving response information returned by the first storage cluster and the second storage cluster for the write data request, wherein the response information is used to indicate whether the write data is successful, and updating the survival status of the active-active storage cluster according to the response information, there is no need to establish a heartbeat connection between the first storage cluster and the second storage cluster to update the survival status of the active-active storage cluster, but the survival status of the active-active storage cluster is updated through the response information, which effectively reduces network resource overhead and shortens the waiting time of the client, thereby improving the operating efficiency of the storage system.
[0121] The embodiments of the present invention have the following advantages: by receiving a write data request from a client for a first storage cluster, and sending the write data request to the first storage cluster and the second storage cluster, receiving response information returned by the first storage cluster and the second storage cluster for the write data request, wherein the response information is used to indicate whether the write data is successful, and updating the survival status of the active-active storage cluster according to the response information, there is no need to establish a heartbeat connection between the first storage cluster and the second storage cluster to update the survival status of the active-active storage cluster, but the survival status of the active-active storage cluster is updated through the response information, which effectively reduces network resource overhead and shortens the waiting time of the client, thereby improving the operating efficiency of the storage system.
[0122] Reference Figure 3, shows a schematic diagram of the structure of a data processing device provided by an embodiment of the present invention, which is applied to a storage system, wherein the storage system includes a first storage cluster and a second storage cluster, wherein the first storage cluster and the second storage cluster constitute an active-active storage cluster, and the data processing device may specifically include the following modules:
[0123] The write data processing module 301 is used to receive a write data request from a client for a first storage cluster, and send the write data request to the first storage cluster and a second storage cluster;
[0124] A response information receiving module 302 is used to receive response information returned by the first storage cluster and the second storage cluster in response to the write data request; wherein the response information is used to indicate whether the write data is successful;
[0125] The survival status updating module 303 is used to update the survival status of the active-active storage cluster according to the response information.
[0126] In some embodiments of the present invention, updating the survival status of the active-active storage cluster according to the response information includes:
[0127] Determine a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and stop the service of the target storage cluster;
[0128] The live state of the target storage cluster is updated to a non-live state.
[0129] In some embodiments of the present invention, the storage system further includes an arbitration server, the first storage cluster and the second storage cluster respectively establish a stateful monitoring connection with the arbitration server, and the survival status update module 303 includes:
[0130] An arbitration service confirmation submodule, used to determine whether the arbitration service provided by the arbitration server is normal through the status monitoring connection;
[0131] an arbitration mode processing submodule, configured to, if the arbitration service is normal, determine a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and notify the first storage cluster to stop the service, and / or notify the arbitration server to stop the service of the second storage cluster;
[0132] A configuration information acquisition submodule, used to acquire preset configuration information if the arbitration service is abnormal;
[0133] The static mode processing submodule is used to determine the target storage cluster in the first storage cluster and the second storage cluster according to the configuration information and the response information, and notify the target storage cluster to stop service.
[0134] In some embodiments of the present invention, the arbitration mode processing submodule is further used for:
[0135] If the response information indicates that both the first storage cluster and the second storage cluster fail to write data, the first storage cluster and the second storage cluster are determined as the target storage clusters;
[0136] Notify the first storage cluster to stop service, and notify the arbitration server to stop service of the second storage cluster;
[0137] If the response information indicates that the first storage cluster fails to write data and the second storage cluster succeeds in writing data, determining the first storage cluster as the target storage cluster, and notifying the first storage cluster to stop service;
[0138] If the response information indicates that the first storage cluster writes data successfully and the second storage cluster fails to write data, determining whether the network connection between the first storage cluster and the second storage cluster is normal;
[0139] If the network connection is abnormal, the second storage cluster is determined as the target storage cluster, and the arbitration server is notified to stop the service of the second storage cluster.
[0140] In some embodiments of the present invention, the static mode processing submodule is further used for:
[0141] If the response information indicates that the first storage cluster and the second storage cluster fail to write data, the first storage cluster and the second storage cluster are determined as the target storage clusters;
[0142] If the response information indicates that the first storage cluster fails to write data and the second storage cluster succeeds in writing data, determining the first storage cluster as the target storage cluster;
[0143] If the response information indicates that the first storage cluster successfully writes data and the second storage cluster fails to write data, determining whether the first storage cluster is a preferred end through the configuration information;
[0144] If the first storage cluster is the preferred end, determining the second storage cluster as the target storage cluster;
[0145] If the first storage cluster is not the preferred end, the first storage cluster and the second storage cluster are determined as the target storage clusters.
[0146] In some embodiments of the present invention, the status monitoring connection is a heartbeat connection between the multiple nodes in the at least two storage clusters and the arbitration server, and the arbitration service confirmation submodule is further used to:
[0147] Obtaining a judgment result of the multiple nodes judging whether the arbitration service is normal through the heartbeat connection;
[0148] According to the judgment result, determining the number of target nodes for which the arbitration service is judged to be abnormal;
[0149] If the number of the target nodes is greater than or equal to a preset number, determining that the arbitration service is abnormal;
[0150] If the number of the target nodes is less than the preset number, it is determined that the arbitration service is normal, and the service of the target nodes is stopped.
[0151] In some embodiments of the present invention, the arbitration mode processing submodule is further used for:
[0152] If the network connection is normal, retry sending the write data request to the second storage cluster;
[0153] When the number of retries reaches a preset number, the second storage cluster is determined as the target storage cluster, and the arbitration server is notified to stop the service of the second storage cluster.
[0154] Some embodiments of the present invention further provide an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and the computer program implements the above data processing method when executed by the processor.
[0155] Some embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above data processing method is implemented.
[0156] Some embodiments of the present invention further provide a computer program product, including a computer program, which implements the above data processing method when executed by a processor.
[0157] As for the device 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.
[0158] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0159] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0160] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0161] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0162] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0163] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0164] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0165] Finally, 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 terminal 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 terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.
[0166] The data processing method, apparatus, equipment, and medium provided are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A data processing method, characterized in that: Applied to a storage system, the storage system includes a first storage cluster and a second storage cluster, the first storage cluster and the second storage cluster constitute an active-active storage cluster, the method includes: receiving a write data request from a client for a first storage cluster, and sending the write data request to the first storage cluster and a second storage cluster; Receiving response information returned by the first storage cluster and the second storage cluster in response to the data writing request; wherein the response information is used to indicate whether the data writing is successful; According to the response information, the survival status of the active-active storage cluster is updated.
2. The method according to claim 1, characterized in that The updating of the survival status of the active-active storage cluster according to the response information includes: Determine a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and stop the service of the target storage cluster; The live state of the target storage cluster is updated to a non-live state.
3. The method according to claim 2, characterized in that The storage system further includes an arbitration server, the first storage cluster and the second storage cluster respectively establish a stateful monitoring connection with the arbitration server, and determining a target storage cluster from the first storage cluster and the second storage cluster according to the response information, and stopping the service of the target storage cluster includes: Determining whether the arbitration service provided by the arbitration server is normal through the status monitoring connection; If the arbitration service is normal, determining a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and notifying the first storage cluster to stop the service, and / or notifying the arbitration server to stop the service of the second storage cluster; If the arbitration service is abnormal, obtaining preset configuration information; The target storage cluster is determined in the first storage cluster and the second storage cluster according to the configuration information and the response information, and the target storage cluster is notified to stop the service.
4. The method according to claim 3, characterized in that If the arbitration service is normal, determining a target storage cluster in the first storage cluster and the second storage cluster according to the response information, and notifying the first storage cluster to stop the service, and / or notifying the arbitration server to stop the service of the second storage cluster, includes: If the response information indicates that both the first storage cluster and the second storage cluster fail to write data, the first storage cluster and the second storage cluster are determined as the target storage clusters; Notify the first storage cluster to stop service, and notify the arbitration server to stop service of the second storage cluster; If the response information indicates that the first storage cluster fails to write data and the second storage cluster succeeds in writing data, determining the first storage cluster as the target storage cluster, and notifying the first storage cluster to stop service; If the response information indicates that the first storage cluster writes data successfully and the second storage cluster fails to write data, determining whether the network connection between the first storage cluster and the second storage cluster is normal; If the network connection is abnormal, the second storage cluster is determined as the target storage cluster, and the arbitration server is notified to stop the service of the second storage cluster.
5. The method according to claim 3, characterized in that: The determining the target storage cluster in the first storage cluster and the second storage cluster according to the configuration information and the response information includes: If the response information indicates that the first storage cluster and the second storage cluster fail to write data, the first storage cluster and the second storage cluster are determined as the target storage clusters; If the response information indicates that the first storage cluster fails to write data and the second storage cluster succeeds in writing data, determining the first storage cluster as the target storage cluster; If the response information indicates that the first storage cluster successfully writes data and the second storage cluster fails to write data, determining whether the first storage cluster is a preferred end through the configuration information; If the first storage cluster is the preferred end, determining the second storage cluster as the target storage cluster; If the first storage cluster is not the preferred end, the first storage cluster and the second storage cluster are determined as the target storage clusters.
6. The method according to claim 3, characterized in that The status monitoring connection is a heartbeat connection between the multiple nodes in the at least two storage clusters and the arbitration server, and determining whether the service provided by the arbitration server is normal through the status monitoring connection includes: Obtaining a judgment result of the multiple nodes judging whether the arbitration service is normal through the heartbeat connection; According to the judgment result, determining the number of target nodes for which the arbitration service is judged to be abnormal; If the number of the target nodes is greater than or equal to a preset number, determining that the arbitration service is abnormal; If the number of the target nodes is less than the preset number, it is determined that the arbitration service is normal, and the service of the target nodes is stopped.
7. The method according to claim 4, characterized in that After determining whether the network connection between the first storage cluster and the second storage cluster is normal, the method further includes: If the network connection is normal, retry sending the write data request to the second storage cluster; When the number of retries reaches a preset number, the second storage cluster is determined as the target storage cluster, and the arbitration server is notified to stop the service of the second storage cluster.
8. A data processing device, characterized in that: Applied to a storage system, the storage system includes a first storage cluster and a second storage cluster, the first storage cluster and the second storage cluster constitute an active-active storage cluster, and the device includes: A write data processing module, configured to receive a write data request from a client for a first storage cluster, and send the write data request to the first storage cluster and a second storage cluster; a response information receiving module, configured to receive response information returned by the first storage cluster and the second storage cluster in response to the data writing request; wherein the response information is used to indicate whether the data writing is successful; A survival status update module is used to update the survival status of the active-active storage cluster according to the response information.
9. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the data processing method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data processing method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Cluster distributed type lock management method based on storage area network SAN
CN101252603A
Intelligent dynamic load balancing method for high-speed real-time database
CN102404390A
Method and device for managing main and standby nodes in communication system and high availability cluster
CN106330475A
Block synchronization technology-based active-active system realization method
CN107577564A
Data writing method and device
CN108418859A