Method and application of maintaining data consistency in SCST storage system

Through zookeeper query and aborting suspended I/O, combined with effective tags and service restart, the data inconsistency problem caused by node failure in the SCST storage system is solved, and the abnormal I/O and resource control is achieved quickly, ensuring the system's data consistency and business continuity.

CN113626263BActive Publication Date: 2024-12-10ANCHAO CLOUD SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110920761.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-11
Publication Date
2024-12-10
Estimated Expiration
2041-08-11

AI Technical Summary

Technical Problem

In SCST storage systems, it is difficult to quickly clear suspended I/O operations when node failures, resulting in data inconsistency and resource competition, affecting system availability and business continuity.

Method used

Query system exceptions through zookeeper and abort hanging I/O operations, ensure that other nodes can perform I/O, set valid tags to shorten the I/O abort time, and restart the SCST service or node if necessary to ensure data consistency.

Benefits of technology

It realizes the removal of abnormal I/O within a specified time, avoids resource scrambles, ensures system data consistency and business continuity, and is suitable for high availability and high reliability storage systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113626263B_ABST
    Figure CN113626263B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and application for maintaining data consistency in an SCST storage system, the method comprising the following steps: after the current node logs in, querying the system through zookeeper whether there is an abnormality or other nodes log in; if so, the current node terminates I / O to clear the suspended I / O so that other nodes can execute I / O. The method for maintaining data consistency in the SCST storage system can query the system according to zookeeper to find out that there is an abnormality, and trigger the clearing of suspended I / O operations, so as to ensure that brain split will not occur when other nodes access it later, causing data inconsistency, and ensure data consistency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a method and application for maintaining data consistency in an SCST storage system. Background Art

[0002] With the rapid development and progress of computer technology, the data growth rate is accelerating, requiring that when a node fails due to hardware or software failure, another node can automatically and quickly provide services to the outside world. With the development of network storage technology, network storage is increasingly being put into use, which provides relatively strong support for business continuity and data availability.

[0003] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention

[0004] The purpose of the present invention is to provide a method and application for maintaining data consistency in an SCST storage system, which can detect system abnormalities based on zookeeper queries and trigger the clearing of suspended I / O operations to ensure that brain split will not occur when other nodes access the system subsequently, resulting in data inconsistency and ensuring data consistency.

[0005] To achieve the above objectives, an embodiment of the present invention provides a method for maintaining data consistency in an SCST storage system.

[0006] In one or more embodiments of the present invention, after the current node logs in, the system is queried through Zookeeper to see if there is an abnormality or other nodes are logged in; if so, the current node terminates I / O to clear suspended I / O for other nodes to execute I / O.

[0007] In one or more embodiments of the present invention, the current node determines whether the duration of I / O suspension is greater than a set duration; if so, the current node restarts the SCST service or executes a node restart.

[0008] In one or more embodiments of the present invention, the current node detects whether there is I / O information of other nodes in Zookeeper when logging in; if so, the current node executes disconnection.

[0009] In one or more embodiments of the present invention, the current node adds a valid label to all node I / Os through zookeeper when logging in, and notifies the shared storage to update the valid label to complete the login.

[0010] In another aspect of the present invention, a method for maintaining data consistency in an SCST storage system is provided.

[0011] In one or more embodiments of the present invention, the shared storage receives an I / O write request of the current logged-in node; the shared storage adds a valid tag to the I / O write request and writes the I / O of the current logged-in node.

[0012] In one or more embodiments of the present invention, after the shared storage adds a valid tag to the I / O write request, the I / O with an unupdated tag is discarded.

[0013] In another aspect of the present invention, a device for maintaining data consistency in an SCST storage system is provided, which includes a judgment module and an execution module.

[0014] The judgment module is used to query the system through Zookeeper to see if there are any abnormalities or other nodes have logged in after the current node has logged in.

[0015] The execution module is used for the current node to terminate I / O to clear the suspended I / O so as to allow other nodes to execute I / O.

[0016] In one or more embodiments of the present invention, the judgment module is also used for the current node to judge whether the I / O suspension duration is greater than the set duration; if so, the current node restarts the SCST service or executes a node restart.

[0017] In one or more embodiments of the present invention, the judgment module is further used for the current node to detect whether there is I / O information of other nodes in Zookeeper when logging in; if so, the current node executes disconnection.

