CN116974466A - Path application reservation method, device, equipment and medium of multipath equipment - Google Patents

Path application reservation method, device, equipment and medium of multipath equipment Download PDF

Info

Publication number
CN116974466A
CN116974466A CN202310625020.7A CN202310625020A CN116974466A CN 116974466 A CN116974466 A CN 116974466A CN 202310625020 A CN202310625020 A CN 202310625020A CN 116974466 A CN116974466 A CN 116974466A
Authority
CN
China
Prior art keywords
path
reservation
key value
multipath
registration
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
CN202310625020.7A
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310625020.7A priority Critical patent/CN116974466A/en
Publication of CN116974466A publication Critical patent/CN116974466A/en
Pending legal-status Critical Current

Links

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/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
    • 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention relates to a path application reservation method, a device, equipment and a medium of multipath equipment, wherein the path application reservation method comprises the following steps: judging whether a path i corresponding to the multipath equipment meets the following conditions: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initialization registration key value of the local initialization record or the previous registration key value of the local previous record; if not, registering a reserved key value for the path i according to the initialized registered key value and applying reservation; when the application and reservation operation of the multipath equipment is successful, registering and reserving the key value for a path j corresponding to the multipath equipment according to the initialized registration key value; and increasing the subscript j of the path j in the path range according to the natural number sequence, and registering and reserving the key value for the path j in sequence after the reservation application operation of the multipath equipment is successful. By the technical scheme, the problem that multi-path equipment cannot perform application reservation of multiple paths in the current host cluster scene can be solved.

Description

