CN104407814B - Double method and apparatus for writing data - Google Patents
Double method and apparatus for writing data Download PDFInfo
- Publication number
- CN104407814B CN104407814B CN201410676570.2A CN201410676570A CN104407814B CN 104407814 B CN104407814 B CN 104407814B CN 201410676570 A CN201410676570 A CN 201410676570A CN 104407814 B CN104407814 B CN 104407814B
- Authority
- CN
- China
- Prior art keywords
- data
- storage device
- write
- main storage
- main
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/062—Securing storage systems
- G06F3/0622—Securing storage systems in relation to access
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
- G06F3/0659—Command handling arrangements, e.g. command buffers, queues, command scheduling
Abstract
The embodiment of the present invention provides a kind of double method and apparatus for writing data, and this method includes:Double write data requests that Receiving Host is sent, and data writing operation is carried out from storage device with from LUN is corresponding to the corresponding main storage devices of main LUN simultaneously;If receiving the data of writing that main storage device sends retries message, and receive from storage device return write data response message after, sent to main frame and write time exceeded message, so that main frame sends the data for not completing write operation to main storage system;If the data for the unfinished write operation that non-Receiving Host is sent, write successful data cover using the last time in main storage device and write successful data for the last time from storage device in preset time period.Double method and apparatus for writing data provided in an embodiment of the present invention improve the reliability of storage system.
Description
Technical field
The present embodiments relate to technology of data copy, more particularly to a kind of double method and apparatus for writing data.
Background technology
Double data of writing are primary logical unit number (the Logical Unit Number for writing main frame in main storage system;Letter
Claim LUN) data on corresponding main storage device, write in real time from corresponding from storage device from LUN in storage system
In, it is double to write number in the application such as disaster tolerance, mirror image or migration to ensure that main storage system is consistent with the data from storage system
According to whether the reliable influence to system is very big.
At present, it is double write data when, if main frame receives return Retry Order, illustrate main storage system write data time-out,
Now, from storage system write data it is successful in the case of the inconsistent situation of the data of principal and subordinate's storage system occurs.For solution
Certainly above mentioned problem, mainly uses following two modes in the prior art:The first, by Retry Order as write error processing, breaks
The data duplication relation between array is opened, such exception can arrive the data duplication of main storage system by starting simultaneously operating
From end storage system, to ensure the consistent of principal and subordinate's end data.Second:Ignore the write operation result of main storage system return, will
The result of writing retried returns to main frame, and main frame resends double write data requests, makes main storage system and held again from storage system
The double write operations of row, to ensure the consistent of principal and subordinate's memory system data.
However, in first way when main storage system read-write data are very big, it may appear that frequently cut off duplication between array
Business, the data consistency of principal and subordinate's storage system is by starting synchronous ensure;If due to the reading of main frame itself in the second way
Write pressure or main frame the problems such as link, causes main frame to retry data and writes failure with array link, now, and main storage system is perceived
Less than write error, and double write operations are normal, but principal and subordinate's memory system data indeed is not in consistent state, thus exist and lose
Lose the risk of data.Therefore, all there is the problem of storage system reliability is relatively low in the two schemes of prior art.
The content of the invention
The embodiment of the present invention provides a kind of double method and apparatus for writing data, the reliability to improve storage system.
In a first aspect, the embodiment of the present invention provides a kind of double methods for writing data, including:
Receiving Host send double write data requests, and simultaneously to the corresponding main storage devices of primary logical unit LUN with
Data writing operation is carried out respectively from storage device from LUN is corresponding;
If the data of writing for receiving that the main storage device sends retry message, and described are returned receiving from storage device
Write after data response message, then sent to the main frame and write time exceeded message, so that the main frame is sent to the main storage system
The data of write operation are not completed;
If not receiving the data for the unfinished write operation that the main frame is sent in preset time period, hosted using described
The last time is write in storage equipment writes successful data for the last time from storage device described in successful data cover.
With reference in a first aspect, in the first possible implementation of first aspect, methods described also includes:
, will be again to the master if receiving the data for the unfinished write operation that the main frame is sent in preset time period
Storage device and it is described from storage device carry out data writing operation.
With reference to the first possible implementation of first aspect, first aspect, second in first aspect is possible
In implementation, the relevant information of data to be written is carried in described pair of write data requests, the relevant information includes described to be written
The position of data and size;
It is described while corresponding from storage device point with from LUN to the corresponding main storage devices of primary logical unit LUN
Data writing operation is not carried out, is specifically included:
According to the position of the data to be written and size, described carried out from storage device to the main storage device and respectively
Data writing operation.
With reference in a first aspect, second of possible implementation of first aspect, the third in first aspect is possible
In implementation, write data retry the information that the data for not completing write operation are carried in message;
It is described to write described in successful data cover from storage device last using the last time in the main storage device
It is secondary to write successful data, specifically include:
The last time writes successful data in the main storage device according to the acquisition of information of the data of unfinished write operation, and
Write using the last time in the main storage device and write successful number described in successful data cover for the last time from storage device
According to.
With reference to second of possible implementation of first aspect, in the 4th kind of possible implementation of first aspect
In, it is described while being carried out respectively from storage device with from LUN is corresponding to the corresponding main storage devices of primary logical unit LUN
After data writing operation, in addition to:
If receive respectively the main storage device and it is described write data success message from what storage device was sent, to described
Main frame transmission is write data and successfully instructed, and deletes the relevant information of the data to be written;Or,
If receive the main storage device transmission writes data success message, and receives described from writing that storage device is sent
Data failure message, then interrupt to the data writing operation carried out from storage device, and sent to main frame and write data and successfully refer to
Order.
With reference to second of first aspect or the 4th kind of any possible implementation of first aspect, in first aspect
The 5th kind of possible implementation in, it is described to the main storage device and described from storage device to enter row write data again
After operation, in addition to:
If receiving the completion rewrite operation message that the main storage device is sent in the preset time period, institute is deleted
State the relevant information of data to be written.
With reference to second of first aspect or the 4th kind of first aspect to the 5th kind of any possible implementation,
In 6th kind of possible implementation of first aspect, the last time writes successful data and covered in the use main storage device
After successful data being write for the last time from storage device described in lid, in addition to:
If receiving the related letter write data success message from what storage device was sent, delete the data to be written
Breath;
Otherwise, interrupt again to the main storage device and the operation for entering row write data from storage device.
Second aspect, the embodiment of the present invention provides a kind of double devices for writing data, including:
Receiving module, the double write data requests sent for Receiving Host;
Processing module, for simultaneously corresponding from storage with from LUN to the corresponding main storage devices of primary logical unit LUN
Data writing operation is carried out in equipment respectively;
Sending module, the data of writing for receiving the main storage device transmission in the receiving module retry message, and
Receive it is described from storage device return write data response message after, sent to the main frame and write time exceeded message, so that described
Main frame sends the data for not completing write operation to the main storage system;
The processing module, sends not if being additionally operable to the receiving module and not receiving the main frame in preset time period
The data of write operation are completed, then are write using the last time in the main storage device described in successful data cover from storage device
Last time writes successful data.
With reference to second aspect, in the first possible implementation of second aspect, the processing module, if being additionally operable to
The receiving module receives the data for the unfinished write operation that the main frame is sent in preset time period, then will be again to described
Main storage device and it is described from storage device carry out data writing operation.
With reference to second aspect, the first possible implementation of second aspect, second in second aspect is possible
In implementation, the relevant information of data to be written is carried in described pair of write data requests, the relevant information includes described to be written
The position of data and size;
The processing module is additionally operable to:
According to the position of the data to be written and size, described carried out from storage device to the main storage device and respectively
Data writing operation.
With reference to second aspect, second of possible implementation of second aspect, the third in second aspect is possible
In implementation, write data retry the information that the data for not completing write operation are carried in message;
The processing module is additionally operable to:
The last time writes successful data in the main storage device according to the acquisition of information of the data of unfinished write operation, and
Write using the last time in the main storage device and write successful number described in successful data cover for the last time from storage device
According to.
With reference to second of possible implementation of second aspect, in the 4th kind of possible implementation of second aspect
In, if the sending module is additionally operable to the receiving module and receives the main storage device respectively and described from storage device transmission
Write data success message, then sent to the main frame and write data and successfully instruct, the processing module is used to delete described to be written
The relevant information of data;
If the data of writing that the processing module is additionally operable to the receiving module reception main storage device transmission successfully disappear
Breath, and receive it is described write data failure message from what storage device was sent, then interrupt to described and from what storage device was carried out write number
According to operation, the sending module is successfully instructed for writing data to main frame transmission.
With reference to second of second aspect or the 4th kind of any possible implementation, the 5th kind in second aspect can
In the implementation of energy, the processing module is additionally operable to:
If the receiving module receives the completion rewrite operation that the main storage device is sent in the preset time period
Message, then delete the relevant information of the data to be written.
With reference to second of second aspect or the 4th kind of second aspect to the 5th kind of any possible implementation,
In 6th kind of possible implementation of second aspect, processing module is additionally operable to:
If the receiving module receive it is described from storage device send write data success message if delete the number to be written
According to relevant information;Otherwise, interrupt again to the main storage device and the operation for entering row write data from storage device.
Double method and apparatus for writing data that the present invention is provided, the double write data requests sent by Receiving Host, and together
The corresponding main storage devices of Shi Xiangzhu LUN carry out data writing operation respectively with from LUN is corresponding from storage device;If primary storage
The data of writing that system receives main storage device transmission retry message, and reception writes data response message from what storage device was returned,
Then sent to main frame and write time exceeded message, so that main frame sends the data for not completing write operation to main storage system, if primary storage system
System does not receive the data of the unfinished write operation of main frame transmission in preset time period, then using last in main storage device
Write successful data cover and write successful data for the last time from storage device.By determining main storage system in preset time
The data of unfinished write operation are not received in section, successful data cover is write from depositing thereby using the last time in main storage device
In storage equipment write successful data for the last time, come ensure main storage device with from the consistent of storage device data, it is to avoid it is logical
Cross and frequently cut off double business for writing data to start the situation of synchronous guarantee, reduce the risk for losing data, improve storage
The reliability of system.
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 this hairs
Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 writes the schematic flow sheet of the embodiments of the method one of data for the present invention couple;
Fig. 2 writes the schematic flow sheet of the embodiments of the method two of data for the present invention couple;
Fig. 3 writes the structural representation of the device embodiments one of data for the present invention couple;
Fig. 4 is the structural representation of storage device embodiment one of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Mirror image that double method for writing data provided in an embodiment of the present invention goes for being attached on business memory space,
In the scenes such as disaster tolerance system, migration or replicate data.Wherein, mirror image is a type of redundancy, is by main storage device
Data are preserving a identical copy from storage device.Disaster tolerance system refers to, in strange land relatively far apart, set up two
Set or many set function identical IT systems, can carry out normal condition monitoring and function switching from each other, when main side system because
When unexpected (such as fire, earthquake) is stopped, whole application system can be switched to from end so that the systemic-function can be after
Continuous normal work.Migration or replicate data include the data duplication in main storage device by network to from storage device or
The forms such as the backup of establishment file system.As can be seen here, in the scenes such as mirror image, disaster tolerance system, migration or replicate data, how
Ensureing that main storage device, with from the case that the data in storage device are consistent, improve the reliability of storage system, be one
Individual extremely important the problem of.
Fig. 1 writes the schematic flow sheet of the embodiments of the method one of data for the present invention couple.The embodiments of the invention provide one kind
Double methods for writing data, this method can be performed by arbitrary storage system, for example:Storage device, virtualization head or standby
Part software etc., specifically can pass through software and/or hardware is realized.As shown in figure 1, the method for the present embodiment can include:
Step 101:Receiving Host send double write data requests, and simultaneously to the corresponding main storage devices of main LUN and from
LUN is corresponding to carry out data writing operation respectively from storage device.
In the present embodiment, main storage system receive main frame transmission it is double write the request of data after, while by this pair
It is corresponding from storage device with from LUN that write data requests are sent to the corresponding main storage devices of main LUN so that main storage system to
Main storage device and write data from storage device.Wherein, storage device is such as can be memory, hard disk.Set for storage
Standby particular type, the present invention is not any limitation as.
If what step 102, reception main storage device were sent, which writes data, retries message, and is receiving what is returned from storage device
Write after data response message, then sent to main frame and write time exceeded message, so that main frame is sent to main storage system does not complete write operation
Data.
In the present embodiment, main storage system performs the operation of write-in data to main storage device and from storage device every time
Afterwards, main storage device and response message just is returned to main storage system respectively from storage device, the response message is used to represent this
It is secondary to write whether data succeed.When main storage system receives after writing data and retry message of main storage device return, wait from
Storage device return response message, now, no matter from storage device return write data response message be write data success, write number
Data are still write according to failure to retry, main storage system sends to main frame and writes time exceeded message.Disappear when main frame receives this and writes time-out
After breath, the data for not completing write operation are sent to main storage system.
If step 103, in preset time period the unfinished write operation that non-Receiving Host is sent data, using hosting
The last time writes successful data cover and writes successful data for the last time from storage device in storage equipment.
In the present embodiment, after main storage system writes time exceeded message to main frame transmission, a timer can be started, if
In preset time period, main storage system does not receive the data of the unfinished write operation of main frame transmission, then reads main storage device
The middle last time writes successful data, and will write successful data for the last time from storage device using the data and be covered.
For example:After the preset lime, main storage system does not receive the data A of the unfinished write operation of main frame transmission, now will be main
The last time writes successful data cover and writes successful data for the last time from storage device in storage device, to ensure primary storage
Equipment is consistent with from the data in storage device, and can avoid the frequent interruption of double data writing operations, is hosted while mitigating
Storage system reads and writes the pressure of data.Wherein, for from storage device, if this data writing operation fails, last time
Write successful data and refer to that the last time writes successful data, if the success of this data writing operation, writes successful number for the last time
According to referring to that this writes successful data.
In addition, by judging whether main storage system receives the unfinished write operation that main frame is sent in preset time period
Data, the read-write time delay of main storage system can be reduced.Wherein, the value of preset time period can rule of thumb or data volume
Size choose suitable value, for example:When main storage system read-write data volume is big, 1.5s is chosen, when main storage system read-write
Data volume hour, chooses 1s.For the selection of the occurrence of preset time period, the present embodiment is not particularly limited herein.
Double methods for writing data that the present invention is provided, the double write data requests sent by Receiving Host, and simultaneously to master
The corresponding main storage devices of LUN carry out data writing operation respectively with from LUN is corresponding from storage device;If main storage system connects
The data of writing for receiving main storage device transmission retry message, and reception writes data response message from what storage device was returned, then to master
Machine sends and writes time exceeded message, so that main frame sends the data for not completing write operation to main storage system, if main storage system is pre-
If not receiving the data of the unfinished write operation of main frame transmission in the period, then write as work(using the last time in main storage device
Data cover write successful data for the last time from storage device.By determining main storage system in preset time period not
The data of unfinished write operation are received, successful data cover is write from storage device thereby using the last time in main storage device
Middle last time writes successful data, come ensure main storage device with from the consistent of storage device data, it is to avoid by frequent
Disconnect double business for writing data to start the situation of synchronous guarantee, reduce the risk for losing data, improve storage system
Reliability.
On the basis of above method embodiment, if main storage system receives main frame in preset time period and sent not
The data of write operation are completed, then will be write again to main storage device and from storage device needs what is rewritten in main storage device
Data.For example:Main storage system writes data A to main storage device and from storage device simultaneously, no matter receives from storage device
The successful message of data A of writing sent still writes data A failures, if once receiving writing for main storage device transmission
The message that data A is retried, is considered as main storage device and inconsistent from the data in storage device, now, again writes data A
Enter main storage device and from storage device.
On the basis of above method embodiment, the relevant information of data to be written is carried in double write data requests, wherein,
The position of relevant information including data to be written and size, so that main storage system can be according to the position of data to be written and big
It is small, data writing operation is carried out respectively to main storage device and from storage device.
On the basis of above method embodiment, the letter that data retry the data that unfinished write operation is carried in message is write
Breath, so that the data of writing that main storage system can be returned according to main storage device retry the unfinished write operation carried in message
Data relevant information, determine need rewrite data, and by need rewrite data be marked.In addition, main frame connects
Receive and write after time exceeded message, the data for not completing write operation are sent to main storage system, optionally, when main storage system is default
The data of the unfinished write operation of main frame transmission are received in period, then are deleted the mark that the data to rewriting are made, together
When the data of unfinished write operation that are sent according to main frame, this is write to main storage device and from storage device again and is not completed
The data of write operation;When main storage system is not received by the number of the unfinished write operation of main frame transmission in preset time period
According to then main storage system can be according to the mark made, and the last time writes successful data in acquisition main storage device, and use should
Data cover writes successful data for the last time from storage device, wherein, the mark made includes not completing write operation
The position of data and size.
Fig. 2 writes the schematic flow sheet of the embodiments of the method two of data for the present invention couple.The present embodiment is in double sides for writing data
On the basis of method embodiment one, if pair receiving the embodiment for writing data success message of main storage device transmission, make specifically
It is bright.As shown in Fig. 2 the method for the present embodiment can include:
Step 201:Receiving Host send double write data requests, and simultaneously to the corresponding main storage devices of main LUN and from
LUN is corresponding to carry out data writing operation respectively from storage device.
In the present embodiment, position and the size of data to be written are carried in double write data requests, so that main storage system
Know by which data write-in main storage device and from storage device, and the position according to data to be written and size, to main memory
Storage equipment and the operation for entering row write data from storage device.
Step 202, judge whether receive main storage device send data of writing retry message.
Step 208 is directly performed after step 203 if so, then performing, otherwise, step 204 is performed.
Step 203, reception write data response message from what storage device was returned, are sent to main frame and write time exceeded message, so that
Main frame sends the data for not completing write operation to main storage system.
In the present embodiment, if the data of writing that main storage system receives main storage device transmission retry message, it can wait
Return write-back response message from storage device, when receive from storage device return after writing data response message, according to writing
Data retry the information of the data of the unfinished write operation carried in message, mark the data for needing to rewrite, while starting weight
Timer is tried, judges whether main storage system can receive the number of unfinished write operation of main frame transmission within the default period
According to.
What step 204, determination reception main storage device were sent writes data success message.
Step 205, judge whether receive from storage device send write data success message.
If so, performing step 206, otherwise, step 207 is performed.
Step 206, sent to main frame and write data and successfully instruct, and delete the relevant information of data to be written.
In the present embodiment, main storage system be respectively received main storage device with from storage device send write data into
After work(message, return write-back to main frame and successfully instruct, meanwhile, the position of data to be written and size are deleted, with progress
Double write operations of one data.
Step 207, interrupt to the data writing operation carried out from storage device, and send to main frame and to write data and successfully instruct.
In the present embodiment, data success message is write when what main storage system received main storage device transmission, and from depositing
When writing data failure message of equipment transmission is stored up, the data now from storage device are unavailable, therefore, set interrupting to from storage
It is standby to proceed to write the operation of data, and return write-back to main frame and successfully instruct, and record failure is write from storage device
Data position and size.
Step 208, the data for judging whether the unfinished write operation that Receiving Host is sent in preset time period.
In the present embodiment, by starting a timer, judge whether main storage system receives in preset time period
The data for the unfinished write operation that main frame is sent, if so, then performing step 209, otherwise, perform step 211.
Step 209, will again to main storage device and from storage device carry out data writing operation.
In the present embodiment, if main storage system receives the unfinished write operation of main frame transmission in preset time period
Data, then re-write main storage device and from storage device by the data for not completing write operation.
If step 210, the completion rewrite operation message that reception main storage device is sent in preset time period, deletion are treated
Write the relevant information of data.
In the present embodiment, if main storage device completes rewrite operation, main storage device within the default period
It is identical with the data from storage device, it is now, the timer of setting is related to size etc. to the position of the data to be written of record
Information deletion, to carry out double write operations of next data.
Step 211, write successful data cover using the last time in main storage device and write for the last time from storage device
Successful data.
In the present embodiment, if main storage system does not receive the unfinished write operation of main frame transmission in preset time period
Data, then according to the mark made of data to needing to rewrite, obtaining the last time in main storage device writes successful data, and
Successful data are write for the last time from storage device using the data cover, it can be seen that, write data when main storage device and surpass
When after, can automatically carry out the reparation of data consistency by main storage device and from the data of storage device, it is to avoid people
The intervention of work, improves the self-healing property of system.
Need to illustrate, if main storage system receive main storage device transmission write data failure message,
The relevant information of data to be written is preserved, data failure instruction is write while being returned to main frame.
Double methods for writing data that the present invention is provided, the double write data requests sent by Receiving Host, and simultaneously to master
The corresponding main storage devices of LUN carry out data writing operation respectively with from LUN is corresponding from storage device;If main storage system connects
Receive the data of writing that main storage device sends and retry message, and receive from storage device return write data response message after, to
Main frame sends and writes time exceeded message, so that main frame sends the data for not completing write operation to main storage system, if in preset time period
The data for the unfinished write operation that the interior non-Receiving Host of main storage system is sent, then write as work(using the last time in main storage device
Data cover write successful data for the last time from storage device.By determining main storage system in preset time period not
The data of unfinished write operation are received, successful data cover is write from storage device thereby using the last time in main storage device
Middle last time writes successful data, come ensure main storage device with from the consistent of storage device data, it is to avoid by frequent
Disconnect double business for writing data to start the situation of synchronous guarantee, reduce the risk for losing data, improve storage system
Reliability.
Alternatively, on the basis of above method embodiment, successful data is write using the last time in main storage device and are covered
Lid is write after successful data for the last time from storage device, and data success message is write from what storage device was sent if receiving,
Then delete the relevant information of data to be written;Otherwise, to the main storage device and described from storage device row write data are entered again
Operation.
Specifically, successful data cover is write using the last time in main storage device to be write as the last time from storage device
After the data of work(, the result of write-back will be returned from storage device, if data success is write from storage device, to primary storage
System returns write-back and retries message, while the relevant informations such as the position of the data to be written of record and size are deleted;If from depositing
Storage equipment, which is returned, writes data failure message, then reports replicate data error message to main storage system, and interrupt again to main memory
Storage equipment and the operation for entering row write data from storage device, that is, interrupt main storage device and closed from the duplication between storage device
System, while the difference for writing data will be recorded, and sends the result that main storage system writes data to main frame.In concrete implementation process
In, the last time in main storage device can be write into successful data cover from storage device by opening synchronous mode manually
Last time write successful data, it is ensured that main storage device and from storage device data uniformity.
Fig. 3 writes the structural representation of the device embodiments one of data for the present invention couple, as shown in figure 3, the embodiment of the present invention
The double devices for writing data provided include receiving module 301, processing module 302 and sending module 303.
Wherein, receiving module 301 is used for double write data requests that Receiving Host is sent;Processing module 302 be used for simultaneously to
The corresponding main storage devices of primary logical unit LUN carry out data writing operation respectively with from LUN is corresponding from storage device;Hair
Send module 303 to be used to retry message in the data of writing that the receiving module receives the main storage device transmission, and receive institute
State and being write from what storage device was returned after data response message, sent to the main frame and write time exceeded message, so that the main frame is to institute
State main storage system and send the data for not completing write operation;If the processing module 302 is additionally operable to the receiving module default
The data for the unfinished write operation that the main frame is sent are not received in period, then are write using the last time in the main storage device
Successful data are write for the last time from storage device described in successful data cover.
Double devices for writing data that the present invention is provided, the double write data requests sent by Receiving Host, and simultaneously to master
The corresponding main storage devices of LUN carry out data writing operation respectively with from LUN is corresponding from storage device;If main storage system connects
The data of writing for receiving main storage device transmission retry message, and reception writes data response message from what storage device was returned, then to master
Machine sends and writes time exceeded message, so that main frame sends the data for not completing write operation to main storage system, if main storage system is pre-
If not receiving the data of the unfinished write operation of main frame transmission in the period, then write as work(using the last time in main storage device
Data cover write successful data for the last time from storage device.By determining main storage system in preset time period not
The data of unfinished write operation are received, successful data cover is write from storage device thereby using the last time in main storage device
Middle last time writes successful data, come ensure main storage device with from the consistent of storage device data, it is to avoid by frequent
Disconnect double business for writing data to start the situation of synchronous guarantee, reduce the risk for losing data, improve storage system
Reliability.
Alternatively, if the processing module 302 is additionally operable to the receiving module and the main frame is received in preset time period
Send unfinished write operation data, then will again to the main storage device and it is described from storage device enter row write data behaviour
Make.
Alternatively, the relevant information of data to be written is carried in described pair of write data requests, the relevant information includes described
The position of data to be written and size;
The processing module 302 is additionally operable to:
According to the position of the data to be written and size, described carried out from storage device to the main storage device and respectively
Data writing operation.
Alternatively, write data retry the information that the data for not completing write operation are carried in message;
The processing module 302 is additionally operable to:
The last time writes successful data in the main storage device according to the acquisition of information of the data of unfinished write operation, and
Write using the last time in the main storage device and write successful number described in successful data cover for the last time from storage device
According to.
Alternatively, if the sending module 303 be additionally operable to the receiving module 301 receive respectively the main storage device and
It is described to write data success message from what storage device was sent, then write data to main frame transmission and successfully instruct, the processing mould
Block 302 is used for the relevant information for deleting the data to be written;
If what the processing module 302 was additionally operable to that the receiving module 301 receives that the main storage device sends writes data
Success message, and write data failure message from what storage device was sent described in reception, then interrupt and carried out to described from storage device
Data writing operation, the sending module 303, which is used to send to main frame, to be write data and successfully instructs.
Alternatively, the processing module 302 is additionally operable to:
If the receiving module 301 receives the completion rewriting behaviour that the main storage device is sent in the preset time period
Make message, then delete the relevant information of the data to be written.
Alternatively, the processing module 302 is additionally operable to:
If the receiving module 301 receive it is described write data success message from what storage device was sent, delete described in treat
Write the relevant information of data;Otherwise, interrupt to the operation for entering row write data from storage device.
Double devices for writing data of the present embodiment, can be used for performing that any embodiment of the present invention provided double writes data
Method technical scheme, its implementing principle and technical effect is similar, and here is omitted.
Fig. 4 is the structural representation of storage device embodiment one of the present invention, as shown in figure 4, the storage that the present embodiment is provided
Equipment includes receiver 10, processor 11 and transmitter 12.
Wherein, receiver 10 is used for double write data requests that Receiving Host is sent, and processor 11 is used for simultaneously to main logic
The corresponding main storage devices of unit number LUN carry out data writing operation respectively with from LUN is corresponding from storage device;It is described to send
If device 12 retries message for the data of writing that receiver 10 receives the main storage device transmission, and is set described in reception from storage
It is standby return write after data response message, then sent to the main frame and write time exceeded message, so that the main frame is to the primary storage
System sends the data for not completing write operation;Do not connect in preset time period if the processor 11 is additionally operable to the receiver 10
The data for the unfinished write operation that the main frame is sent are received, then writes successful data using the last time in the main storage device and covers
Successful data are write for the last time from storage device described in lid.
Storage device provided in an embodiment of the present invention, can perform the technical scheme of above-mentioned double methods for writing data, in fact
Existing principle is similar with technique effect, will not be repeated here.
In embodiments of the present invention, if the processor 11 is additionally operable to the receiver 10 and institute is received in preset time period
The data of the unfinished write operation of main frame transmission are stated, then to the main storage device and described from storage device will enter row write again
Data manipulation.
In embodiments of the present invention, the relevant information of data to be written, the related letter are carried in described pair of write data requests
Breath includes position and the size of the data to be written;The processor 11 is additionally operable to according to the position of the data to be written and big
It is small, described from storage device carry out to the main storage device and respectively data writing operation.
In embodiments of the present invention, write data retry the information that the data for not completing write operation are carried in message;Institute
State processor 11 and be additionally operable to according to the acquisition of information for the data for not completing write operation that the last time is write as work(in main storage device
Data, and write described in successful data cover and write for the last time from storage device using the last time in the main storage device
Successful data.
In embodiments of the present invention, if the transmitter 12 is additionally operable to the receiver 10 primary storage is received respectively sets
Data success message is write from what storage device was sent for described, then writing data to main frame transmission successfully instructs, the place
Reason device 11 is used for the relevant information for deleting the data to be written;If the processor 11 is additionally operable to the receiver 10 and receives described
What main storage device was sent writes data success message, and receive it is described write data failure message from what storage device was sent, then in
Break to the data writing operation carried out from storage device, the transmitter 12 is successfully instructed for writing data to main frame transmission.
In embodiments of the present invention, if the processor 11 is received for the receiver 10 in the preset time period
The completion rewrite operation message that the main storage device is sent, then delete the relevant information of the data to be written.
In embodiments of the present invention, if the processor 11 receives described from storage device transmission for the receiver 10
The relevant information write data success message, then delete the data to be written;Otherwise, interrupt again to the main storage device and
The operation for entering row write data from storage device.
Storage device provided in an embodiment of the present invention, can perform the technical scheme of above-mentioned double methods for writing data, in fact
Existing principle is similar with technique effect, will not be repeated here.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The related hardware of programmed instruction is crossed to complete.Foregoing program can be stored in a computer read/write memory medium.The journey
Sequence upon execution, performs the step of including above-mentioned each method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or
Person's CD etc. is various can be with the medium of store program codes.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent
The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to
The technical scheme described in foregoing embodiments can so be modified, or which part or all technical characteristic are entered
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology
The scope of scheme.
Claims (14)
1. a kind of double methods for writing data, it is characterised in that including:
Double write data requests that Receiving Host is sent, and simultaneously to the corresponding main storage devices of primary logical unit LUN and from LUN
It is corresponding to carry out data writing operation respectively from storage device;
If the data of writing for receiving the main storage device transmission retry message, and are writing number from what storage device was returned described in reception
After response message, then sent to the main frame and write time exceeded message, write so that the main frame sends not completing to main storage system
The data of operation;
If not receiving the data for the unfinished write operation that the main frame is sent in preset time period, set using the primary storage
The standby middle last time is write writes successful data for the last time from storage device described in successful data cover.
2. according to the method described in claim 1, it is characterised in that methods described also includes:
, will be again to the primary storage if receiving the data for the unfinished write operation that the main frame is sent in preset time period
Equipment and it is described from storage device carry out data writing operation.
3. method according to claim 2, it is characterised in that the correlation of data to be written is carried in described pair of write data requests
Information, the relevant information includes position and the size of the data to be written;
It is described while entering respectively from storage device with from LUN is corresponding to the corresponding main storage devices of primary logical unit LUN
Row write data manipulation, is specifically included:
According to the position of the data to be written and size, described enter to the main storage device and respectively row write number from storage device
According to operation.
4. the method according to claim 1 or 3, it is characterised in that write data are retried to carry not completing in message and write
The information of the data of operation;
Described write using the last time in the main storage device is write for the last time described in successful data cover from storage device
Successful data, are specifically included:
The last time writes successful data in the main storage device according to the acquisition of information of the data of unfinished write operation, and uses
The last time is write in the main storage device writes successful data for the last time from storage device described in successful data cover.
5. method according to claim 3, it is characterised in that described while being hosted to primary logical unit LUN is corresponding
Storage equipment with from LUN is corresponding carry out data writing operation respectively from storage device after, in addition to:
If receive respectively the main storage device and it is described from storage device send write data success message, to the main frame
Transmission is write data and successfully instructed, and deletes the relevant information of the data to be written;Or,
If receive the main storage device transmission writes data success message, and writes data from what storage device was sent described in reception
Failed message, then interrupt to the data writing operation carried out from storage device, and sent to main frame and write data and successfully instruct.
6. the method according to claim 3 or 5, it is characterised in that it is described will be again to the main storage device and described
After storage device carries out data writing operation, in addition to:
If receiving the completion rewrite operation message that the main storage device is sent in the preset time period, treated described in deletion
Write the relevant information of data.
7. the method according to claim 3 or 5, it is characterised in that described to be write using the last time in the main storage device
After writing successful data described in successful data cover for the last time from storage device, in addition to:
If receiving the relevant information write data success message, delete the data to be written sent from storage device;
Otherwise, interrupt again to the main storage device and the operation for entering row write data from storage device.
8. a kind of double devices for writing data, it is characterised in that including:
Receiving module, the double write data requests sent for Receiving Host;
Processing module, for simultaneously corresponding from storage device with from LUN to the corresponding main storage devices of primary logical unit LUN
It is middle to carry out data writing operation respectively;
Sending module, the data of writing for receiving the main storage device transmission in the receiving module retry message, and are connecing
The writing after data response message from storage device return is received, is sent to the main frame and writes time exceeded message, so that the main frame
The data for not completing write operation are sent to main storage system;
The processing module, if be additionally operable to the receiving module does not receive not completing for the main frame transmission in preset time period
The data of write operation, then write described in successful data cover last from storage device using the last time in the main storage device
Once write successful data.
9. device according to claim 8, it is characterised in that
The processing module, if being additionally operable to unfinished the writing that the receiving module receives the main frame transmission in preset time period
The data of operation, then will again to the main storage device and it is described from storage device carry out data writing operation.
10. device according to claim 9, it is characterised in that the phase of data to be written is carried in described pair of write data requests
Information is closed, the relevant information includes position and the size of the data to be written;
The processing module is additionally operable to:
According to the position of the data to be written and size, described enter to the main storage device and respectively row write number from storage device
According to operation.
11. the device according to claim 8 or 10, it is characterised in that write data are retried to carry in message and do not completed
The information of the data of write operation;
The processing module is additionally operable to:
The last time writes successful data in the main storage device according to the acquisition of information of the data of unfinished write operation, and uses
The last time is write in the main storage device writes successful data for the last time from storage device described in successful data cover.
12. device according to claim 10, it is characterised in that if the sending module is additionally operable to the receiving module point
Do not receive the main storage device and it is described from storage device send write data success message, then to the main frame send write number
According to successfully instructing, the processing module is used for the relevant information for deleting the data to be written;
If what the processing module was additionally operable to that the receiving module receives that the main storage device sends writes data success message, and
Data failure message is write from what storage device was sent described in receiving, then interrupts and is grasped to the data of writing carried out from storage device
Make, the sending module is successfully instructed for writing data to main frame transmission.
13. the device according to claim 10 or 12, it is characterised in that the processing module is additionally operable to:
If the receiving module receives the completion rewrite operation message that the main storage device is sent in the preset time period,
Then delete the relevant information of the data to be written.
14. the device according to claim 10 or 12, it is characterised in that the processing module is additionally operable to:
If the receiving module writes data success message described in receiving from what storage device was sent, the data to be written are deleted
Relevant information;Otherwise, interrupt again to the main storage device and the operation for entering row write data from storage device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410676570.2A CN104407814B (en) | 2014-11-21 | 2014-11-21 | Double method and apparatus for writing data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410676570.2A CN104407814B (en) | 2014-11-21 | 2014-11-21 | Double method and apparatus for writing data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104407814A CN104407814A (en) | 2015-03-11 |
CN104407814B true CN104407814B (en) | 2017-10-17 |
Family
ID=52645447
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410676570.2A Active CN104407814B (en) | 2014-11-21 | 2014-11-21 | Double method and apparatus for writing data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104407814B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106502822A (en) * | 2015-09-08 | 2017-03-15 | 中兴通讯股份有限公司 | Data read-write method and device |
CN111176559B (en) * | 2015-12-04 | 2023-07-11 | 成都华为技术有限公司 | Data writing method and device and dual-activity system |
CN106909307B (en) * | 2015-12-22 | 2020-01-03 | 华为技术有限公司 | Method and device for managing double-active storage array |
CN107016029B (en) * | 2016-12-13 | 2020-11-06 | 创新先进技术有限公司 | Method, device and system for processing service data |
CN107203339B (en) * | 2017-05-10 | 2020-04-21 | 杭州宏杉科技股份有限公司 | Data storage method and device |
CN113190177B (en) * | 2021-05-12 | 2023-07-14 | 西安雷风电子科技有限公司 | Data storage method, terminal equipment, server and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101169705A (en) * | 2007-11-30 | 2008-04-30 | 中兴通讯股份有限公司 | Method for implementing file class mirror-image under multiple hard disk based on nude file system |
CN103036717A (en) * | 2012-12-12 | 2013-04-10 | 北京邮电大学 | Consistency maintenance system and methods for distributed-type data |
CN103297268A (en) * | 2013-05-13 | 2013-09-11 | 北京邮电大学 | P2P (peer to peer) technology based distributed data consistency maintaining system and method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4129381B2 (en) * | 2002-09-25 | 2008-08-06 | 株式会社ルネサステクノロジ | Nonvolatile semiconductor memory device |
-
2014
- 2014-11-21 CN CN201410676570.2A patent/CN104407814B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101169705A (en) * | 2007-11-30 | 2008-04-30 | 中兴通讯股份有限公司 | Method for implementing file class mirror-image under multiple hard disk based on nude file system |
CN103036717A (en) * | 2012-12-12 | 2013-04-10 | 北京邮电大学 | Consistency maintenance system and methods for distributed-type data |
CN103297268A (en) * | 2013-05-13 | 2013-09-11 | 北京邮电大学 | P2P (peer to peer) technology based distributed data consistency maintaining system and method |
Also Published As
Publication number | Publication date |
---|---|
CN104407814A (en) | 2015-03-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104407814B (en) | Double method and apparatus for writing data | |
US8504765B2 (en) | Method of improving efficiency of capacity of volume used for copy function and apparatus thereof | |
JP6344798B2 (en) | Data transmission method, data reception method, and storage device | |
JP4800031B2 (en) | Storage system and snapshot management method | |
US7684073B2 (en) | Copy controller and method thereof | |
US8140790B2 (en) | Failure management method in thin provisioning technology for storage | |
US8285679B2 (en) | Creating a buffer point-in-time copy relationship for a point-in-time copy function executed to create a point-in-time copy relationship | |
US8285824B2 (en) | Storage system and data replication method that refuses one or more requests for changing the first logical configuration information until the first storage apparatus and second storage apparatus are synchronized | |
JP4783076B2 (en) | Disk array device and control method thereof | |
US8533411B2 (en) | Multiple backup processes | |
CN109522154A (en) | Data reconstruction method and relevant device and system | |
US7260739B2 (en) | Method, apparatus and program storage device for allowing continuous availability of data during volume set failures in a mirrored environment | |
CN105988901A (en) | Data copying method and storage system | |
US9213497B2 (en) | Storage apparatus and storage apparatus migration method | |
CN104484354B (en) | Ensure the Snapshot Method and storage device of data consistency | |
CN110515767A (en) | Snapshot data backup method, device, equipment and readable storage medium storing program for executing | |
CN104407806B (en) | The amending method and device of RAID group hard disc information | |
CN108234465A (en) | Abnormal redundancy approach and device are coped in a kind of distributed file system | |
CN109828950A (en) | Data protection method, management system, server and readable storage medium | |
US10209926B2 (en) | Storage system and control method therefor | |
CN112100003A (en) | Virtualized disk double-active disaster recovery method, device and system | |
US11048420B2 (en) | Limiting the time that I/O to a logical volume is frozen | |
CN107590024B (en) | Data storage method and data storage system | |
CN110618951A (en) | System high-availability storage control method and device, communication equipment and storage medium | |
CN110990191B (en) | Data recovery method and system based on mirror image storage |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |