CN107239238A - A kind of I/O operation method and device of the storage based on distributed lock - Google Patents

A kind of I/O operation method and device of the storage based on distributed lock Download PDF

Info

Publication number
CN107239238A
CN107239238A CN201710623874.6A CN201710623874A CN107239238A CN 107239238 A CN107239238 A CN 107239238A CN 201710623874 A CN201710623874 A CN 201710623874A CN 107239238 A CN107239238 A CN 107239238A
Authority
CN
China
Prior art keywords
main frame
timestamp
read
target data
offline
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.)
Granted
Application number
CN201710623874.6A
Other languages
Chinese (zh)
Other versions
CN107239238B (en
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710623874.6A priority Critical patent/CN107239238B/en
Publication of CN107239238A publication Critical patent/CN107239238A/en
Application granted granted Critical
Publication of CN107239238B publication Critical patent/CN107239238B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • 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/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of I/O operation method of the storage based on distributed lock, applied to the first main frame, first main frame is all connected to same shared storage with other multiple main frames, other each main frames are read according to writing default write cycle to the timestamp of shared storage according to default read cycle, when the target data in shared storage issues the instruction of the first I/O operation, detect whether target data is taken by the second main frame, if, then read the timestamp of the second main frame, according to the timestamp of the second main frame of this reading and the timestamp of last the second main frame read, determine whether the second main frame is offline, if, the second main frame is then released to the occupancy of target data and I/O operation is carried out.Using technical scheme provided by the present invention, it is to avoid the second main frame is not offline, but situation about surprisingly being isolated due to the IO time-out of second main frame.The invention also discloses a kind of I/O operation device of the storage based on distributed lock, with relevant art effect.

Description

A kind of I/O operation method and device of the storage based on distributed lock
Technical field
The present invention relates to Computer Applied Technology field, the I/O operation of more particularly to a kind of storage based on distributed lock Method and device.
Background technology
With the development of computer technology and network technology, in the actual production environment of storage, usually occur virtual The large construction cluster of change.In virtualization system, may there are different system or the multiple main frames of same system to be connected to same Or one group of resource, be at this moment accomplished by distributed lock avoid obtain resource each main frame between interfere.
In the prior art, distributed lock is generally realized using the scheme of shared storage.Shared deposited for being connected to one Such as each main frame of storage, when one of main frame takes to shared storage, one of main frame is stored in shared When row write is operated, a main frame is referred to as, the write operation process of a main frame that other main frames to wait terminates could be to shared Storage carries out I/O operation.Generally, can be using a timeout mechanism, i.e., when a main frame is disconnected in the distributed lock scheme of prior art When the connection opened with shared storage exceedes certain time, distributed lock can release occupancy of the main frame to shared storage so that Other main frames can take the shared storage.However, if the IO pressure of shared storage is big, though a main frame do not disconnect with The connection of shared storage, distributed lock, which can also be missed, releases a main frame to the occupancy of shared storage, when shared storage connects again When receiving the I/O operation instruction of main frame, because other main frames now occupy the shared storage so that a main frame by every From, it is impossible to complete I/O operation unfinished before this.
Therefore, a stable distributed lock scheme how is found, is the skill that current those skilled in the art are badly in need of solving Art problem.
The content of the invention
It is an object of the invention to provide a kind of I/O operation method and device of the storage based on distributed lock, it is to avoid second Main frame is not offline, but because the IO time-out of the second main frame causes the unexpected isolation to the second main frame, so as to can not complete pair The situation of the I/O operation of shared storage.
In order to solve the above technical problems, the present invention provides following technical scheme:
A kind of I/O operation method of the storage based on distributed lock, applied to the first main frame, first main frame with it is multiple Other main frames are all connected to same shared storage, and this method includes:
Other each main frames are read according to default read cycle shared to deposit according to writing default write cycle to described The timestamp of storage;
When the target data in the shared storage issues the instruction of the first I/O operation, whether the target data is detected Taken by the second main frame, second main frame is any one in other multiple main frames;
If it is, the timestamp of second main frame is read, according to the timestamp of second main frame of this reading The timestamp of second main frame read with the last time, determines whether second main frame is offline;
If it is, releasing second main frame to the occupancy of the target data and carrying out I/O operation.
It is preferred that, the timestamp for second main frame that the basis is this time read and last second master read The timestamp of machine, determines whether second main frame is offline, including:
Obtain the I/O latency of second main frame;
It is determined that whether the timestamp of last second main frame read is more than this reading plus the I/O latency The timestamp of second main frame taken;
If it is not, then determining that second main frame is offline.
It is preferred that, the I/O latency for obtaining second main frame, including:
According to the stand-by period of the second I/O instruction queue of second main frame, when determining that the IO of second main frame is waited Between;
Wherein, the second I/O instruction queue has non-timeout properties, comprising second main frame to the target data The the second I/O operation instruction issued.
It is preferred that, the first I/O operation instruction is the instruction in the first I/O instruction queue with non-timeout properties.
It is preferred that, the read cycle is more than or equal to the said write cycle.
A kind of I/O operation device of the storage based on distributed lock, applied to the first main frame, first main frame with it is multiple Other main frames are all connected to same shared storage, and the device includes:
Timestamp read module, for reading other each main frames according to default write-in week according to default read cycle Phase is write to the timestamp of the shared storage;
Target data detection module, the instruction of the first I/O operation is issued for the target data in the shared storage When, detect whether the target data is taken by the second main frame, if it is, the triggering offline determining module of the second main frame, described Second main frame is any one in other multiple main frames;
The offline determining module of second main frame, the timestamp for reading second main frame, according to this reading The timestamp of the timestamp of second main frame and last second main frame read, determine second main frame whether from Line, if it is, triggering I/O operation module;
The I/O operation module, for releasing second main frame to the occupancy of the target data and carrying out I/O operation.
It is preferred that, the offline determining module of the second main frame, including:
I/O latency obtains submodule, the I/O latency for obtaining second main frame;
Timestamp determination sub-module, for determining that the timestamp of second main frame of last reading adds described IO etc. Treat whether the time is more than the timestamp of second main frame of this reading, if it is not, then determining son offline into the second main frame Module;
The offline determination sub-module of second main frame, for determining that second main frame is offline.
It is preferred that, the I/O latency obtains submodule, specifically for:
According to the stand-by period of the second I/O instruction queue of second main frame, when determining that the IO of second main frame is waited Between;
Wherein, the second I/O instruction queue has non-timeout properties, comprising second main frame to the target data The the second I/O operation instruction issued.
It is preferred that, the first I/O operation instruction is the instruction in the first I/O instruction queue with non-timeout properties.
It is preferred that, the read cycle is more than or equal to the said write cycle.
The technical scheme provided using the embodiment of the present invention, reads other each main frames according to default read cycle and presses According to writing default write cycle to the timestamp of shared storage, the target data in shared storage issues the first I/O operation During instruction, whether detection target data is taken by the second main frame, if it is, the timestamp of the second main frame is read, according to this The timestamp of the timestamp of the second main frame read and last the second main frame read, determines whether the second main frame is offline, such as Fruit is then to release the second main frame to the occupancy of target data and carry out I/O operation.
When the read-write pressure ratio of shared storage is larger, possibly I/O operation that can not be in time to the second main frame is responded, Therefore there is IO time-out in the I/O operation instruction that the second main frame is issued, it may be possible to which the connection that the second main frame is disconnected with shared storage is led Cause the IO time-out of the second main frame, it is also possible to which the IO pressure of shared storage causes greatly the IO time-out of the second main frame.The side of the present invention In case, when the first Host Detection to target data is taken by the second main frame, the timestamp of the second main frame is read, this is read The timestamp of the second main frame and the timestamp of last the second main frame read be compared, determine the second main frame whether from Line.When the IO pressure of shared storage is big, there is time-out in the IO of the second main frame, but the second main frame can by issuing timestamp, So that the first main frame determines whether the second main frame is offline, it is to avoid the second main frame is not offline, but because the IO of the second main frame surpasses Unexpected isolation of the Shi Zaocheng to the second main frame, so that the situation of the I/O operation to shared storage can not be completed.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of I/O operation method implement scene schematic diagram of storage based on distributed lock in the present invention;
Fig. 2 is a kind of implementing procedure figure of the I/O operation method of the storage based on distributed lock in the present invention;
Fig. 3 is a kind of structural representation of the I/O operation device of the storage based on distributed lock in the present invention.
Embodiment
The core of the present invention is to provide a kind of I/O operation method of the storage based on distributed lock, and the first main frame is by reading The timestamp of second main frame determines whether the second main frame is offline, it is to avoid the second main frame is not offline, but due to the second main frame IO time-out causes the unexpected isolation to the second main frame, so that the situation of the I/O operation to shared storage can not be completed.
In order that those skilled in the art more fully understand the present invention program, with reference to the accompanying drawings and detailed description The present invention is described in further detail.Obviously, described embodiment is only a part of embodiment of the invention, rather than Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creative work premise Lower obtained every other embodiment, belongs to the scope of protection of the invention.
Fig. 1 is refer to, is a kind of I/O operation method implement scene schematic diagram of storage based on distributed lock in the present invention. Main frame 101, main frame 102, main frame 103 and main frame 104 are connected in same shared storage 105.Each main frame can be altogether The corresponding position for enjoying storage writes respective timestamp, while timestamp is write every time, and IO behaviour is issued to shared storage The stand-by period of work.
Fig. 2 is refer to, is a kind of implementing procedure figure of the I/O operation method of the storage based on distributed lock in the present invention, should Method can apply to the first main frame, and the first main frame and other multiple main frames are all connected to same shared storage, and this method can be with Comprise the following steps:
S201:Other each main frames are read according to default read cycle to deposit according to writing default write cycle to shared The timestamp of storage.
Shared storage can be one or one group of resource, can have multiple main frames to be connected with same shared storage.Connection Each main frame to same shared storage can be write respective timestamp in the shared storage.In present specification In, the timestamp of main frame refers to the start duration of current hosts, for example, can be the number of seconds of the available machine time of current hosts.Often Individual main frame can start a process, and according to default write cycle, respective timestamp is write in shared storage.It is each main The timestamp that machine writes in shared storage, other main frames can only read the timestamp, it is impossible to which the timestamp is modified, example Such as, can be in shared storage each addition host assignment to should main frame only space, each main frame to oneself Space can be written and read operation, and space corresponding to other main frames can only be read.
First main frame reads other each main frames according to writing default write cycle to altogether according to default read cycle After the timestamp for enjoying storage, step S202 operation can be carried out.
It should be noted that read cycle and write cycle can be set and be adjusted according to actual conditions, not shadow Ring the implementation of the present invention.It is preferred that, read cycle is more than or equal to write cycle.
S202:When the target data in shared storage issues the instruction of the first I/O operation, detection target data whether by Second main frame takes.
If it is, into step S203.Wherein, the second main frame is any one in other multiple main frames.
Target data is the data being stored in shared storage.Refer to when the first main frame issues the first I/O operation to target data When making, whether detection target data is taken by the second main frame.Second main frame and the first main frame are connected to a shared storage, target Data by the second main frame when being taken, and the first main frame can not issue I/O operation instruction to target data.For example, when the second main frame pair When target data carries out write operation, the second master can be carried by target data being set in a mark, mark by distributed lock The title of machine.When target data has the mark of the second main frame, the first main frame then determines that the target data is accounted for by the second data With.
Certainly, if it is determined that target data is not taken by other any main frames, then the first main frame can be to target data I/O operation instruction is issued, to complete corresponding read-write operation.
S203:The timestamp of the second main frame is read, according to the timestamp of the second main frame of this reading and last reading The second main frame timestamp, determine whether the second main frame offline.
After target data is detected by the second main frame occupancy, the first main frame reads the timestamp of the second main frame, and root The timestamp of the timestamp of second main frame of secondary reading and last the second main frame read accordingly, determine the second main frame whether from Line.
First main frame can be by the time of the timestamp of the second main frame of this reading and last the second main frame read Stamp is compared, and determines whether the timestamp of twi-read changes, can be true if the timestamp of twi-read does not change Fixed second main frame is offline.
Certainly, in a kind of embodiment of the present invention, it is contemplated that the I/O operation to target data may compare frequency It is numerous, or the factor such as default read cycle is shorter, when the first main frame determines that the timestamp of the second main frame this time read is compared When the timestamp of the second main frame read in last time does not change, the time interval of twi-read timestamp may further determine that Whether more than the second main frame write cycle, if be no more than, can after a waiting time, read the second main frame when Between stab.If the timestamp read after waiting time does not change still, it can determine that the second main frame is offline.
For example, being preset as the write cycle of the second main frame 10 seconds, the read cycle of the first main frame is preset as 30 seconds.Generally, Default read cycle is more than or equal to default write cycle.First Host Detection is taken to target data by the second main frame When, the timestamp of the second main frame of reading is one hour, and the timestamp for the second main frame that the last time reads also is one hour, twice The time interval for reading the timestamp of the second main frame is 7 seconds.Due to being less than within 7 seconds 10 seconds write cycles of the second main frame, Ke Yi The timestamp of the second main frame is read after one waiting time.Waiting time can be set and be adjusted according to actual conditions, example Such as it is set as identical with the write cycle of the second main frame, three times duration of write cycle of the second main frame etc. can also be set as, The invention is not limited in this regard.For example it is set to 20 seconds when waiting time, the timestamp of the second main frame was read after 20 seconds, if reads The timestamp of the second main frame taken is still one hour, it is determined that the second main frame is offline.
First main frame can carry out S204 operation after it is determined that the second main frame is offline.
S204:The second main frame is released to the occupancy of target data and I/O operation is carried out.
After first main frame determines that the second main frame is offline, occupancy of second main frame to target data is released.For example, can be by The mark that two main frames are set by distributed lock to target data is deleted.First main frame is releasing the second main frame to number of targets According to occupancy after, can to target data carry out I/O operation.
The technical scheme provided using the embodiment of the present invention, reads other each main frames according to default read cycle and presses According to writing default write cycle to the timestamp of shared storage, the target data in shared storage issues the first I/O operation During instruction, whether detection target data is taken by the second main frame, if it is, the timestamp of the second main frame is read, according to this The timestamp of the timestamp of the second main frame read and last the second main frame read, determines whether the second main frame is offline, such as Fruit is then to release the second main frame to the occupancy of target data and carry out I/O operation.
When the read-write pressure ratio of shared storage is larger, possibly I/O operation that can not be in time to the second main frame is responded, Therefore there is IO time-out in the I/O operation instruction that the second main frame is issued, it may be possible to which the connection that the second main frame is disconnected with shared storage is led Cause the IO time-out of the second main frame, it is also possible to which the IO pressure of shared storage causes greatly the IO time-out of the second main frame.The side of the present invention In case, when the first Host Detection to target data is taken by the second main frame, the timestamp of the second main frame is read, this is read The timestamp of the second main frame and the timestamp of last the second main frame read be compared, determine the second main frame whether from Line.When the IO pressure of shared storage is big, there is time-out in the IO of the second main frame, but the second main frame can by issuing timestamp, So that the first main frame determines whether the second main frame is offline, it is to avoid the second main frame is not offline, but because the IO of the second main frame surpasses Unexpected isolation of the Shi Zaocheng to the second main frame, so that the situation of the I/O operation to shared storage can not be completed.
In a kind of embodiment of the present invention, step S203 includes:
Step one:Obtain the I/O latency of the second main frame;
Step 2:It is determined that whether the timestamp of last the second main frame read is more than this reading plus I/O latency The second main frame timestamp, if it is not, then into step 3;
Step 3:Determine that the second main frame is offline.
First main frame reads the I/O latency of the second main frame from shared storage, and the I/O latency of the second main frame is by Two main frames are issued to the respective regions of shared storage.
It should be noted that the second main frame can be determined according to stand-by period of the second I/O instruction queue of the second main frame I/O latency.Wherein, the second I/O instruction queue has non-timeout properties, issued comprising the second main frame to target data Two I/O operations are instructed.Specifically:Second main frame can increase by a second I/O instruction queue with non-timeout properties, the queue It is made up of the instruction of the second I/O operation.When the second main frame that non-timeout properties refer to issues the I/O operations of IO second instruction in the queue, Issue unsuccessful, continue to issue, the queue is not deleted, until the second I/O operation instruction in the queue is issued into Work(.Certainly, each main frame in a shared storage is connected to, the I/O instruction team with non-timeout properties can be used Row, carry out issuing for I/O operation instruction.
Second main frame while timestamp is issued, can issue the I/O latency of the second main frame.Certainly, when IO is waited Between issue and can also have no effect on the implementation of the present invention using other issuance schemes.First main frame reads the last time The timestamp of second main frame is added with the I/O latency of the second main frame, determines whether addition result is more than the second of this reading The timestamp of main frame, if it is not, then determining that the second main frame is offline.
If the timestamp of the second main frame only read by the timestamp of this second main frame read with the last time, really Whether fixed second main frame is offline, then the read cycle of the first main frame is shorter, to the I/O operation ratio of the target data of shared storage Relatively frequently, and the second main frame carry out timestamp issue there may be delay etc. many factors can all influence the first main frame judge The whether offline accuracy of second main frame.When the second main frame does not disconnect the connection with shared storage, due to shared storage IO pressure causes greatly the I/O operation of the second main frame to instruct appearance time-out, then the timestamp of the second main frame read last time is added The I/O latency of second main frame, the timestamp of the second main frame obtain and that this reading can be more than or equal to.When second When main frame disconnects the connection with shared storage, such as the second main frame is delayed the network connection interruption of machine or the second main frame, due to the Two main frames can not issue I/O latency to update the I/O latency of the second main frame preserved in shared storage, and the first main frame will The I/O latency of the second main frame read from shared storage, the timestamp of the second main frame read with the last time is asked With, as a result can be less than this reading the second main frame timestamp.
For example, when the first Host Detection to the second main frame takes the target data in shared storage, second this time read The timestamp of main frame is 60 seconds, and the I/O latency of the second main frame is 32 seconds, and the timestamp for the second main frame that the last time reads is 30 seconds, then after the timestamp of the second main frame read the last time is plus the I/O latency of the second main frame, the obtained time is big In the timestamp of the second main frame of this reading, then it can determine that the second main frame does not disconnect the connection with shared storage.
Corresponding to above method embodiment, the embodiment of the present invention additionally provides a kind of IO of the storage based on distributed lock Operation device, a kind of I/O operation device of the storage based on distributed lock described below is with above-described one kind based on distribution The I/O operation method of the storage of formula lock can be mutually to should refer to.
It is shown in Figure 3, it is a kind of structure of the I/O operation device of the storage based on distributed lock in the embodiment of the present invention Schematic diagram, applied to the first main frame, the first main frame and other multiple main frames are all connected to same shared storage, the device including with Lower module:
Timestamp read module 301, writes for reading other each main frames according to default read cycle according to default Entering the cycle writes to the timestamp of shared storage;
Target data detection module 302, for when the target data in shared storage issues the instruction of the first I/O operation, Detect whether target data is taken by the second main frame, if it is, the triggering offline determining module 303 of the second main frame, the second main frame For any one in other multiple main frames;
The offline determining module 303 of second main frame, the timestamp for reading the second main frame, according to the second of this reading the master The timestamp of the timestamp of machine and last the second main frame read, determines whether the second main frame is offline, if it is, triggering IO Operation module 304;
I/O operation module 304, for releasing the second main frame to the occupancy of target data and carrying out I/O operation.
The device provided using the embodiment of the present invention, other each main frames are read according to pre- according to default read cycle If write cycle write to the timestamp of shared storage, the target data in shared storage is issuing the instruction of the first I/O operation When, whether detection target data is taken by the second main frame, if it is, the timestamp of the second main frame is read, according to this reading The second main frame timestamp and the timestamp of last the second main frame read, determine whether the second main frame offline, if it is, The second main frame is then released to the occupancy of target data and I/O operation is carried out.
When the read-write pressure ratio of shared storage is larger, possibly I/O operation that can not be in time to the second main frame is responded, Therefore there is IO time-out in the I/O operation instruction that the second main frame is issued, it may be possible to which the connection that the second main frame is disconnected with shared storage is led Cause the IO time-out of the second main frame, it is also possible to which the IO pressure of shared storage causes greatly the IO time-out of the second main frame.The side of the present invention In case, when the first Host Detection to target data is taken by the second main frame, the timestamp of the second main frame is read, this is read The timestamp of the second main frame and the timestamp of last the second main frame read be compared, determine the second main frame whether from Line.When the IO pressure of shared storage is big, there is time-out in the IO of the second main frame, but the second main frame can by issuing timestamp, So that the first main frame determines whether the second main frame is offline, it is to avoid the second main frame is not offline, but because the IO of the second main frame surpasses When and the situation of the I/O operation to shared storage can not be completed.
In a kind of embodiment of the present invention, the offline determining module 303 of the second main frame, including:
I/O latency obtains submodule, the I/O latency for obtaining the second main frame;
Timestamp determination sub-module, for determining that the timestamp of the second main frame of last reading plus I/O latency is The timestamp of no the second main frame more than this reading, if it is not, then into the offline determination sub-module of the second main frame;
The offline determination sub-module of second main frame, for determining that the second main frame is offline.
In a kind of embodiment of the present invention, I/O latency obtains submodule, specifically for:
According to the stand-by period of the second I/O instruction queue of the second main frame, the I/O latency of the second main frame is determined;
Second I/O instruction queue has non-timeout properties, refers to comprising the second I/O operation that the second main frame is issued to target data Order.
In a kind of embodiment of the present invention, the instruction of the first I/O operation refers to for the first IO with non-timeout properties Make the instruction in queue.
In a kind of embodiment of the present invention, read cycle is more than or equal to write cycle.
The embodiment of each in this specification is described by the way of progressive, what each embodiment was stressed be with it is other Between the difference of embodiment, each embodiment same or similar part mutually referring to.For being filled disclosed in embodiment For putting, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is referring to method part Explanation.
Professional further appreciates that, with reference to the unit of each example of the embodiments described herein description And algorithm steps, can be realized with electronic hardware, computer software or the combination of the two, in order to clearly demonstrate hardware and The interchangeability of software, generally describes the composition and step of each example according to function in the above description.These Function is performed with hardware or software mode actually, depending on the application-specific and design constraint of technical scheme.Specialty Technical staff can realize described function to each specific application using distinct methods, but this realization should not Think beyond the scope of this invention.
Directly it can be held with reference to the step of the method or algorithm that the embodiments described herein is described with hardware, processor Capable software module, or the two combination are implemented.Software module can be placed in random access memory (RAM), internal memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
Specific case used herein is set forth to the principle and embodiment of the present invention, and above example is said It is bright to be only intended to help and understand technical scheme and its core concept.It should be pointed out that for the common of the art For technical staff, under the premise without departing from the principles of the invention, some improvement and modification can also be carried out to the present invention, these Improve and modification is also fallen into the protection domain of the claims in the present invention.

Claims (10)

1. a kind of I/O operation method of the storage based on distributed lock, it is characterised in that applied to the first main frame, first master Machine is all connected to same shared storage with other multiple main frames, including:
Other each main frames are read according to writing default write cycle to the shared storage according to default read cycle Timestamp;
When the target data in the shared storage issues the instruction of the first I/O operation, detect the target data whether by the Two main frames take, and second main frame is any one in other multiple main frames;
If it is, read the timestamp of second main frame, according to the timestamp of second main frame of this reading and upper The timestamp of second main frame once read, determines whether second main frame is offline;
If it is, releasing second main frame to the occupancy of the target data and carrying out I/O operation.
2. according to the method described in claim 1, it is characterised in that the time for second main frame that the basis is this time read The timestamp of stamp and last second main frame read, determines whether second main frame is offline, including:
Obtain the I/O latency of second main frame;
It is determined that whether the timestamp of last second main frame read is more than this reading plus the I/O latency The timestamp of second main frame;
If it is not, then determining that second main frame is offline.
3. method according to claim 2, it is characterised in that the I/O latency of acquisition second main frame, bag Include:
According to the stand-by period of the second I/O instruction queue of second main frame, the I/O latency of second main frame is determined;
Wherein, the second I/O instruction queue has non-timeout properties, and the target data is issued comprising second main frame The second I/O operation instruction.
4. according to the method described in claim 1, it is characterised in that the first I/O operation instruction is with non-timeout properties Instruction in first I/O instruction queue.
5. the method according to any one of Claims 1-4, it is characterised in that the read cycle is more than or equal to described Write cycle.
6. a kind of I/O operation device of the storage based on distributed lock, it is characterised in that applied to the first main frame, first master Machine is all connected to same shared storage with other multiple main frames, including:
Timestamp read module, writes for reading other each main frames according to default read cycle according to default write cycle Enter to the timestamp of the shared storage;
Target data detection module, for when the target data in the shared storage issues the instruction of the first I/O operation, examining Survey whether the target data is taken by the second main frame, if it is, the triggering offline determining module of the second main frame, second master Machine is any one in other multiple main frames;
The offline determining module of second main frame, the timestamp for reading second main frame, according to this reading The timestamp of the timestamp of second main frame and last second main frame read, determines whether second main frame is offline, If it is, triggering I/O operation module;
The I/O operation module, for releasing second main frame to the occupancy of the target data and carrying out I/O operation.
7. device according to claim 6, it is characterised in that the offline determining module of the second main frame, including:
I/O latency obtains submodule, the I/O latency for obtaining second main frame;
Timestamp determination sub-module, during for determining that the timestamp of second main frame of last reading is waited plus the IO Between whether be more than this reading second main frame timestamp, if it is not, then into the offline determination sub-module of the second main frame;
The offline determination sub-module of second main frame, for determining that second main frame is offline.
8. device according to claim 7, it is characterised in that the I/O latency obtains submodule, specifically for:
According to the stand-by period of the second I/O instruction queue of second main frame, the I/O latency of second main frame is determined;
Wherein, the second I/O instruction queue has non-timeout properties, and the target data is issued comprising second main frame The second I/O operation instruction.
9. device according to claim 6, it is characterised in that the first I/O operation instruction is with non-timeout properties Instruction in first I/O instruction queue.
10. the device according to any one of claim 6 to 9, it is characterised in that the read cycle is more than or equal to described Write cycle.
CN201710623874.6A 2017-07-27 2017-07-27 Storage IO operation method and device based on distributed lock Active CN107239238B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710623874.6A CN107239238B (en) 2017-07-27 2017-07-27 Storage IO operation method and device based on distributed lock

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710623874.6A CN107239238B (en) 2017-07-27 2017-07-27 Storage IO operation method and device based on distributed lock

Publications (2)

Publication Number Publication Date
CN107239238A true CN107239238A (en) 2017-10-10
CN107239238B CN107239238B (en) 2020-09-04

Family

ID=59989774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710623874.6A Active CN107239238B (en) 2017-07-27 2017-07-27 Storage IO operation method and device based on distributed lock

Country Status (1)

Country Link
CN (1) CN107239238B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002360A (en) * 2018-08-29 2018-12-14 郑州云海信息技术有限公司 A kind of distributed lock failure separation method, device, computer storage and equipment
CN109375988A (en) * 2018-11-01 2019-02-22 郑州云海信息技术有限公司 A kind of distributed lock implementation method and device
CN110568991A (en) * 2018-06-06 2019-12-13 北京忆恒创源科技有限公司 method for reducing IO command conflict caused by lock and storage device
CN111459963A (en) * 2020-04-07 2020-07-28 中国建设银行股份有限公司 Core accounting transaction concurrent processing method and device
CN111857579A (en) * 2020-06-30 2020-10-30 广东浪潮大数据研究有限公司 SSD (solid State disk) controller resetting method, system and device and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7103530B1 (en) * 2002-03-29 2006-09-05 Cypress Semiconductor Corporation System for integrating event-related information and trace information
CN104317658A (en) * 2014-10-17 2015-01-28 华中科技大学 MapReduce based load self-adaptive task scheduling method
CN104954411A (en) * 2014-03-31 2015-09-30 腾讯科技(深圳)有限公司 Method for sharing network resource by distributed system, terminal thereof and system thereof
US9411534B2 (en) * 2014-07-02 2016-08-09 Hedvig, Inc. Time stamp generation for virtual disks
CN106293934A (en) * 2016-07-19 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of cluster system management optimization method and platform
CN106873918A (en) * 2017-02-27 2017-06-20 郑州云海信息技术有限公司 Storage method to set up and device in a kind of virtualization system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7103530B1 (en) * 2002-03-29 2006-09-05 Cypress Semiconductor Corporation System for integrating event-related information and trace information
CN104954411A (en) * 2014-03-31 2015-09-30 腾讯科技(深圳)有限公司 Method for sharing network resource by distributed system, terminal thereof and system thereof
US9411534B2 (en) * 2014-07-02 2016-08-09 Hedvig, Inc. Time stamp generation for virtual disks
CN104317658A (en) * 2014-10-17 2015-01-28 华中科技大学 MapReduce based load self-adaptive task scheduling method
CN106293934A (en) * 2016-07-19 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of cluster system management optimization method and platform
CN106873918A (en) * 2017-02-27 2017-06-20 郑州云海信息技术有限公司 Storage method to set up and device in a kind of virtualization system

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110568991A (en) * 2018-06-06 2019-12-13 北京忆恒创源科技有限公司 method for reducing IO command conflict caused by lock and storage device
CN110568991B (en) * 2018-06-06 2023-07-25 北京忆恒创源科技股份有限公司 Method and storage device for reducing IO command conflict caused by lock
CN109002360A (en) * 2018-08-29 2018-12-14 郑州云海信息技术有限公司 A kind of distributed lock failure separation method, device, computer storage and equipment
CN109002360B (en) * 2018-08-29 2021-10-26 郑州云海信息技术有限公司 Distributed lock fault isolation method and device, computer memory and equipment
CN109375988A (en) * 2018-11-01 2019-02-22 郑州云海信息技术有限公司 A kind of distributed lock implementation method and device
CN111459963A (en) * 2020-04-07 2020-07-28 中国建设银行股份有限公司 Core accounting transaction concurrent processing method and device
CN111459963B (en) * 2020-04-07 2024-03-15 中国建设银行股份有限公司 Concurrent processing method and device for core accounting transaction
CN111857579A (en) * 2020-06-30 2020-10-30 广东浪潮大数据研究有限公司 SSD (solid State disk) controller resetting method, system and device and readable storage medium
CN111857579B (en) * 2020-06-30 2024-02-09 广东浪潮大数据研究有限公司 SSD disk controller resetting method, SSD disk controller resetting system, SSD disk controller resetting device and readable storage medium

Also Published As

Publication number Publication date
CN107239238B (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN107239238A (en) A kind of I/O operation method and device of the storage based on distributed lock
CN103593147B (en) A kind of method and device of digital independent
CN106233269B (en) Fine granularity bandwidth provisioning in a memory controller
CN106168885B (en) A kind of method and system of the logical volume dynamic capacity-expanding based on LVM
CN102346740B (en) A kind of file synchronisation method, electronic equipment and synchronization system
CN102867035B (en) A kind of distributed file system cluster high availability method and device
CN106844510A (en) The data migration method and device of a kind of distributed experiment & measurement system
CN109308280A (en) Data processing method and relevant device
CN108694231A (en) Using NVM and by multiple log recording buffers come ahead log recording
CN109582686B (en) Method, device, system and application for ensuring consistency of distributed metadata management
CN106919471A (en) For the method and system that snapshot is set up
CN104794155B (en) The method, apparatus and system of data load
CN105677511B (en) A kind of method for writing data and device reducing synchronization overhead
CN103747332B (en) A kind of smoothing processing method and device of video
CN109428913A (en) A kind of storage expansion method and device
PH12014501932B1 (en) Data storage method and device
US9854037B2 (en) Identifying workload and sizing of buffers for the purpose of volume replication
CN109710456B (en) Data recovery method and device
CN105635311A (en) Method for synchronizing resource pool information in cloud management platform
CN106933493A (en) Method and apparatus for caching disk array dilatation
CN105787129B (en) Data storage method and electronic equipment
CN104572505A (en) System and method for ensuring eventual consistency of mass data caches
CN110457261A (en) Data access method, device and server
CN107592522A (en) A kind of method and device for detecting video resolution
CN110442648A (en) Method of data synchronization and device

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
GR01 Patent grant
GR01 Patent grant