CN115268788A - IO disorder detection method, device, equipment and storage medium - Google Patents

IO disorder detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN115268788A
CN115268788A CN202210903305.8A CN202210903305A CN115268788A CN 115268788 A CN115268788 A CN 115268788A CN 202210903305 A CN202210903305 A CN 202210903305A CN 115268788 A CN115268788 A CN 115268788A
Authority
CN
China
Prior art keywords
data
submitted
node
hit interval
uncommitted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210903305.8A
Other languages
Chinese (zh)
Inventor
孔超
吴学含
程霄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202210903305.8A priority Critical patent/CN115268788A/en
Publication of CN115268788A publication Critical patent/CN115268788A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0635Configuration or reconfiguration of storage systems by changing the path, e.g. traffic rerouting, path reconfiguration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket

Abstract

The application relates to the field of computer storage access, and provides an IO out-of-order detection method, device, equipment and storage medium. The method comprises the following steps: deleting tag nodes of IO data to be submitted from an IO hit interval tree, wherein the IO hit interval tree comprises a plurality of tag nodes, and each tag node represents: label information of corresponding uncommitted IO data; executing query operation on the IO hit interval tree, and determining label nodes overlapped with the IO hit intervals of the IO data to be submitted as corresponding target query nodes; and finally, performing IO out-of-order detection on the IO data to be submitted based on the obtained target query nodes to obtain corresponding detection results. By adopting the IO disorder detection method provided by the embodiment of the application, the IO disorder problem can be detected more easily in an IO data submission link, the detection difficulty of the IO disorder problem is reduced, and the problem detection time and the labor detection cost are saved.

Description