[0018] In one or more embodiments of the present invention, the execution module is further used for the current node to add valid labels to all node I / Os through zookeeper when logging in, and to notify the shared storage to update the valid labels to complete the login.

[0019] In another aspect of the present invention, a device for maintaining data consistency in an SCST storage system is provided, which includes a storage module and a writing module.

[0020] The storage module is used for the shared storage to receive the I / O write request of the current login node.

[0021] The writing module is used for the shared storage to add label information to the I / O writing request and write the I / O of the currently logged-in node.

[0022] In one or more embodiments of the present invention, the storage module is further configured to discard the I / O whose tag is not updated after the shared storage adds a valid tag to the I / O write request.

[0023] In another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory, wherein the memory stores instructions, and when the instructions are executed by the at least one processor, the at least one processor executes the method for maintaining data consistency in the SCST storage system as described above.

[0024] In another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for maintaining data consistency in the SCST storage system are implemented.

[0025] Compared with the prior art, the method and application for maintaining data consistency in the SCST storage system according to the implementation mode of the present invention can actively query the system through zookeeper to find out that there are abnormalities, clear the I / O of the current node in time, and ensure that all abnormal I / Os are cleared within the specified time, avoiding the I / O of multiple nodes writing to the shared storage to compete for resources. By setting up shared storage, the time for clearing I / O can be shortened, ensuring that I / O is controllable, and thus ensuring the data consistency of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 is a schematic diagram of a method for maintaining data consistency in an SCST storage system according to an embodiment of the present invention;

[0027] Figure 2 is a structural diagram of a method for maintaining data consistency in an SCST storage system according to an embodiment of the present invention;

[0028] Figure 3 is a system diagram of a method for maintaining data consistency in an SCST storage system according to an embodiment of the present invention;

[0029] Figure 4 is an extended flow chart of a method for maintaining data consistency in an SCST storage system according to an embodiment of the present invention;

[0030] Figure 5 is a node structure diagram of a method for maintaining data consistency in an SCST storage system according to an embodiment of the present invention;

[0031] Figure 6 is a timing diagram of a method for maintaining data consistency in an SCST storage system according to an embodiment of the present invention;

[0032] Figure 7 is an improved flow chart of a method for maintaining data consistency in an SCST storage system according to an embodiment of the present invention;

[0033] Figure 8 is a structural diagram of a device for maintaining data consistency in an SCST storage system according to an embodiment of the present invention;

[0034] Fig. 9 4 is a hardware structure diagram of a computing device for maintaining data consistency in an SCST storage system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation modes.

[0036] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.

[0037] A typical SCST storage system usually consists of four parts, namely, client, VIP, SCST, and shared storage.

[0038] The client is the client component of the iSCSI interface, and the entire system resources are accessed mainly through this process.

[0039] VIP selects which node's resources to use for the client. When the selected node fails, VIP will provide another node for the client to connect to.

[0040] SCST is a common SCSI target subsystem for Linux systems. It provides a unified interface between the Linux kernel and the SCSI target driver. It also provides a handle connection between the Linux kernel and the storage backend, connecting the real or simulated storage backend and the target driver.

[0041] Shared storage is used to store all I / O requests sent by the client, which eventually fall into a set of shared storage through different nodes.

[0042] Under normal circumstances, the user sends a service request, the client requests the VIP, and the VIP provides the appropriate node to the client through the resource selection function. The client performs read and write data operations, and the SCST module in the node receives the request and provides it to the underlying shared storage. When the network is disconnected or the node is abnormal, the VIP will select other nodes to provide to the client.

[0043] The technical solutions provided by various embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0044] Example 1

[0045] like Figure 1 to Figure 2 As shown, a method for maintaining data consistency in an SCST storage system in an embodiment of the present invention is introduced, and the method includes the following steps.

[0046] In step S101, the system is queried through Zookeeper to see if there is any abnormality or other nodes are logged in.

[0047] Zookeeper is a distributed application coordination service. It is a software that provides consistency services for distributed applications. Its functions include configuration maintenance, domain name services, distributed synchronization, group services, etc. The goal of Zookeeper is to encapsulate complex and error-prone key services and provide users with simple and easy-to-use interfaces and efficient and stable systems.

[0048] Under normal circumstances, the client requests the VIP, and the VIP provides the appropriate node to the client through the resource selection function. The client performs read and write data operations, and the SCST module in the node receives the request and provides it to the shared storage.

[0049] For example, the client selects node 1 through VIP to perform a login operation. Node 1 is marked as logged in by zookeeper and I / O is suspended. The purpose is to prevent the I / O of node 1 from passing through to avoid the shared storage from being unable to clear the I / O of the abnormal node in time when the node is abnormal. Zookeeper is used to check the status of node 1 and the status of shared storage respectively. If there is an abnormality in the status of node 1 or the status of shared storage, it means that node 1 cannot meet the client's connection requirements and the system is abnormal. If zookeeper queries that other nodes are marked as logged in, it means that there are I / Os of other nodes in the shared storage. At this time, continuing to execute the I / O request of node 1 will cause the nodes to compete for resources in the shared storage, causing a brain split and data inconsistency.

[0050] In step S102, the current node suspends I / O to clear the suspended I / O so that other nodes can execute I / O.

[0051] When the network is disconnected or the current node is abnormal, VIP will select other nodes to provide to the client, and other nodes will replace the current node to perform read and write data operations.

[0052] For example, when Node 1 is abnormal or the system is abnormal, Node 1 terminates I / O to clear suspended I / O, and Node 2 without abnormality is selected by VIP and provided to the client. Node 2 is logged in by the client to execute the I / O request sent by the client and write the I / O to the shared storage.

[0053] In such an embodiment, it can be avoided that when the VIP selects other nodes for the client to use, there are still pending I / Os on the previous node that continue to write to the underlying shared storage, thereby competing with other nodes for shared resources and causing the possibility of brain split.

[0054] Example 2

[0055] like Figure 3 to Figure 4 As shown, a method for maintaining data consistency in a SCST storage system in another embodiment of the present invention is introduced, and the method includes the following steps.

[0056] In step S201, it is detected whether there is I / O information of other nodes in Zookeeper.

[0057] The I / O information of other nodes includes the existence of other nodes that have been allowed to perform I / O and the existence of unsuspended I / O. Zookeeper queries that other nodes have been allowed to perform I / O, that is, in addition to the current node, VIP has also selected other nodes to provide to the client. The client logs in to other nodes and sends I / O to shared storage. Zookeeper queries that there are unsuspended I / Os, that is, other nodes fail but do not clear the suspended I / O in time, and there are still unsuspended I / Os of other nodes in the shared storage.

[0058] In step S202, the current node performs disconnection.

[0059] When Zookeeper detects the I / O information of other nodes, the current node will no longer continue to perform the login operation and disconnect. If the current node continues to connect to perform the login operation, the system will fail. It is necessary to clear the I / O of other nodes first, then establish the connection of the current node and execute the business sent by the client.

[0060] In step S203, the system is queried through Zookeeper to see if there is any abnormality or other nodes are logged in.

[0061] In step S204, the current node suspends I / O to clear the suspended I / O so that other nodes can execute I / O.

[0062] In step S205, the current node determines whether the I / O suspension duration is greater than a set duration.

[0063] In some specific scenarios, the duration of I / O suspension is too long to meet business needs. For example, Oracle business requires rapid switching when a system failure occurs, but the current node failure switching time can reach 60s, which obviously cannot meet the business needs and needs to be accelerated through other means. In addition, the I / O suspension time will be extended if the I / O reaches the shared storage and cannot be controlled.

[0064] In step S206, the current node restarts the SCST service or executes a node restart.

[0065] Restarting the SCST service on the current node or executing a node restart can quickly terminate the I / O of the current node, shortening the duration of I / O termination and service failover.

[0066] by Figure 3 For example, when node 1 is abnormal, node 1 will actively determine its own abnormality through zookeeper, and then execute the clearing of all suspended I / O operations. After the clearing is successful, the information in zookeeper will be updated, and the current node's own I / O has been cleared. When this I / O is timed out, the SCST service will be restarted or the node will be restarted to ensure that the suspended I / O is cleared. VIP reselects node 2 for the client to log in. Node 2 selected to process I / O will access zookeeper to ensure that the I / O operation requested by the client is executed after node 1 has completed clearing I / O or exceeds the specified time.

[0067] By setting up Zookeeper, abnormal nodes can be helped to proactively determine their own status to trigger the I / O clearing operation, and ensure that all suspended I / Os of the abnormal node are cleared within the specified time. The I / O of the abnormal node is controllable, and the data consistency of the system can be ensured.

[0068] Example 3

[0069] like Figures 5 to 7 As shown, a method for maintaining data consistency in a SCST storage system in another embodiment of the present invention is introduced, and the method includes the following steps.

[0070] In step S301, zookeeper adds valid labels to all node I / Os, and notifies shared storage to update the valid labels.

[0071] Since shared storage only provides storage services through the Posix standard, it is impossible to add maintainable label information through the VFS layer in the SCST storage system. However, the I / O existing in the SCST storage system can be effectively managed and terminated, so only the problem of uncontrollable I / O after reaching the shared storage needs to be solved.

[0072] VFS, called virtual file system or virtual file system conversion, is a kernel software layer, an abstract layer above the specific file system, used to handle all calls related to the Posix file system. It can provide a common interface for various file systems, so that upper-level applications can use the common interface to access different file systems. It also provides a medium for communication between different file systems.

[0073] In this embodiment, after the current node is selected by VIP to log in, the I / O connection is established normally, and the login information and label information in Zookeeper are updated. Zookeeper adds valid labels to all node I / Os. Label information can be added when I / O is written to the VFS layer. By updating the valid label information in the shared storage to maintain I / O, the time for terminating I / O and the time for service failure switching can be greatly shortened.

[0074] In step S302, the shared storage receives the I / O write request of the current login node, adds a valid tag to the I / O write request, and writes the I / O of the current login node.

[0075] After querying the system through zookeeper to see if there are any abnormalities or other nodes have logged in, the client performs a write operation. The client sends an I / O write request to the current login node, and the current login node sends the I / O write request to the shared storage so that the I / O in the system can be controlled autonomously. If there is no abnormality in the current login node, a valid label is added to the I / O in the shared storage. Otherwise, the label of the I / O is not updated.

[0076] In step S303, the I / Os whose tags are not updated are discarded.

[0077] If the current node has an exception and cannot execute the business request sent by the client, the I / O label of the current node will not be updated. Only when the current node has no exception and can provide business services, the label of the current node I / O will be updated in the shared storage. When VIP re-selects other nodes for the client to execute the business request, other nodes will discard the I / O whose labels have not been updated before after updating the label information in the shared storage, which can ensure that there is no resource competition for the I / O of other nodes in the shared storage.

[0078] By setting label information, the I / O fault switching time can be shortened, which can meet the business scenarios with high requirements for I / O fault switching, and the I / O in the system is autonomous and controllable, ensuring that the data written by the normal node will not be overwritten, ensuring the data consistency of the system. Compared with the method in Example 2, when the node is normal, this embodiment can successfully terminate the I / O of other nodes by discarding expired I / O. In Example 2, terminating I / O may fail. If terminating I / O fails, the SCST service or the entire physical node needs to be restarted.

[0079] like Figure 8 As shown, a specific implementation of the device for maintaining data consistency in the SCST storage system of the present invention is introduced.

[0080] In an embodiment of the present invention, the device for maintaining data consistency in the SCST storage system includes a judgment module 801, an execution module 802, a storage module 803 and a writing module 804.

[0081] The judgment module 801 is used to query the system through Zookeeper whether there is an abnormality or other nodes are logged in after the current node logs in.

[0082] The execution module 802 is used for the current node to terminate I / O to clear the suspended I / O so that other nodes can execute I / O.

[0083] The judgment module 801 is also used for the current node to judge whether the I / O suspension duration is greater than the set duration; if so, the current node restarts the SCST service or executes the node restart.

[0084] The judgment module 801 is also used for the current node to detect whether there is I / O information of other nodes in Zookeeper when logging in; if so, the current node executes disconnection.

[0085] The execution module 802 is also used for adding valid labels to all node I / Os through zookeeper when the current node logs in, and notifying the shared storage to update the valid labels to complete the login.

[0086] The storage module 803 is used for the shared storage to receive the I / O write request of the current login node.

[0087] The writing module 804 is used for the shared storage to add label information to the I / O writing request and write the I / O of the current login node.

[0088] The storage module 803 is further configured to discard the I / O whose tag is not updated after the shared storage adds a valid tag to the I / O write request.

[0089] Fig. 9FIG. 1 shows a hardware structure diagram of a computing device 90 for maintaining data consistency in an SCST storage system according to an embodiment of the present specification. Fig. 9 As shown, the computing device 90 may include at least one processor 901, a memory 902 (e.g., a non-volatile memory), a memory 903, and a communication interface 904, and the at least one processor 901, the memory 902, the memory 903, and the communication interface 904 are connected together via a bus 905. The at least one processor 901 executes at least one computer-readable instruction stored or encoded in the memory 902.

[0090] It should be understood that the computer executable instructions stored in the memory 902, when executed, cause at least one processor 901 to perform the above combined operations in various embodiments of this specification. Figure 1-9 Describes the various operations and functions.

[0091] In the embodiments of the present specification, the computing device 90 may include, but is not limited to, a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile computing device, a smart phone, a tablet computer, a cellular phone, a personal digital assistant (PDA), a handheld device, a messaging device, a wearable computing device, a consumer electronic device, and the like.

[0092] According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (i.e., the above-mentioned elements implemented in the form of software), which, when executed by a machine, causes the machine to perform the above-mentioned combination of various embodiments of this specification. Figure 1-9 Specifically, a system or device equipped with a readable storage medium may be provided, on which a software program code implementing the functions of any of the above-mentioned embodiments is stored, and a computer or processor of the system or device reads and executes the instructions stored in the readable storage medium.

[0093] According to the method and application of maintaining data consistency in the SCST storage system of the embodiment of the present invention, the system can be actively queried through Zookeeper to find out that there are abnormalities, and the I / O of the current node can be cleared in time, and all abnormal I / O can be cleared within the specified time, avoiding the I / O of multiple nodes writing to the shared storage to compete for resources. By setting up shared storage, the time for clearing I / O can be shortened, and the I / O can be controlled, thereby ensuring the data consistency of the system.

[0094] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, 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 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 code.

[0095] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to 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 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 device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing 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.

[0096] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising 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.

[0097] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0098] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.

Claims

1. A method for maintaining data consistency in an SCST storage system, It is characterized in that The following steps are involved: After the current node logs in, it queries the system through Zookeeper to see if there are any exceptions or other nodes have logged in. When logging in, the current node adds valid tags to all node I / Os through Zookeeper, and notifies the shared storage to update the valid tags to complete the login; If the current login node is abnormal, the label of the I / O is not updated in the shared storage, and the current node suspends the I / O to clear the suspended I / O so that other nodes can execute the I / O; If the current login node is normal, add a valid tag to the I / O in the shared storage; The shared storage receives the I / O write request of the current login node, adds a valid label to the I / O write request, and writes the I / O of the current login node. After the shared storage adds the valid label to the I / O write request, the I / O with the unupdated label is discarded.

2. The method for maintaining data consistency in the SCST storage system according to claim 1, It is characterized in that The method further comprises: The current node determines whether the I / O suspension duration is greater than the set duration; If so, the current node restarts the SCST service or executes a node restart.

3. The method for maintaining data consistency in the SCST storage system according to claim 1, It is characterized in that The method further comprises: The current node detects whether there is I / O information of other nodes in Zookeeper when logging in; if so, The current node performs disconnection.

4. A device for maintaining data consistency in an SCST storage system, It is characterized in that The device comprises: A judgment module is used to query the system through Zookeeper whether there is an abnormality or other nodes are logged in after the current node logs in. The current node adds a valid label to all node I / Os through Zookeeper when logging in, and notifies the shared storage to update the valid label to complete the login; and An execution module is used to add a valid label to all node I / Os through Zookeeper when the current node logs in, and to notify the shared storage to update the valid label to complete the login, and when an abnormality occurs in the current login node, to cause the current node to suspend I / O to clear the suspended I / O so that other nodes can execute I / O; The write module is used to add a valid tag to the I / O in the shared storage, add a valid tag to the I / O write request, and write the I / O of the current login node when there is no abnormality in the current login node; The storage module is used for receiving the I / O write request of the current login node for the shared storage, and discarding the I / O with the unupdated label after the shared storage adds a valid label to the I / O write request.

5. An electronic device, It is characterized in that include: at least one processor; as well as A memory storing instructions, which, when executed by the at least one processor, causes the at least one processor to execute the method for maintaining data consistency in the SCST storage system according to any one of claims 1 to 3.

6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for maintaining data consistency in the SCST storage system as described in any one of claims 1 to 3.