Path application reservation method, device, equipment and medium of multipath equipment
Technical Field
The present invention relates to the field of path application reservation, and in particular, to a path application reservation method, apparatus, device, and medium for a multipath device.
Background
The storage multipath technology refers to that a plurality of paths are used for connection before a host and a storage array end, so that the number of visible paths from the host to the array is larger than one; multiple switches may be spanned therebetween, single point failures are avoided, and higher availability and performance advantages may be provided.
The high availability is reflected in: when any node of the SAN network environment fails, IO requests can be sent through other paths, and interruption is avoided. The high throughput performance advantage is manifested in: IO requests can be simultaneously sent through multiple paths and load balancing, so that IO throughput rate is improved.
The multipath equipment technology refers to that one storage device in one system has a plurality of paths; the phenomenon mainly occurs in the SAN network environment, and mainly is used for making data link redundancy so as to achieve the effect of high availability; i.e., a multipath device at the host end, there may be multiple path devices representing it.
In the prior art, under the host cluster scene, a single storage logical volume is required to be mapped to a plurality of hosts; when multiple hosts access a volume, a SCSI reservation mechanism is used to avoid collisions.
In the conventional technology, a method for reserving a disk device takes a single path of a single disk as a unit; when multiple hosts access the device through this single path, there is no problem with using the reservation mechanism.
However, for multi-path devices, when a reservation is applied, only the currently selected path is registered with a reservation key and the reservation is applied; therefore, when a subsequent routing is performed for the I/O, only this registration reservation key and applying the reserved path may access the volume; other unregistered paths that hold key values cannot access the volume.
In a host cluster scene, a load balancing algorithm of the multipath equipment is generally required to be set as a failover load balancing algorithm, and the algorithm only enables a single path to bear IO; therefore, in such a case, the multipath high concurrency storage technique cannot be used in the cluster scenario.
Therefore, for the host cluster scenario, how to effectively reserve the multipath device to achieve the following objectives becomes a technical problem:
how to enable the host cluster to access the disk simultaneously in multiple paths on the premise of ensuring data consistency so as to improve the bandwidth and efficiency of accessing the multipath disk.
Disclosure of Invention
In order to solve the technical problems, the invention provides a path applying and reserving method, a device, equipment and a medium of a multi-path device, wherein the applying and reserving method is used for solving the problem that the multi-path device cannot conduct applying and reserving of a plurality of paths in the current host cluster scene.
In order to achieve the above object, the present invention provides a path applying and reserving method for a multi-path device in a host cluster, where the applying and reserving method is used for performing applying and reserving operations on a plurality of paths of the multi-path device, and the applying and reserving method includes:
when the multipath equipment receives a small computer system interface reservation instruction, judging whether a path i corresponding to the multipath equipment meets a first exclusion condition or not; wherein the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initialized registered key value of the initialized record of the local machine or the previously registered key value of the previously recorded record of the local machine;
if the first exclusion condition is not met, registering a reserved key value for the path i according to the initialized registered key value and applying reservation;
when the application reservation operation of the path i is successful, judging whether the application reservation operation of the multipath equipment is successful or not;
when the application and reservation operation of the multipath equipment is successful, registering and reserving a key value for a path j corresponding to the multipath equipment according to the initialized registration key value; wherein, subscript i and subscript j are different;
and sequentially increasing the subscript j of the path j in a natural number sequence within the path range, and registering and reserving key values for the path j in sequence after the reservation application operation of the multipath equipment is successful.
Further, before registering the reserved key value for the path i and applying the reservation according to the initialized registered key value, the reservation applying method further includes:
judging whether the path i meets a first judging condition or not; wherein, the first judging condition is: the current reserved key value corresponding to the path i is inconsistent with the previous registered key value recorded previously by the local machine;
if the first judging condition is met, clearing the current reserved key value corresponding to the path i, and setting the current reserved key value to be 0;
judging whether the current reserved key value is 0 or not; if the path i is not 0, generating information that the current storage volume is not reserved by other hosts, wherein the information is used for registering the reserved key value and applying reservation to the path i according to the initialized registered key value.
Further, registering the reserved key value and applying reservation to the path i according to the initialized registered key value specifically includes:
performing registration operation on the path i according to the initialized registration key value;
judging whether the registration operation of the path i is successful or not; if the registration operation is successful, generating information that the registration reservation key value operation is successful;
setting a registration success flag of the path i to true; and reserving the path i according to the initialization registration key value of the local initialization record.
Further, before determining whether the path i corresponding to the multipath device meets the first exclusion condition, the reservation applying method further includes:
judging whether the subscript i of the path i exceeds the path range; if the information exceeds the preset value, generating relevant processing information of all paths.
Further, determining whether the path i corresponding to the multipath device meets a first exclusion condition specifically includes:
if the path i corresponding to the multipath equipment meets the first exclusion condition, generating reserved conflict information;
and setting a reservation conflict existence mark for the path i, and generating reservation failure application information.
Further, after registering the reserved key value for the path i according to the initialized registered key value and applying the reservation, the reservation applying method further includes:
judging whether the application reservation operation of the path i is successful or not;
if the reservation application operation is unsuccessful, the local key value is unregistered for the path i;
and sequentially increasing the subscript i of the path i in the natural number within the path range, and sequentially registering a reservation key value and applying reservation to the path i under the condition that no reservation conflict exists.
Further, registering and reserving a key value for a path j corresponding to the multipath device according to the initialized registration key value specifically includes:
judging whether the path j exceeds the path range or not;
if the path range is not exceeded, judging whether a registration success mark of the path j is true; if true, generating operation information of the reserved key value which is registered previously;
registering the path j according to the initialization registration key value of the local initialization record;
judging whether the registration operation of the path j is successful or not; if so, generating information that the operation of registering the reserved key value is successful;
and setting a registration success flag of the path j to be true.
The invention also provides a path applying and reserving device of the multipath equipment, which is used for realizing the path applying and reserving method of the multipath equipment, and the applying and reserving device comprises the following steps:
a first exclusion condition judgment unit configured to:
when the multipath equipment receives a small computer system interface reservation instruction, judging whether a path i corresponding to the multipath equipment meets a first exclusion condition or not; wherein the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initialized registered key value of the initialized record of the local machine or the previously registered key value of the previously recorded record of the local machine;
register a reservation key and apply a reservation unit for:
if the first exclusion condition is not met, registering a reserved key value for the path i according to the initialized registered key value and applying reservation;
a multi-path device application reservation judging unit for:
when the application reservation operation of the path i is successful, judging whether the application reservation operation of the multipath equipment is successful or not;
a remaining path registration reservation key unit for:
when the application and reservation operation of the multipath equipment is successful, registering and reserving a key value for a path j corresponding to the multipath equipment according to the initialized registration key value; wherein, subscript i and subscript j are different;
a remnant path index increment unit for:
and sequentially increasing the subscript j of the path j in a natural number sequence within the path range, and registering and reserving key values for the path j in sequence after the reservation application operation of the multipath equipment is successful.
The present invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the path imposing reservation method of a multi-path device as described above when the computer program is executed.
The present invention further provides a computer readable storage medium storing a computer program which when executed by a processor performs the steps of the path imposing reservation method of a multi-path device as described above.
Compared with the prior art, the technical scheme provided by the invention has the following technical effects:
in the invention, in order to perform the application reservation operation of a plurality of paths on multi-path equipment in a host cluster, an available path i is selected, and under the condition that reservation conflict does not exist, a registration reservation key value is performed and reservation is applied;
when selecting the path i, it is first determined whether the path i satisfies a first exclusion condition, that is, whether the path i satisfies: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initialization registration key value of the local initialization record or the previous registration key value of the local previous record;
if the first exclusion condition is not satisfied, indicating that the path i has no reservation conflict, registering a reservation key value and applying reservation;
after the path i registers the reserved key value and the reservation is successfully applied, the reservation operation of the multipath equipment is also successfully applied, and the registration operation of the reserved key value is sequentially carried out for each remaining path;
the subscript j of the path j is increased according to the natural number sequence, and the key value is sequentially registered and reserved under the condition that the path j meets the condition;
thus, compared with the method for applying reservation to disk equipment in the prior art, the method for applying reservation firstly carries out registration of a reservation key value and application of reservation under the condition that reservation conflict does not exist through an available path;
if the reservation operation is successful, the remaining paths are subsequently registered for reservation key value operation, so that the following purposes are achieved: during the period that the host reserves the volume, multiple paths simultaneously access the disk in parallel, so that the bandwidth and the efficiency of accessing the multipath disk are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a path applying reservation method of a multi-path device according to a first embodiment of the present invention;
fig. 2 is an overall flow chart of a multi-path reservation applying method according to an embodiment of the present invention;
fig. 3 is a block diagram of a path applying reservation device of a multipath apparatus in a second embodiment of the present invention;
fig. 4 is an internal structure diagram of a computer device in the second embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Embodiment one:
as shown in fig. 1, an embodiment of the present invention provides a path applying and reserving method for a multi-path device in a host cluster, where the applying and reserving method is used for performing applying and reserving operations on a plurality of paths of the multi-path device, and the applying and reserving method includes:
when the multipath equipment receives a small computer system interface reservation instruction, judging whether a path i corresponding to the multipath equipment meets a first exclusion condition or not; wherein the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initialization registration key value of the local initialization record or the previous registration key value of the local previous record;
if the first exclusion condition is not met, registering a reserved key value for the path i according to the initialized registered key value and applying reservation;
when the application reservation operation of the path i is successful, judging whether the application reservation operation of the multipath equipment is successful or not;
when the application and reservation operation of the multipath equipment is successful, registering and reserving the key value for a path j corresponding to the multipath equipment according to the initialized registration key value; wherein, subscript i and subscript j are different;
and increasing the subscript j of the path j in the path range according to the natural number sequence, and registering and reserving the key value for the path j in sequence after the reservation application operation of the multipath equipment is successful.
In a specific embodiment, in order to perform reservation application operation on multiple paths of multipath devices in a host cluster, an available path i is selected, and a reservation key value is registered and reserved under the condition that reservation conflict does not exist;
when selecting the path i, it is first determined whether the path i satisfies a first exclusion condition, that is, whether the path i satisfies: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initialization registration key value of the local initialization record or the previous registration key value of the local previous record;
if the first exclusion condition is not satisfied, indicating that the path i has no reservation conflict, registering a reservation key value and applying reservation;
after the path i registers the reserved key value and the reservation is successfully applied, the reservation operation of the multipath equipment is also successfully applied, and the registration operation of the reserved key value is sequentially carried out for each remaining path;
the subscript j of the path j is increased according to the natural number sequence, and the key value is sequentially registered and reserved under the condition that the path j meets the condition;
thus, compared with the method for applying reservation to disk equipment in the prior art, the method for applying reservation firstly carries out registration of a reservation key value and application of reservation under the condition that reservation conflict does not exist through an available path;
if the reservation operation is successful, the remaining paths are subsequently registered for reservation key value operation, so that the following purposes are achieved: during the period that the host reserves the volume, multiple paths simultaneously access the disk in parallel, so that the bandwidth and the efficiency of accessing the multipath disk are improved.
In practice, SCSI, i.e., smallComputerSystemInterface, represents a special-purpose interface for a small computer system; the expansion interface designed for small computer can make the computer add other peripheral equipment to raise system performance or add new functions, such as hard disk, CD-ROM, scanner, etc.
SCSI reservation is a mechanism that allows SCSI initiators to reserve LUNs for exclusive access and prevents other initiators from making changes. This function is typically used in clusters.
I/O technology enables the exchange of data between a computer and a storage device. One intermediate technique for implementing I/O paths from the CPU to the storage system is the SCSI technique.
In summary, the path reservation method of the multipath device can apply reservation to the multipath device by an effective method aiming at a host cluster scene, so that the host cluster can access the disk simultaneously by multiple paths on the premise of ensuring data consistency, and the bandwidth and efficiency of accessing the multipath disk are improved.
In a preferred embodiment, before registering the reservation key and applying the reservation to the path i according to the initialized registration key, the applying the reservation method further comprises:
judging whether the path i meets a first judging condition; the first judging condition is as follows: the current reserved key value corresponding to the path i is inconsistent with the previous registered key value recorded previously by the local machine;
if the first judging condition is met, clearing the current reserved key value corresponding to the path i, and setting the current reserved key value to 0;
judging whether the current reserved key value is 0 or not; if the current storage volume is not reserved by other hosts, generating information that the current storage volume is not reserved by other hosts, and performing registration and reservation key value on the path i according to the initialized registration key value and applying reservation.
In practice, the host has successfully performed the reservation operation before and has acquired the access rights of the volume, but the reservation key value of the current host may be changed due to the restart, power failure, reloading of the multi-path drive, and the like of the host, which may cause a problem that the same host cannot apply the reservation due to the failure of the host. (i.e., the same host in path i has inconsistent key values)
In practical embodiments, for these scenarios, the above-mentioned reservation applying method may first determine that the front and back key values of the same host in the path i are inconsistent;
if the front and back key values of the same host in the path i are inconsistent, the previous registration key value is cleared, and the new reserved key value is used for registration and reservation application operation, so that the application range of the abnormal scene of the reservation application operation is further improved.
In a preferred embodiment, registering a reservation key and applying a reservation to the path i according to the initialized registration key specifically includes:
performing registration operation on the path i according to the initialized registration key value;
judging whether the registration operation of the path i is successful or not; if the registration operation is successful, generating information that the registration reservation key value operation is successful;
setting a registration success flag of the path i to true; and reserving the path i according to the initialization registration key value of the local initialization record.
In an actual embodiment, if the current reserved key value of the path i is 0, the reserved key value is registered and reserved according to a specific flow.
In a preferred embodiment, before determining whether the path i corresponding to the multipath device meets the first exclusion condition, the applying the reservation method further includes:
judging whether the subscript i of the path i exceeds the path range or not; if the information exceeds the preset value, generating relevant processing information of all paths.
In an actual embodiment, whether the path index I exceeds the path range is judged first; and when the path range is not exceeded, the path i can be further registered with a reservation key value and the reservation is applied.
In a preferred embodiment, determining whether the path i corresponding to the multipath device meets the first exclusion condition specifically includes:
if the path i corresponding to the multipath equipment meets a first exclusion condition, generating reserved conflict information;
and setting a reservation conflict mark for the path i to generate reservation failure information.
In a practical embodiment, if there is a reservation conflict in path i, reservation application failure information is generated.
In a preferred embodiment, after registering the reservation key and applying the reservation to the path i according to the initialized registration key, the applying reservation method further includes:
judging whether the application reservation operation of the path i is successful or not;
if the reservation application operation is unsuccessful, the local key value is unregistered for the path i;
the subscript i of the path i is sequentially increased in the natural number within the path range, and the subscript i is used for sequentially registering the reservation key value and applying reservation to the path i under the condition that no reservation conflict exists.
In an actual embodiment, if the current reserved key value of the path i is 0, registering the reserved key value and applying the reservation; if the apply reservation operation fails, a corresponding remedial action is taken.
In a preferred embodiment, the registering and reserving key value for the path j corresponding to the multipath device according to the initialized registering key value specifically includes:
judging whether the path j exceeds the path range or not;
if the path range is not exceeded, judging whether a registration success mark of the path j is true; if true, generating operation information of the reserved key value which is registered previously;
registering the path j according to the initialization registration key value of the local initialization record;
judging whether the registration operation of the path j is successful or not; if so, generating information that the operation of registering the reserved key value is successful;
the registration success flag for path j is set to true.
In a practical embodiment, first a reservation key is registered and a reservation is applied through an available path without reservation collision. And if the reservation operation is successful, performing the operation of registering the reservation key value on the residual path.
In a preferred embodiment, when the multipath device receives a small computer system interface reservation instruction, initializing the subscript i of the path i to be 1;
judging whether the subscript i of the path i exceeds the path range or not;
if the path range is not exceeded, reading a current reserved key value corresponding to the path i;
judging whether a path i corresponding to the multipath equipment meets a first exclusion condition or not; wherein the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initialization registration key value of the local initialization record or the previous registration key value of the local previous record;
if the first exclusion condition is not satisfied, judging whether the path i satisfies the first judgment condition; the first judging condition is as follows: the current reserved key value corresponding to the path i is inconsistent with the previous registered key value recorded previously by the local machine;
if the first judging condition is met, clearing the current reserved key value corresponding to the path i, and setting the current reserved key value to 0;
judging whether the current reserved key value is 0 or not; if the current storage volume is not reserved by other hosts, generating information that the current storage volume is not reserved by other hosts, and performing registration and reservation key values on a path i according to the initialized registration key values and applying reservation;
and registering the reserved key value for the path i according to the initialized registered key value and applying reservation.
Thus, first, through an available path, a reservation key is registered and a reservation is applied without reservation conflicts.
As shown in fig. 2, the method for applying reservation by the multipath device according to the practical embodiment of the present invention includes the following steps:
step S101, the multipath device receives a SCSI instruction for applying reservation (namely a small computer system interface reservation instruction); initializing a path index i to be 1;
step S102: judging whether the path index I exceeds the path range or not; if true, it is indicated that all paths have been subjected to correlation processing, and step S115 is skipped; otherwise, jumping to step S103;
step S103: reading the current reserved key value of the path i;
step S104: judging whether the current reserved key value of the path i is not 0 or not, wherein the current reserved key value is inconsistent with the registered key value recorded by the local initialization or recorded previously; if true, it indicates that the other hosts have successfully performed the reservation operation and the access rights of the acquired volume have conflicts with the reservation operation to be performed by the host, and the step S114 is skipped; otherwise, jumping to step S105;
step S105: judging whether the current reserved key value of the path i is inconsistent with the previous registered key value recorded by the local machine; if true, jumping to step S106; otherwise, jumping to step S107;
when the front and back key values of the same host in the path i are inconsistent, the host is indicated to have successfully performed the reserved operation before and obtained the access right of the volume, but the reserved key value of the current host may be changed due to the reasons of restarting, powering down, reloading the multipath drive and the like of the host; thus, the front and back key values are inconsistent;
step S106: clearing the reserved key value on the path i; setting the current reserved key value to 0;
step S107: judging whether the current reserved key value is 0 or not; if true, indicating that the current storage volume is not reserved by other hosts, jumping to step S108; otherwise, step S115 is skipped;
step S108: the path i uses the key value of the local initialization record to register operation;
step S109: judging whether the registration operation of the path i is successful or not; if true, the operation of registering the reserved key value is successful, and the step S110 is skipped; otherwise, jumping to step S113;
step S110: setting a registration success flag of the path i to true; path i uses the key value of the local initialization record to apply reservation;
step S111: judging whether the application reservation operation of the path i is successful or not; if true, the operation of applying the reservation of the path i is indicated to be successful, and the step S115 is skipped; otherwise, jumping to step S112;
step S112: path i deregisters the native key;
step S113: the path index i is incremented; step S102 is skipped;
step S114: setting a reservation conflict mark, and prompting that reservation application fails;
step S115: judging whether the multi-path equipment successfully applies reservation; if true, the operation of reserving the multipath equipment is successful, the register operation of reserving the key value needs to be further carried out for each path, and the step S116 is skipped; otherwise, ending;
step S116: initializing the subscript of path j to be 1;
step S117: judging whether the path j exceeds the path range or not; if true, indicating that all paths are subjected to relevant processing, and ending; otherwise, step S118 is skipped;
step S118: judging whether the registration success mark of the path j is true; if true, indicating that the registration reservation key operation has been previously completed, step S119 is skipped; otherwise, step S122 is skipped;
step S119: the path j uses the key value of the local initialization record to register;
step S120: judging whether the path j registration operation is successful or not; if true, it is indicated that the operation of registering the reserved key has succeeded, and step S121 is skipped; otherwise, step S122 is skipped;
step S121: setting a successful registration mark of the path j as true;
step S122: the path index j is incremented in the natural number order, and the process goes to step S117 (i.e., the registration operation for the remaining path with the reserved key is continued).
In summary, the path reservation method of the multipath device can apply reservation to the multipath device by an effective method aiming at a host cluster scene, so that the host cluster can access the disk simultaneously by multiple paths on the premise of ensuring data consistency, and the bandwidth and efficiency of accessing the multipath disk are improved.
It should be noted that, although the steps in the flowchart are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps in the flowcharts may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order in which the sub-steps or stages are performed is not necessarily sequential, and may be performed in turn or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
Embodiment two:
as shown in fig. 3, the embodiment of the present invention further provides a path applying and reserving apparatus for a multipath device, where the path applying and reserving apparatus is configured to implement the path applying and reserving method of the multipath device, and the applying and reserving apparatus includes:
a first exclusion condition judgment unit configured to:
when the multipath equipment receives a small computer system interface reservation instruction, judging whether a path i corresponding to the multipath equipment meets a first exclusion condition or not; wherein the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initialization registration key value of the local initialization record or the previous registration key value of the local previous record;
register a reservation key and apply a reservation unit for:
if the first exclusion condition is not met, registering a reserved key value for the path i according to the initialized registered key value and applying reservation;
a multi-path device application reservation judging unit for:
when the application reservation operation of the path i is successful, judging whether the application reservation operation of the multipath equipment is successful or not;
a remaining path registration reservation key unit for:
when the application and reservation operation of the multipath equipment is successful, registering and reserving the key value for a path j corresponding to the multipath equipment according to the initialized registration key value; wherein, subscript i and subscript j are different;
a remnant path index increment unit for:
and increasing the subscript j of the path j in the path range according to the natural number sequence, and registering and reserving the key value for the path j in sequence after the reservation application operation of the multipath equipment is successful.
In a preferred embodiment, the applying reservation means further comprises a non-applying reservation remedying unit for:
judging whether the path i meets a first judging condition; the first judging condition is as follows: the current reserved key value corresponding to the path i is inconsistent with the previous registered key value recorded previously by the local machine;
if the first judging condition is met, clearing the current reserved key value corresponding to the path i, and setting the current reserved key value to 0;
judging whether the current reserved key value is 0 or not; if the current storage volume is not reserved by other hosts, generating information that the current storage volume is not reserved by other hosts, and performing registration and reservation key value on the path i according to the initialized registration key value and applying reservation.
In a preferred embodiment, registering the reservation key and applying the reservation unit is specifically for:
performing registration operation on the path i according to the initialized registration key value;
judging whether the registration operation of the path i is successful or not; if the registration operation is successful, generating information that the registration reservation key value operation is successful;
setting a registration success flag of the path i to true; and reserving the path i according to the initialization registration key value of the local initialization record.
In a preferred embodiment, the applying reservation means further comprises a path out-of-range judging unit for:
judging whether the subscript i of the path i exceeds the path range or not; if the information exceeds the preset value, generating relevant processing information of all paths.
In a preferred embodiment, the first exclusion condition determination unit is specifically configured to:
if the path i corresponding to the multipath equipment meets a first exclusion condition, generating reserved conflict information;
and setting a reservation conflict mark for the path i to generate reservation failure information.
In a preferred embodiment, the applying reservation means further comprises an applying reservation operation failure remedying unit for:
judging whether the application reservation operation of the path i is successful or not;
if the reservation application operation is unsuccessful, the local key value is unregistered for the path i;
the subscript i of the path i is sequentially increased in the natural number within the path range, and the subscript i is used for sequentially registering the reservation key value and applying reservation to the path i under the condition that no reservation conflict exists.
In a preferred embodiment, the remaining path registration reservation key unit is specifically configured to:
judging whether the path j exceeds the path range or not;
if the path range is not exceeded, judging whether a registration success mark of the path j is true; if true, generating operation information of the reserved key value which is registered previously;
registering the path j according to the initialization registration key value of the local initialization record;
judging whether the registration operation of the path j is successful or not; if so, generating information that the operation of registering the reserved key value is successful;
the registration success flag for path j is set to true.
For specific limitations of the above apparatus, reference may be made to the limitations of the method described above, which are not repeated here.
Each of the modules in the above apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware, or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
The computer device may be a terminal, as shown in fig. 4, which includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
The structures shown in the above figures are merely block diagrams of partial structures related to the present invention and do not constitute limitations of the computer device to which the present invention is applied, and a specific computer device may include more or less components than those shown in the figures, or may combine some components, or have different arrangements of components.
It will be appreciated that implementation of all or part of the flow of the methods of the above embodiments may be accomplished by a computer program that instructs related hardware, and that the computer program may be stored on a non-volatile computer readable storage medium, which when executed may include the flow of the embodiments of the methods as described above.
Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be noted that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (10)

1. A path applying reservation method for a multipath device, wherein the path applying reservation method is used for performing an applying reservation operation of a plurality of paths for the multipath device in a host cluster, and the applying reservation method includes:
when the multipath equipment receives a small computer system interface reservation instruction, judging whether a path i corresponding to the multipath equipment meets a first exclusion condition or not; wherein the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initialized registered key value of the initialized record of the local machine or the previously registered key value of the previously recorded record of the local machine;
if the first exclusion condition is not met, registering a reserved key value for the path i according to the initialized registered key value and applying reservation;
when the application reservation operation of the path i is successful, judging whether the application reservation operation of the multipath equipment is successful or not;
when the application and reservation operation of the multipath equipment is successful, registering and reserving a key value for a path j corresponding to the multipath equipment according to the initialized registration key value; wherein, subscript i and subscript j are different;
and sequentially increasing the subscript j of the path j in a natural number sequence within the path range, and registering and reserving key values for the path j in sequence after the reservation application operation of the multipath equipment is successful.
2. The path imposing reservation method of a multi-path device according to claim 1, wherein before registering a reservation key for the path i and imposing a reservation according to the initialized registration key, the imposing reservation method further comprises:
judging whether the path i meets a first judging condition or not; wherein, the first judging condition is: the current reserved key value corresponding to the path i is inconsistent with the previous registered key value recorded previously by the local machine;
if the first judging condition is met, clearing the current reserved key value corresponding to the path i, and setting the current reserved key value to be 0;
judging whether the current reserved key value is 0 or not; if the path i is not 0, generating information that the current storage volume is not reserved by other hosts, wherein the information is used for registering the reserved key value and applying reservation to the path i according to the initialized registered key value.
3. The path applying reservation method of a multi-path device according to claim 1 or 2, wherein registering a reservation key and applying a reservation to the path i according to the initialized registration key, specifically comprising:
performing registration operation on the path i according to the initialized registration key value;
judging whether the registration operation of the path i is successful or not; if the registration operation is successful, generating information that the registration reservation key value operation is successful;
setting a registration success flag of the path i to true; and reserving the path i according to the initialization registration key value of the local initialization record.
4. The path imposing reservation method of a multi-path device according to claim 3, wherein before judging whether a path i corresponding to the multi-path device satisfies a first exclusion condition, the imposing reservation method further comprises:
judging whether the subscript i of the path i exceeds the path range; if the information exceeds the preset value, generating relevant processing information of all paths.
5. The method for reserving path applications by a multipath device according to claim 4, wherein determining whether the path i corresponding to the multipath device satisfies a first exclusion condition comprises:
if the path i corresponding to the multipath equipment meets the first exclusion condition, generating reserved conflict information;
and setting a reservation conflict existence mark for the path i, and generating reservation failure application information.
6. The path imposing reservation method of a multi-path device as claimed in claim 5, wherein after registering a reservation key for the path i and imposing a reservation according to the initialized registration key, the imposing reservation method further comprises:
judging whether the application reservation operation of the path i is successful or not;
if the reservation application operation is unsuccessful, the local key value is unregistered for the path i;
and sequentially increasing the subscript i of the path i in the natural number within the path range, and sequentially registering a reservation key value and applying reservation to the path i under the condition that no reservation conflict exists.
7. The method for reserving path application of a multi-path device according to claim 1, wherein the method for reserving path j corresponding to the multi-path device according to the initialized registration key comprises:
judging whether the path j exceeds the path range or not;
if the path range is not exceeded, judging whether a registration success mark of the path j is true; if true, generating operation information of the reserved key value which is registered previously;
registering the path j according to the initialization registration key value of the local initialization record;
judging whether the registration operation of the path j is successful or not; if so, generating information that the operation of registering the reserved key value is successful;
and setting a registration success flag of the path j to be true.
8. A path imparting reservation apparatus for a multipath device, for implementing a path imparting reservation method for a multipath device as claimed in any one of claims 1 to 7, the imparting reservation apparatus comprising:
a first exclusion condition judgment unit configured to:
when the multipath equipment receives a small computer system interface reservation instruction, judging whether a path i corresponding to the multipath equipment meets a first exclusion condition or not; wherein the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initialized registered key value of the initialized record of the local machine or the previously registered key value of the previously recorded record of the local machine;
register a reservation key and apply a reservation unit for:
if the first exclusion condition is not met, registering a reserved key value for the path i according to the initialized registered key value and applying reservation;
a multi-path device application reservation judging unit for:
when the application reservation operation of the path i is successful, judging whether the application reservation operation of the multipath equipment is successful or not;
a remaining path registration reservation key unit for:
when the application and reservation operation of the multipath equipment is successful, registering and reserving a key value for a path j corresponding to the multipath equipment according to the initialized registration key value; wherein, subscript i and subscript j are different;
a remnant path index increment unit for:
and sequentially increasing the subscript j of the path j in a natural number sequence within the path range, and registering and reserving key values for the path j in sequence after the reservation application operation of the multipath equipment is successful.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the computer program performs the steps of the path imposing reservation method of the multi-path device of any one of claims 1 to 7.
10. A computer readable storage medium storing a computer program which when executed by a processor performs the steps of a path imposing reservation method for a multi-path device as claimed in any one of claims 1 to 7.
CN202310625020.7A 2023-05-30 2023-05-30 Path application reservation method, device, equipment and medium of multipath equipment Pending CN116974466A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310625020.7A CN116974466A (en) 2023-05-30 2023-05-30 Path application reservation method, device, equipment and medium of multipath equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310625020.7A CN116974466A (en) 2023-05-30 2023-05-30 Path application reservation method, device, equipment and medium of multipath equipment

Publications (1)

Publication Number Publication Date
CN116974466A true CN116974466A (en) 2023-10-31

Family

ID=88482211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310625020.7A Pending CN116974466A (en) 2023-05-30 2023-05-30 Path application reservation method, device, equipment and medium of multipath equipment

Country Status (1)

Country Link
CN (1) CN116974466A (en)

Similar Documents

Publication Publication Date Title
US9104529B1 (en) System and method for copying a cache system
US9235524B1 (en) System and method for improving cache performance
US8627012B1 (en) System and method for improving cache performance
US8930947B1 (en) System and method for live migration of a virtual machine with dedicated cache
CN110443712B (en) Contract conflict detection method and device, readable storage medium and computer equipment
CN109656895B (en) Distributed storage system, data writing method, device and storage medium
CN110569264B (en) Contract data processing method and device, computer readable storage medium and computer equipment
US10379949B2 (en) Techniques for managing parity information for data stored on a storage device
CN110704161B (en) Virtual machine creation method and device and computer equipment
CN109669822B (en) Electronic device, method for creating backup storage pool, and computer-readable storage medium
CN115098046B (en) Disk array initialization method, system, electronic device and storage medium
CN116107516B (en) Data writing method and device, solid state disk, electronic equipment and storage medium
US11663170B2 (en) Method for associating data between a plurality of blockchain networks and apparatus thereof
US20240143188A1 (en) Data processing method and apparatus, device, and readable storage medium
US9053033B1 (en) System and method for cache content sharing
US20100250651A1 (en) Data access method for making asynchronous request to block device
CN112631994A (en) Data migration method and system
US9009416B1 (en) System and method for managing cache system content directories
CN116974466A (en) Path application reservation method, device, equipment and medium of multipath equipment
CN115543215B (en) Data writing operation and data reading operation method and device
CN115151902A (en) Cluster capacity expansion method and device, storage medium and electronic equipment
EP3249540A1 (en) Method for writing multiple copies into storage device, and storage device
KR20200132521A (en) Apparatus for guaranteeing integrity of state database in blockchain-based environment and method thereof
CN115904795A (en) Data storage method and device in storage system
CN112346913A (en) Data recovery method, device, equipment and storage medium

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