IO disorder detection method, device, equipment and storage medium
Technical Field
The application relates to the field of computer storage access, and provides an IO out-of-order detection method, device, equipment and storage medium.
Background
In the development process of the storage system, ensuring data consistency is the most basic function, and submitting Input Output (Input Output) data to the underlying storage device according to the receiving sequence of the storage system is a necessary condition for ensuring data consistency.
Inside the storage system, the IO data are usually processed according to the data distribution sequence. However, in order to meet the requirement of a specific service, the storage system processes the IO data by operations such as suspending the IO data and splitting the IO data, which disturbs the original IO data issuing sequence.
When the submission sequence of the IO data is inconsistent with the original receiving sequence, the IO disorder problem occurs. Because the IO disorder problem has dynamic and transient properties, the problem is difficult to locate in the development process. Even if an abnormal condition exists during data submission, the IO disorder problem is difficult to be checked through a large amount of IO log information.
Disclosure of Invention
The embodiment of the application provides an IO disorder detection method, device, equipment and storage medium, and aims to solve the problem of high detection difficulty of the IO disorder problem.
In a first aspect, an embodiment of the present application provides an IO out-of-order detection method, including:
deleting tag nodes of IO data to be submitted from an IO hit interval tree, wherein the IO hit interval tree comprises a plurality of tag nodes, and each tag node is characterized in that: label information of corresponding uncommitted IO data;
executing query operation on the IO hit interval tree, and determining label nodes overlapped with the IO hit intervals of the IO data to be submitted as corresponding target query nodes;
and carrying out IO out-of-order detection on the IO data to be submitted based on the obtained target query nodes to obtain corresponding detection results.
Optionally, the executing the query operation on the IO hit interval tree, and determining a label node overlapping with the IO hit interval of the IO data to be submitted as a corresponding target query node includes:
traversing a root node of the IO hit interval tree, and determining the root node as the target query node when the root node corresponds to the IO hit interval of the uncommitted IO data and the IO data to be submitted, and the read-write type of at least one IO data is the write type;
when the maximum IO hit interval ending sector index maintained by the right child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted and the IO hit interval starting sector index of the right child node does not exceed the IO hit interval ending sector index of the IO data to be submitted, performing recursive traversal on a subtree constructed by the right child node, and determining a label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node;
and when the maximum IO hit interval ending sector index maintained by the left child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted, performing recursive traversal on the subtree constructed by the left child node, and determining the label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node.
Optionally, the performing, based on the obtained target query nodes, IO out-of-order detection on the IO data to be submitted to obtain corresponding detection results includes:
detecting whether IO disorder exists in the IO data to be submitted or not by comparing the serial numbers between the IO data to be submitted and the target query nodes;
if the serial number of the IO data to be submitted does not exceed the serial number of at least one target query node, the detection result indicates that IO disorder does not exist in the IO data to be submitted;
and if the serial number of the IO data to be submitted is larger than the maximum serial number in each target query node, determining that the IO data to be submitted has IO disorder according to the detection result.
Optionally, before deleting the tag node of the IO data to be submitted from the IO hit interval tree, the method further includes:
configuring label information for each uncommitted IO data respectively, wherein each label information comprises: and the serial number, the read-write type and the IO hit interval of the corresponding uncommitted IO data.
Optionally, for an uncommitted IO data, the following method is adopted to configure a corresponding serial number:
if the uncommitted IO data is obtained based on a data packet sent by the client, generating a serial number of the uncommitted IO data based on the distributed maximum historical serial number;
if the uncommitted IO data is obtained based on the received uncommitted IO data, generating a serial number of the uncommitted IO data based on the serial number of the received uncommitted IO data.
In a second aspect, an embodiment of the present application further provides an IO out-of-order detection apparatus, including:
the deleting unit is used for deleting the tag nodes of the IO data to be submitted from an IO hit interval tree, wherein the IO hit interval tree comprises a plurality of tag nodes, and each tag node represents: label information of corresponding uncommitted IO data;
the query unit is used for executing query operation on the IO hit interval tree and determining the label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node;
and the detection unit is used for carrying out IO out-of-order detection on the IO data to be submitted based on the obtained target query nodes to obtain corresponding detection results.
Optionally, the querying unit is configured to:
traversing a root node of the IO hit interval tree, and determining the root node as the target query node when the root node corresponds to an IO hit interval in which the IO data not submitted and the IO data to be submitted are overlapped and the read-write type of at least one IO data is a write type;
when the maximum IO hit interval ending sector index maintained by the right child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted and the IO hit interval starting sector index of the right child node does not exceed the IO hit interval ending sector index of the IO data to be submitted, performing recursive traversal on a subtree constructed by the right child node, and determining a label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node;
and when the maximum IO hit interval ending sector index maintained by the left child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted, performing recursive traversal on a subtree constructed by the left child node, and determining a label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node.
Optionally, the detection unit is configured to:
detecting whether IO disorder exists in the IO data to be submitted or not by comparing the serial numbers between the IO data to be submitted and the target query nodes;
if the serial number of the IO data to be submitted does not exceed the serial number of at least one target query node, the detection result indicates that IO disorder does not exist in the IO data to be submitted;
and if the serial number of the IO data to be submitted is larger than the maximum serial number in each target query node, determining that the IO data to be submitted has IO disorder according to the detection result.
Optionally, before deleting the tag node of the IO data to be submitted from the IO hit interval tree, the IO out-of-order detection apparatus further includes a tag information allocation unit, where the tag information allocation unit is configured to:
configuring label information for each uncommitted IO data respectively, wherein each label information comprises: and the serial number, the read-write type and the IO hit interval of the corresponding uncommitted IO data.
Optionally, for an uncommitted IO data, the tag information allocating unit configures a corresponding serial number in the following manner:
if the uncommitted IO data is obtained based on a data packet sent by the client, generating a serial number of the uncommitted IO data based on the distributed maximum historical serial number;
if the uncommitted IO data is obtained based on the received uncommitted IO data, generating a serial number of the uncommitted IO data based on the serial number of the received uncommitted IO data.
In a third aspect, an embodiment of the present application further provides a computer device, including a processor and a memory, where the memory stores a program code, and when the program code is executed by the processor, the processor is caused to execute the steps of any one of the IO out-of-order detection methods.
In a fourth aspect, this application further provides a computer-readable storage medium including program code for causing a computer device to perform any one of the steps of the IO out-of-order detection method when the program product runs on the computer device.
The beneficial effect of this application is as follows:
the embodiment of the application provides an IO out-of-order detection method, an IO out-of-order detection device, IO out-of-order detection equipment and a storage medium, wherein the method comprises the following steps: deleting tag nodes of IO data to be submitted from an IO hit interval tree, wherein the IO hit interval tree comprises a plurality of tag nodes, and each tag node represents: label information of corresponding uncommitted IO data; executing query operation on the IO hit interval tree, and determining label nodes overlapped with the IO hit intervals of the IO data to be submitted as corresponding target query nodes; and finally, carrying out IO out-of-order detection on the IO data to be submitted based on the obtained target query nodes to obtain corresponding detection results.
By adopting the IO out-of-order detection method provided by the embodiment of the application, the target query nodes overlapped with the IO hit intervals of the IO data to be submitted are obtained by querying the IO hit interval tree, and then whether the IO out-of-order problem occurs to the IO data to be submitted is detected based on the obtained target query nodes, so that the IO out-of-order problem can be more easily detected in an IO data submission link, the detection difficulty of the IO out-of-order problem is reduced, and the problem detection time and the labor detection cost are saved. In addition, the IO out-of-order detection method provided by the embodiment of the application does not need to redevelop part of modules of the storage system, and can also reduce the development difficulty of the storage system.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is an alternative schematic diagram of an application scenario in an embodiment of the present application;
fig. 2A is a schematic flow chart of an IO out-of-order detection method provided in the embodiment of the present application;
FIG. 2B is a schematic diagram of a coloring operation provided by an embodiment of the present application;
FIG. 2C is a schematic diagram illustrating a right-hand operation provided by an embodiment of the present application;
FIG. 2D is a schematic diagram illustrating left-handed and right-handed operations according to an embodiment of the present disclosure;
fig. 2E is a schematic diagram of an IO hit interval tree according to an embodiment of the present application;
fig. 3A is a system architecture diagram of one of the storage systems provided in the embodiments of the present application;
fig. 3B is a schematic flowchart of a process of performing IO out-of-order detection on IO data to be submitted by the storage system according to the embodiment of the present application;
fig. 4 is a schematic structural diagram of an IO out-of-order detection apparatus according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a component structure of a computer device provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a computing device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the technical solutions of the present application. All other embodiments obtained by a person skilled in the art without any inventive step based on the embodiments described in the present application are within the scope of the protection of the present application.
The following briefly introduces the design concept of the embodiments of the present application:
in the development process of the storage system, ensuring data consistency is the most basic function, and submitting Input/Output (Input Output) data to the underlying storage device according to the receiving sequence of the storage system is a necessary condition for ensuring data consistency.
Inside the storage system, the IO data are usually processed in the data issuing order. However, in order to meet the requirements of specific services, the storage system processes IO data by using operations such as suspending IO data and splitting IO data, which disturbs the original issuing sequence of IO data, resulting in inconsistent submission sequence of IO data and the original receiving sequence, and generating an IO disorder problem.
For example, in a storage system supporting the snapshot feature, it is necessary to make a first write copy on issued write IO data. When the first write copy is executed, the storage system firstly suspends the write IO data, then generates corresponding first write copy IO data based on the write IO data, and after the first write copy IO data is executed, the storage system continuously issues the original write IO data. However, during the period of time when the write IO data is suspended, if the IO hit interval of the subsequent IO data overlaps with the IO hit interval of the write IO data, the storage system needs to suspend the subsequent IO data, and after the write IO data is executed, the subsequent IO data is processed again.
In addition, when the storage system calls multithreading to process the IO data, the issue of IO disorder may be caused by inconsistency between the submission order of the IO data and the original receiving order due to unexpected concurrency problem.
Because the IO disorder problem has dynamic and transient properties, the problem is difficult to locate in the development process. Even if an abnormal condition exists during data submission, the IO disorder problem is difficult to be checked through a large amount of IO log information.
In view of this, an embodiment of the present application provides an IO out-of-order detection method. The method comprises the following steps: deleting tag nodes of IO data to be submitted from an IO hit interval tree, wherein the IO hit interval tree comprises a plurality of tag nodes, and each tag node is characterized in that: label information of corresponding uncommitted IO data; executing query operation on the IO hit interval tree, and determining label nodes overlapped with the IO hit intervals of the IO data to be submitted as corresponding target query nodes; and finally, carrying out IO out-of-order detection on the IO data to be submitted based on the obtained target query nodes to obtain corresponding detection results.
By adopting the IO disorder detection method provided by the embodiment of the application, the target query node overlapped with the IO hit interval of the IO data to be submitted is obtained by querying from the IO hit interval tree, and then whether the IO data to be submitted has the IO disorder problem is detected based on the obtained target query nodes, so that the IO disorder problem is more easily detected in the IO data submission link, the detection difficulty of the IO disorder problem is reduced, and the problem detection time and the labor detection cost are saved. In addition, the IO out-of-order detection method provided by the embodiment of the application does not need to redevelop part of modules of the storage system, and can also reduce the development difficulty of the storage system.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it should be understood that the preferred embodiments described herein are merely for illustrating and explaining the present application, and are not intended to limit the present application, and that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Fig. 1 shows one of the application scenarios, which includes two physical terminal devices 110 and one server 130, and the physical terminal devices 110 and the server 130 communicate with each other using a wired network or a wireless network.
The client 120, running on the physical end device 110, continuously sends data packets to the storage system of the server 130. The storage system deployed on the server 130 processes the received data packet into an IO data stream, and configures tag information for each uncommitted IO data of the IO data stream. For new uncommitted IO data generated based on special types of uncommitted IO data such as first-write copy, the storage system also configures corresponding label information for the new uncommitted IO data. And finally, the storage system inserts the label information of each uncommitted IO data into the IO hit interval tree.
In an IO data submission link, a storage system deletes a tag node of IO data to be submitted from an IO hit interval tree, and determines the tag node which is overlapped with the IO hit interval of the IO data to be submitted in the IO hit interval tree as a corresponding target query node; and finally, carrying out IO out-of-order detection on the IO data to be submitted based on the obtained target query nodes to obtain corresponding detection results.
In the embodiment of the present application, the physical terminal device 110 is an electronic device used by a user. Specifically, the electronic device may be a personal computer, a mobile phone, a tablet computer, a notebook, an electronic book reader, a smart home, or other computer device with certain computing capabilities.
In this embodiment, the server 130 may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), and a big data and artificial intelligence platform, which is not limited herein.
Next, the IO out-of-order detection method provided in the embodiment of the present application is continuously described, and a specific detection process is shown in fig. 2A.
S201: the storage system deletes the tag node of the IO data to be submitted from the IO hit interval tree, wherein the IO hit interval tree comprises a plurality of tag nodes, and each tag node is characterized in that: and correspondingly, label information of the IO data is not submitted.
Before step 201 is executed, tag information is configured for each received uncommitted IO data, where each tag information includes: and the serial number, the read-write type and the IO hit interval of the corresponding uncommitted IO data. The operation of configuring the tag information is also called buying tickets, and is used for configuring the tag information for each uncommitted IO data and constructing an IO hit interval tree based on each tag information.
The sequence number is a monotonically increasing integer value, and from 1, the sequence number is incremented by 1 every time one tag information is configured. Generally, when a serial number of uncommitted IO data is generated, an interval tree query interface needs to be called first to query an IO hit interval tree, and if label nodes overlapped with IO hit intervals are queried, the serial number of the uncommitted IO data is generated based on a corresponding maximum historical serial number; if the label node with the overlapped IO hit interval is not inquired, the serial number of the uncommitted IO data is set to be 1. However, to reduce the query overhead of the IO hit interval tree, the tag assignment device of the storage system only records the most recently assigned maximum historical sequence number for generating the next assigned sequence number.
For an uncommitted IO data x, a corresponding serial number is configured in the following manner:
mode 1: if the uncommitted IO data x is obtained based on a data packet sent by the client, generating a serial number of the uncommitted IO data x based on the allocated maximum historical serial number.
For example, if the maximum historical sequence number recorded in the tag assigning apparatus is 27, the sequence number assigned to the uncommitted IO data x is 28.
Mode 2: if the uncommitted IO data x is obtained based on the received uncommitted IO data, a serial number of the uncommitted IO data x is generated based on the serial number of the received uncommitted IO data.
Assuming that the serial number of the received uncommitted IO data is 5, if the uncommitted IO data x is obtained based on the received uncommitted IO data and it is specified that the uncommitted IO data x performs a commit operation earlier than the received uncommitted IO data, subtracting 1 from the serial number of the received uncommitted IO data x to obtain a serial number 4 of the uncommitted IO data x.
Assuming that the serial number of the received uncommitted IO data is 5, if the uncommitted IO data x is obtained based on the received uncommitted IO data and it is specified that the uncommitted IO data x performs a commit operation later than the received uncommitted IO data, adding 1 to the serial number of the received uncommitted IO data to obtain a serial number 6 of the uncommitted IO data x.
The read-write type includes reading IO data and writing IO data, and the IO hit interval refers to a read-write address range of the uncommitted IO data, i.e. address information of "from which sector of the storage device, IO data of several sectors are read", so that the IO hit interval can be represented by a closed interval [ a, b ]. The left value a of the closed interval is called an IO hit interval initial sector index and represents an index number of a first sector of an IO address range; the right value b of the closed interval is called the IO hit interval end sector index, which indicates the index number of the last sector of the IO address range.
Assuming that the length of the IO address range is c sectors, a, b, c satisfy the following relationship:
(1) C >0, because the uncommitted IO data must be of length, otherwise the data is meaningless;
(2) B = a + c-1, since b is the last sector of the IO address range and is contained in the IO address range, 1 needs to be subtracted;
(3)、b≥a≥0。
after configuring the tag information of each uncommitted IO data, inserting each tag information into an IO hit interval tree.
If the uncommitted IO data of all the allocated tag information is recorded by using a data structure such as a linear table, the time complexity of operations such as insertion, deletion, query and the like is all O (n), and especially when the uncommitted IO data meeting the conditions is more, it takes a long time to complete the IO out-of-order detection. Therefore, in the embodiment of the application, the data structure of the interval tree is used for recording the IO data, and the complexity of the insertion and deletion operation time is
Figure BDA0003771699020000101
The query operation is
Figure BDA0003771699020000102
k is a constant, and the value of k is equal to the number of tag nodes overlapping the IO hit interval of the IO data to be submitted.
The essence of the interval tree is a binary red-black tree, which is a binary red-black tree and also a binary sequencing tree capable of realizing self-balancing. The binary red-black tree is additionally provided with the following requirements on the basis of the original binary tree for sequencing:
(1) The root node must be black;
(2) The node colors of the parent node and the child node cannot be red at the same time;
(3) The path from the root node to any leaf node must contain the same number of black nodes.
And if the current IO hit interval tree of the previous round cannot meet the requirements at the same time, operations such as left rotation, right rotation, coloring and the like are adopted to readjust the current IO hit interval tree of the previous round.
For ease of understanding, the operations of left-handed rotation, right-handed rotation, coloring, etc. are described in several specific examples.
(1) Coloring operation:
as shown in fig. 2B, a tab node with index 5 (simply referred to as "insert node") is inserted, and since the node color of parent node 4 and insert node 5 are both red, the node color of parent node 6 is adjusted to red, and the node colors of parent node 4 and sibling node 8 are adjusted to black. But at this time, the IO hit interval tree still does not meet the second requirement, and the node colors of the child nodes 3 and 12 are continuously adjusted to be black, so that the self-balanced IO hit interval tree is obtained.
(2) And D, right rotation:
as shown in fig. 2C, inserting a label node with index 13 (referred to as "insert node"), since the node colors of the parent node 15 and the insert node 13 are red at the same time, and there is no sibling node in the parent node 15, calling a right _ rotate (tree) interface, and performing a right-handed operation on the left sub-tree constructed by the parent node 20, to obtain a binary tree constructed by taking the parent node 15 as a root node, so that the adjusted IO hit interval tree is balanced.
(3) Levogyration + dextrorotation:
as shown in fig. 2D, inserting a label node with index 17 (referred to as "insert node"), since the node colors of the parent node 15 and the insert node 17 are red at the same time, and there is no sibling node in the parent node 15, calling a left _ rotate interface, performing a left-handed operation on the right sub-tree constructed by the parent node 15, obtaining a left sub-tree constructed by the insert node 17 as the root node,
but at this time, the IO hit interval tree still does not meet the second requirement, a right _ rotate (tree) interface is called, a right-handed operation is performed on the left sub-tree constructed by the parent node 20, a binary tree constructed by taking the insertion node 17 as a root node is obtained, the node color of the insertion node 17 is adjusted to be black, and the node color of the leaf node 20 is adjusted to be red, so that the adjusted IO hit interval tree is kept balanced.
The embodiment of the application realizes the operations of inserting, deleting, inquiring, left-turning and the like by calling the corresponding interface. Compared with the common interfaces of the binary red-black tree, the interfaces used in the embodiment of the application increase the maintenance operation on the maximum value of each label node on the basis of not improving the time complexity of the interfaces.
Each label node includes the following elements: sequence (sequence, seq), index (key), maximum (max value), left sub-tree pointer (left), right sub-tree pointer (right), parent node pointer (parent), node color (black or red). Except for the sequence number, the other elements are elements of the interval tree itself.
The key value refers to the initial sector index of the IO hit interval, and the maximum value refers to the final sector index of the largest IO hit interval in the subtree constructed by the current tag node. For example, an IO hit interval tree as shown in fig. 2E is constructed based on the allocated tag information, and the maximum value of each tag node is the sector index of the largest IO hit interval ending in the subtree constructed by the current tag node.
In an IO data submission link, calling an interval tree deleting interface, deleting a tag node of IO data to be submitted from an IO hit interval tree, calling an interval tree replacing interface to execute subtree replacement operation, and repairing the IO hit interval tree so as to avoid misjudging IO disorder caused by taking the IO data to be submitted as a target query node overlapped by the IO hit intervals.
S202: the storage system executes query operation on the IO hit interval tree, and determines the label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node.
In an IO data submission link, traversing a root node of an IO hit interval tree, and determining the root node as a target query node when the root node corresponds to an IO hit interval of uncommitted IO data and IO data to be submitted to be overlapped, and the read-write type of at least one IO data is a write type.
When the two IO data read out of order, the correct data content read by the IO data cannot be influenced, so that when the target query node is determined, only the IO hit interval overlapped with the IO data to be submitted is considered, and the read-write type of at least one IO data is the root node of the write type.
When the maximum IO hit interval ending sector index maintained by the right child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted and the IO hit interval starting index of the right child node does not exceed the IO hit interval ending sector index of the IO data to be submitted, the label node which is overlapped with the IO hit interval of the IO data to be submitted may exist in the subtree constructed by the right child node, so that the subtree constructed by the right child node is subjected to recursive traversal, and the label node which is overlapped with the IO hit interval of the IO data to be submitted is determined as a corresponding target query node;
when the maximum IO hit interval ending sector index maintained by the left child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted, it indicates that a label node overlapping with the IO hit interval of the IO data to be submitted may exist in the subtree constructed by the left child node, and therefore, the subtree constructed by the left child node is subjected to recursive traversal, and the label node overlapping with the IO hit interval of the IO data to be submitted is determined as a corresponding target query node.
S203: and the storage system performs IO out-of-order detection on the IO data to be submitted based on the obtained target query nodes to obtain corresponding detection results.
In order to ensure that the submission sequence and the issuing sequence of the IO data are consistent, the first issued IO data is specified, and the submission operation is executed first, or the submission operation is executed first on part of the newly generated IO data. Therefore, whether IO disorder exists in the IO data to be submitted can be detected by comparing the serial numbers between the IO data to be submitted and each target query node;
if the serial number of the IO data to be submitted does not exceed the serial number of at least one target query node, the detection result indicates that IO disorder does not exist in the IO data to be submitted; and if the serial number of the IO data to be submitted is larger than the maximum serial number in each target query node, determining that the IO data to be submitted has IO disorder according to the detection result.
In addition, in order to shorten the detection time, a better embodiment is also provided. Acquiring a maximum serial number from serial numbers of all target query nodes, comparing the serial number of the IO data to be submitted with the maximum serial number, and if the serial number of the IO data to be submitted does not exceed the maximum serial number, determining that IO disorder does not exist in the IO data to be submitted according to a detection result; and if the serial number of the IO data to be submitted is larger than the maximum serial number, the detection result indicates that IO disorder exists in the IO data to be submitted.
By adopting the IO disorder detection method provided by the embodiment of the application, the target query node overlapped with the IO hit interval of the IO data to be submitted is obtained by querying from the IO hit interval tree, and then whether the IO data to be submitted has the IO disorder problem is detected by comparing the serial numbers of the IO data to be submitted and each target query node, so that the IO disorder problem is more easily detected in the IO data submission link, the detection difficulty of the IO disorder problem is reduced, the problem detection time and the labor detection cost are saved, and the alarm information can be sent after the IO disorder problem is detected, so that developers can conveniently locate the IO data with the IO disorder problem, and the abnormal problem is solved. In addition, the IO out-of-order detection method provided by the embodiment of the application does not need to redevelop part of modules of the storage system, and can also reduce the development difficulty of the storage system.
The IO out-of-order detection method provided by the embodiment of the application is suitable for any stack type storage system which needs to ensure that the submission sequence and the issuing sequence of the IO data are consistent. FIG. 3A illustrates one of the storage systems, the storage system comprising: the system comprises a management configuration module, a transmission module, a logical volume module, a snapshot module, a label information distribution device, an IO disorder detection device, a block equipment module and a driving module.
Referring to the flowchart shown in fig. 3B, the process of performing IO out-of-order detection on IO data to be submitted by the storage system shown in fig. 3A is as follows:
s301: a transmission module of the storage system receives data packets issued by a client and stores the received data packets in a queue form;
s302: the transmission equipment of the transmission module reads a data packet from the queue, generates corresponding IO data by analyzing the data packet, and sends the generated IO data to a corresponding logical volume of the logical volume module;
s303: a label information distribution device of the storage system distributes label information for IO data issued to the corresponding logical volume;
s304: the logical volume sends the IO data of the distributed label information to a snapshot module of the storage system;
s305: the snapshot component judges whether the IO data needs to be subjected to first-write copying, if so, step 306 is executed; otherwise, go to step 307;
s306: the label information distribution device distributes label information for the newly generated IO data;
s307: the snapshot component sends the IO data of the distributed label information to the block equipment module;
s308: the block device of the block device module sends the IO data to be submitted to the driving module;
s309: the IO disorder detection device performs IO disorder detection on IO data to be submitted in the driving module and outputs a corresponding detection result;
s310: the storage system judges whether the data packets sent by the client are processed completely, if so, the flow is ended; otherwise, return to step 302.
The embodiment of the application also provides an IO disorder detection device based on the same inventive concept as the embodiment of the method. As shown in fig. 4, the IO out-of-order detection apparatus 400 may include:
a deleting unit 401, configured to delete a tag node of IO data to be submitted from an IO hit interval tree, where the IO hit interval tree includes multiple tag nodes, and each tag node represents: label information of corresponding uncommitted IO data;
a query unit 402, configured to perform a query operation on the IO hit interval tree, and determine a tag node that overlaps with an IO hit interval of IO data to be submitted as a corresponding target query node;
the detecting unit 403 is configured to perform IO out-of-order detection on IO data to be submitted based on the obtained target query nodes, so as to obtain corresponding detection results.
Optionally, the querying unit 402 is configured to:
traversing a root node of an IO hit interval tree, and determining the root node as a target query node when the root node is overlapped with an IO hit interval corresponding to uncommitted IO data and IO data to be submitted, and the read-write type of at least one IO data is a write type;
when the maximum IO hit interval ending sector index maintained by the right child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted and the IO hit interval starting sector index of the right child node does not exceed the IO hit interval ending sector index of the IO data to be submitted, performing recursive traversal on a sub-tree constructed by the right child node, and determining a label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node;
and when the maximum IO hit interval ending sector index maintained by the left child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted, performing recursive traversal on the subtree constructed by the left child node, and determining the label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node.
Optionally, the detecting unit 403 is configured to:
detecting whether IO disorder exists in the IO data to be submitted or not by comparing the serial numbers between the IO data to be submitted and each target query node;
if the serial number of the IO data to be submitted does not exceed the serial number of at least one target query node, the detection result indicates that IO disorder does not exist in the IO data to be submitted;
and if the serial number of the IO data to be submitted is larger than the maximum serial number in each target query node, determining that the IO data to be submitted has IO disorder according to the detection result.
Optionally, before deleting the tag node of the IO data to be submitted from the IO hit interval tree, the IO out-of-order detection apparatus 400 further includes a tag information allocating unit 404, where the tag information allocating unit 404 is configured to:
configuring label information for each uncommitted IO data respectively, wherein each label information comprises: and the serial number, the read-write type and the IO hit interval of the corresponding uncommitted IO data.
Optionally, for an uncommitted IO data, the tag information allocating unit 404 configures a corresponding serial number in the following manner:
if the uncommitted IO data is obtained based on a data packet sent by the client, generating a serial number of the uncommitted IO data based on the distributed maximum historical serial number;
if an uncommitted IO data is obtained based on the received uncommitted IO data, a serial number of the uncommitted IO data is generated based on the serial number of the received uncommitted IO data.
For convenience of description, the above parts are separately described as modules (or units) according to functional division. Of course, the functionality of the various modules (or units) may be implemented in the same one or more pieces of software or hardware when the application is implemented.
Having described the service platform access method and apparatus of an exemplary embodiment of the present application, a computer device according to another exemplary embodiment of the present application is described next.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
Based on the same inventive concept as the method embodiment described above, the embodiment of the present application further provides a computer device, and referring to fig. 5, the computer device 500 may at least include a processor 501 and a memory 502. The memory 502 stores program codes, and when the program codes are executed by the processor 501, the processor 501 is enabled to execute any of the steps of the IO out-of-order detection method.
In some possible implementations, a computing device according to the present application may include at least one processor, and at least one memory. The memory stores program codes, and when the program codes are executed by the processor, the processor is caused to execute the steps of the IO out-of-order detection method according to various exemplary embodiments of the present application described above in this specification. For example, a processor may perform the steps as shown in fig. 2A.
A computing device 600 according to this embodiment of the application is described below with reference to fig. 6. The computing device 600 of fig. 6 is only one example and should not be used to limit the scope of use and functionality of embodiments of the present application.
As shown in fig. 6, computing device 600 is embodied in the form of a general purpose computing device. Components of computing device 600 may include, but are not limited to: the at least one processing unit 601, the at least one memory unit 602, and a bus 603 that connects the various system components (including the memory unit 602 and the processing unit 601).
Bus 603 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
The storage unit 602 may include readable media in the form of volatile memory, such as Random Access Memory (RAM) 6021 and/or cache memory unit 6022, and may further include Read Only Memory (ROM) 6023.
The memory unit 602 may also include a program/utility 6025 having a set (at least one) of program modules 6024, such program modules 6024 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The computing apparatus 600 may also communicate with one or more external devices 604 (e.g., keyboard, pointing device, etc.), with one or more devices that enable a user to interact with the computing apparatus 600, and/or with any devices (e.g., router, modem, etc.) that enable the computing apparatus 600 to communicate with one or more other computing apparatuses. Such communication may occur via input/output (I/O) interfaces 605. Moreover, the computing device 600 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) through the network adapter 606. As shown, the network adapter 606 communicates with the other modules for the computing device 600 over the bus 603. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computing device 600, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
Based on the same inventive concept as the above method embodiments, various aspects of the access method of the service platform provided in this application may also be implemented in the form of a program product, which includes program code for causing a computer device to perform the steps in the IO out-of-order detection method according to various exemplary embodiments of this application described above in this specification when the program product runs on the computer device, for example, the computer device may perform the steps as shown in fig. 2A.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. An input/output (IO) out-of-order detection method is characterized by comprising the following steps:
deleting tag nodes of IO data to be submitted from an IO hit interval tree, wherein the IO hit interval tree comprises a plurality of tag nodes, and each tag node represents: label information of corresponding uncommitted IO data;
executing query operation on the IO hit interval tree, and determining label nodes overlapped with the IO hit intervals of the IO data to be submitted as corresponding target query nodes;
and carrying out IO out-of-order detection on the IO data to be submitted based on the obtained target query nodes to obtain corresponding detection results.
2. The method of claim 1, wherein the performing query operations on the IO hit interval tree to determine tag nodes overlapping IO hit intervals of the IO data to be submitted as corresponding target query nodes comprises:
traversing a root node of the IO hit interval tree, and determining the root node as the target query node when the root node corresponds to the IO hit interval of the uncommitted IO data and the IO data to be submitted, and the read-write type of at least one IO data is the write type;
when the maximum IO hit interval ending sector index maintained by the right child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted and the IO hit interval starting sector index of the right child node does not exceed the IO hit interval ending sector index of the IO data to be submitted, performing recursive traversal on a subtree constructed by the right child node, and determining a label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node;
and when the maximum IO hit interval ending sector index maintained by the left child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted, performing recursive traversal on the subtree constructed by the left child node, and determining the label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node.
3. The method of claim 1, wherein the performing IO out-of-order detection on the IO data to be submitted based on the obtained target query nodes to obtain corresponding detection results comprises:
detecting whether IO disorder exists in the IO data to be submitted or not by comparing the serial numbers between the IO data to be submitted and the target query nodes;
if the serial number of the IO data to be submitted does not exceed the serial number of at least one target query node, the detection result indicates that IO disorder does not exist in the IO data to be submitted;
and if the serial number of the IO data to be submitted is larger than the maximum serial number in each target query node, determining that IO disorder exists in the IO data to be submitted according to a detection result.
4. The method of claim 1, further comprising, prior to deleting a tag node of IO data to be committed from an IO hit interval tree:
configuring label information for each uncommitted IO data respectively, wherein each label information comprises: and the serial number, the read-write type and the IO hit interval of the corresponding uncommitted IO data.
5. The method of claim 4, wherein for an uncommitted IO data, configuring a corresponding sequence number in the following manner:
if the uncommitted IO data is obtained based on a data packet sent by the client, generating a serial number of the uncommitted IO data based on the distributed maximum historical serial number;
if the uncommitted IO data is obtained based on the received uncommitted IO data, generating a serial number of the uncommitted IO data based on the serial number of the received uncommitted IO data.
6. An IO out-of-order detection device, comprising:
the deleting unit is used for deleting the tag nodes of the IO data to be submitted from an IO hit interval tree, wherein the IO hit interval tree comprises a plurality of tag nodes, and each tag node represents: label information of corresponding uncommitted IO data;
the query unit is used for executing query operation on the IO hit interval tree and determining the label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node;
and the detection unit is used for carrying out IO out-of-order detection on the IO data to be submitted based on the obtained target query nodes to obtain corresponding detection results.
7. The apparatus of claim 6, wherein the query unit is to:
traversing a root node of the IO hit interval tree, and determining the root node as the target query node when the root node corresponds to an IO hit interval in which the IO data not submitted and the IO data to be submitted are overlapped and the read-write type of at least one IO data is a write type;
when the maximum IO hit interval ending sector index maintained by the right child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted and the IO hit interval starting sector index of the right child node does not exceed the IO hit interval ending sector index of the IO data to be submitted, performing recursive traversal on a subtree constructed by the right child node, and determining a label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node;
and when the maximum IO hit interval ending sector index maintained by the left child node of the root node exceeds the IO hit interval starting sector index of the IO data to be submitted, performing recursive traversal on a subtree constructed by the left child node, and determining a label node overlapped with the IO hit interval of the IO data to be submitted as a corresponding target query node.
8. The apparatus of claim 6, wherein the detection unit is to:
detecting whether IO disorder exists in the IO data to be submitted or not by comparing the serial numbers between the IO data to be submitted and the target query nodes;
if the serial number of the IO data to be submitted does not exceed the serial number of at least one target query node, the detection result indicates that IO disorder does not exist in the IO data to be submitted;
and if the serial number of the IO data to be submitted is larger than the maximum serial number in each target query node, determining that IO disorder exists in the IO data to be submitted according to a detection result.
9. Computer device, characterized in that it comprises a processor and a memory, wherein said memory stores program code which, when executed by said processor, causes said processor to carry out the steps of the method according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that it comprises program code for causing a computer device to perform the steps of the method according to any one of claims 1 to 5, when said program code is run on said computer device.
CN202210903305.8A 2022-07-29 2022-07-29 IO disorder detection method, device, equipment and storage medium Pending CN115268788A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210903305.8A CN115268788A (en) 2022-07-29 2022-07-29 IO disorder detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210903305.8A CN115268788A (en) 2022-07-29 2022-07-29 IO disorder detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115268788A true CN115268788A (en) 2022-11-01

Family

ID=83770808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210903305.8A Pending CN115268788A (en) 2022-07-29 2022-07-29 IO disorder detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115268788A (en)

Similar Documents

Publication Publication Date Title
CN110297689B (en) Intelligent contract execution method, device, equipment and medium
US10048996B1 (en) Predicting infrastructure failures in a data center for hosted service mitigation actions
US10599535B2 (en) Restoring distributed shared memory data consistency within a recovery process from a cluster node failure
US20080126439A1 (en) Change verification in a configuration management database
WO2019166940A2 (en) Transactional operations in multi-master distributed data management systems
CN110213207B (en) Network security defense method and equipment based on log analysis
US10262024B1 (en) Providing consistent access to data objects transcending storage limitations in a non-relational data store
US11093389B2 (en) Method, apparatus, and computer program product for managing storage system
CN109614411B (en) Data storage method, device and storage medium
US20200364211A1 (en) Predictive database index modification
CN111124883B (en) Test case library introduction method, system and equipment based on tree form
US10977379B1 (en) Utilizing canary data to identify improper data access
CN111684779B (en) Data migration in a hierarchical storage management system
CN115268788A (en) IO disorder detection method, device, equipment and storage medium
US11520804B1 (en) Association rule mining
US11656972B1 (en) Paginating results obtained from separate programmatic interfaces
US11500837B1 (en) Automating optimizations for items in a hierarchical data store
US8225009B1 (en) Systems and methods for selectively discovering storage devices connected to host computing devices
US11204717B2 (en) Object storage system with access control quota status check
US11132401B1 (en) Distributed hash table based logging service
KR102085608B1 (en) Recovery server and computer programs
US11249952B1 (en) Distributed storage of data identifiers
CN113132241A (en) ACL template dynamic configuration method and device
US20200371849A1 (en) Systems and methods for efficient management of advanced functions in software defined storage systems
KR20200078426A (en) Recovery server and computer programs

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination