CN103488435B - RAID sub-system and its data read-write method - Google Patents
RAID sub-system and its data read-write method Download PDFInfo
- Publication number
- CN103488435B CN103488435B CN201310440116.2A CN201310440116A CN103488435B CN 103488435 B CN103488435 B CN 103488435B CN 201310440116 A CN201310440116 A CN 201310440116A CN 103488435 B CN103488435 B CN 103488435B
- Authority
- CN
- China
- Prior art keywords
- band
- controller
- space
- disk
- data
- 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
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The embodiments of the invention provide a kind of RAID RAID sub-system, including the first controller and second controller and M disk;Whole memory spaces of M disk are divided into N number of band, and each band further comprises M stripe cell, are belonging respectively to different disks, and the memory space of each disk is divided into N number of stripe cell;First controller and second controller include spatial cache respectively, and spatial cache is divided into the band space mapped one by one with band;First controller is the master controller of X band in N number of band, at the same in N number of band remaining N X band from controller;Second controller be N number of band in X band from controller, while being the master controller of remaining N X band in N number of band.The embodiment of the present invention be may be implemented in RAID sub-system, and conflict is not produced when two controllers read and write the same local of disk at the same time under Active Active patterns.
Description
Technical field
The present invention relates to computer realm, and in particular to a kind of RAID sub-system and its data read-write method.
Background technology
Disk array with redundancy properties(Redundant Arrays of Inexpensive Disks, RAID)Skill
Art is that multiple independent disks are connected under same main frame or Magnetic Disk Controler, a disk array is formed, by same
Magnetic Disk Controler is managed and read and write scheduling, so that concurrent reading and writing and redundancy fault-tolerant can be realized.Dual controller RAID system is gathered around
There are two controllers, when a controller breaks down, another controller can continue to externally provide data, services, it is to avoid
Service disruption, greatly improved the availability of RAID sub-system.The framework of dual controller disk array system is as shown in figure 1, main
Machine is by the controller access disk groups of two hardware and software all sames, two controllers mirrored-redundant each other.This framework
Mainly there are two kinds of operational modes, it is a kind of to be referred to as active-backup(Active-backup)Pattern, in Active-backup patterns
Under, only one of which master controller can issue read-write requests to disk array when system is normally run, and another controller is located all the time
In stand-by state, only when master controller breaks down, spare controller can just be taken over;It is another referred to as active-active
(Active-Active)Pattern, under Active-Active patterns, two controllers are in activity when system is normally run
State, the read-write requests from main frame can be issued to disk array parallel by two controllers.
Obviously, under Active-Active patterns, there is the possibility that two controllers read while write disk the same area,
Can thus occur read/write conflict, data may be caused inconsistent.
The content of the invention
It is an object of the invention to provide a kind of RAID RAID sub-system, to realize in dual controller
In RAID sub-system, conflict is not produced when two controllers read and write the same local of disk at the same time under Active-Active patterns.
In a first aspect, the embodiments of the invention provide a kind of RAID RAID sub-system, RAID
System includes the first controller and second controller and M disk, first controller and the second controller mirror each other
Picture;
Whole memory spaces of the M disk are divided into N number of band, and each band further comprises M band list
Member, the M stripe cell is belonging respectively to different disks, and the memory space of each disk is divided into N number of stripe cell;
First controller and the second controller respectively include spatial cache, the spatial cache be divided into
The band space that the band maps one by one;
First controller be N number of band in X band master controller, while be N number of band in
Remaining N-X band from controller;The second controller be X band in N number of band from controller, together
When for remaining N-X band in N number of band master controller.
Based in a first aspect, in the first possible embodiment, the M disk passes through a serial connecting small
Computer interface expansion card constitutes a disk array;
First controller and second controller further comprise:
Central processing unit;
Sonet card, for transmitting data between first controller and second controller by optical fiber;
First network interface card, for being connected with external switch, the interchanger connects main frame;
Second network interface card, for transmitting synchronizing signal between first controller and second controller;
Minicomputer interface expansion card, for being connected with the Serial Attached Small Computer Interface Expanding card, in institute
State and carry out data transmission between the first controller, second controller and the disk array.
Second aspect, the embodiments of the invention provide a kind of RAID sub-system method for writing data, methods described includes:
The write data requests that current controller Receiving Host is sent, said write data are included in write data request
The first band in address, the address correspondence disk, the RAID sub-system includes the first controller and second controller and M
Individual disk, first controller and the second controller mirror image each other;Whole memory spaces of the M disk are divided
For N number of band, each band further comprises M stripe cell, and the M stripe cell is belonging respectively to different disks, often
The memory space of individual disk is divided into N number of stripe cell, and first band is one in N number of band, and described the
One controller and the second controller respectively comprising caching, it is described caching by can by dynamic be mapped to for the band one
One corresponding band space;First controller be N number of band in X band master controller, while be the N
Remaining N-X band from controller in individual band;The second controller be N number of band in X band from
Controller, while being the master controller of remaining N-X band in N number of band;
If whether there is free space in the caching of current controller;Then the free space is built with first band
Vertical mapping relations, using the free space as first band band space;
If free space is not present in the caching of current controller, free space is obtained;
The free space and first band are set up into mapping relations, the free space is regard as described first
The band space of band;
By said write data buffer storage in the band space of first band;
Judge current controller whether be first band master controller,
If so, then by write data ask be transmitted to first band from controller, enter with described from controller
Row data syn-chronization;
After the response that the data syn-chronization returned from controller is completed is received, by the band space of first band
In write-in data write first band.
Based on second aspect, in the first possible embodiment, judging whether current controller is described first
The master controller of band, afterwards,
If current controller is not the master controller of first band, write data request is transmitted to described the
The master controller of one band;
Said write data during the master controller of first band asks write data write described first
Band.
Based on second aspect, in second of possible embodiment, if described do not deposit in the caching of current controller
In free space, then free space is obtained, further comprised:
Judge to whether there is the first band space in the caching, the clean band space in the first band space position,
Data in first band space are had been stored in disk;
If in the presence of the first band space, the first band space is discharged for free space, for caching said write data;
If in the absence of first band space, selection second strip space carries out disk, the second strip space
For dirty band space, the data in the second strip space are not stored in the corresponding disk in second strip space
Band in, it is described fall disk refer to will be empty with the second strip in disk described in the data Cun Chudao in the second strip space
Between in corresponding band;
By second strip space release, the free space that write-in data are twisted into for caching is obtained.
Second of possible embodiment based on second aspect, in the third possible embodiment, the selection
Second strip space carries out disk and further comprised:
Choose access times and access time all meets an alternative band space of given threshold as second strip sky
Between, current controller for the corresponding band of the alternative band space master controller;
Band into the corresponding disk of the alternative band space sends write data requests;
Data in the alternative band are write the band by the band in the disk;
Current controller is after the response that the write operation of the band in receiving the disk is completed, and release is described
Alternative band space;
To being carried from the controller transmission notice of falling disk, the notice of falling disk for the alternative corresponding band of band space
There is the Counter Value of current controller.
The third possible embodiment based on second aspect, it is described alternative in the 4th kind of possible embodiment
What the master controller for receiving the corresponding band of the alternative band space from controller of the corresponding band of band space was sent
After the notice of falling disk, the Counter Value that will be subtracted from the count value of controller in the notice of falling disk;
, will be described from controller when the Counter Value in subtracting the notice of falling disk from the count value of controller is equal
Band space corresponding with the alternative band space is set to clean state;
, will be described from controller when the Counter Value in subtracting the notice of falling disk from the count value of controller is unequal
In band space corresponding with the alternative band space be set to dirty situation.
The third aspect, the embodiments of the invention provide a kind of RAID sub-system method for reading data, methods described includes:
The address of the target data is included in the read data request that Receiving Host is sent, the read data request, it is described
The first band in the correspondence disk of address, the RAID sub-system includes the first controller and second controller and M disk, institute
State the first controller and the second controller mirror image each other;Whole memory spaces of the M disk are divided into N number of
Band, each band further comprises M stripe cell, and the M stripe cell is belonging respectively to different disks, each disk
Memory space is divided into N number of stripe cell, and first band is one in N number of band, first controller
With the second controller respectively include spatial cache, the spatial cache by can by dynamic be mapped to for the band one
One corresponding band space;First controller be N number of band in X band master controller, while be the N
Remaining N-X band from controller in individual band;The second controller be N number of band in X band from
Controller, while being the master controller of remaining N-X band in N number of band;
If the target data is not stored in the caching of current controller in band space corresponding with the band,
Then, judge the current controller whether be first band master controller;
If current controller is not the master controller of first band, current controller is by the read data request
Be sent to first band from controller;
Receive the target data returned from controller;
The target data is buffered in the free space in the caching of current controller;
Current controller returns to the target data stored in the caching to the main frame.
Based on the third aspect, the read data request sent in the first possible embodiment, the Receiving Host is described
The address of the target data is included in read data request, afterwards:
If the target data is stored in the caching of current controller in band space corresponding with first band,
Current controller reads required data in the band space;
Afterwards, the step of target data that current controller is stored into the main frame return caching.
Based on the third aspect, in second of possible embodiment, judging whether the current controller is described
The master controller of first band, afterwards:
If current controller is the master controller of the band, first band of the current controller in the disk
Data needed for middle reading;
Afterwards, perform the step target data being buffered in the free space in the caching of current controller.
Based on second of possible embodiment of the third aspect, or the third aspect, in the third possible embodiment
In, it is described, the target data is buffered in the free space in the caching of current controller, further comprised:
When there is free space in the caching of current controller, by the data buffer storage in the free space;
Afterwards, the step of current controller is performed by described cache to the main frame return data;
When there is no free space in the caching of current controller, judge empty with the presence or absence of the first band in the caching
Between, the clean band space in first band space position, the data in first band space are had been stored in disk;
If in the presence of the first band space, the first band space is discharged for free space, for caching the data;
Afterwards, the step of current controller is performed by described cache to the main frame return data.
If in the absence of first band space, selection second strip space carries out disk, the second strip space
For dirty band space, the data in the second strip space are not stored in the corresponding disk in second strip space
Band in, it is described fall disk refer to will be empty with the second strip in disk described in the data Cun Chudao in the second strip space
Between in corresponding band;
By second strip space release, free space is obtained;
The target data is buffered in the free space;
Afterwards, current controller performs current controller execution and returns to the data by described cache to the main frame
Step.
The third possible embodiment based on the third aspect, in the 4th kind of possible embodiment, the selection
Second strip space carries out disk and further comprised:
Choose access times and access time all meets an alternative band space of given threshold as second strip sky
Between, current controller for the corresponding band of the alternative band space master controller;
Band into the corresponding disk of the alternative band space sends write data requests;
Data in the alternative band are write the band by the band in the disk;
Current controller is after the response that the write operation of the band in receiving the disk is completed, and release is described
Alternative band space;
To being carried from the controller transmission notice of falling disk, the notice of falling disk for the alternative corresponding band of band space
There is the Counter Value of current controller.
The 4th kind of possible embodiment based on the third aspect, it is described alternative in the 5th kind of possible embodiment
What the master controller for receiving the corresponding band of the alternative band space from controller of the corresponding band of band space was sent
After the notice of falling disk, the Counter Value that will be subtracted from the count value of controller in the notice of falling disk;
, will be described from controller when the Counter Value in subtracting the notice of falling disk from the count value of controller is equal
Band space corresponding with the alternative band space is set to clean state;
, will be described from controller when the Counter Value in subtracting the notice of falling disk from the count value of controller is unequal
In band space corresponding with the alternative band space be set to dirty situation.
By in RAID sub-system provided in an embodiment of the present invention, two controllers mirrored-redundant each other manages one jointly
Individual disk array, is that each STRIPE of disk array sets master controller and from controller, only STRIPE master controller
The STRIPE can be written and read, each band space in caching is safeguarded in two controllers and writes counter, from controller
Counter records main frame and give the write request number of times come, and the counter records of owner's controller come since writing for controller is same
Walk number of times;When running on Active-Active patterns, two controllers can issue read-write requests to disk array simultaneously, can
To avoid two controllers from reading while write the situation of the uniform areas conflict in domain, and reduce overhead.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
In required for the accompanying drawing that uses be briefly described, it should be apparent that, drawings in the following description are only some of the present invention
Embodiment, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these
Accompanying drawing obtains other accompanying drawings.
Fig. 1 is the Organization Chart of dual controller RAID sub-system;
Fig. 2 is the structure chart of RAID sub-system provided in an embodiment of the present invention;
Fig. 3 is the schematic diagram of disk array memory space division in the embodiment of the present invention;
Fig. 4 is provided in an embodiment of the present invention
Fig. 5 is provided in an embodiment of the present invention
Fig. 6 is provided in an embodiment of the present invention
Fig. 7 is provided in an embodiment of the present invention
Embodiment
Below by drawings and examples, technical scheme is described in further detail.
As shown in Fig. 2 the embodiments of the invention provide a kind of RAID RAID sub-system, RAID
System includes the first controller A and second controller B and M disk, and the first controller A and the second controller B are mutual
For mirror image.
First controller and second controller further comprise:Central processing unit(Central Processing
Unit, CPU), for transmitted by optical fiber between first controller and second controller data sonet card, for
First network interface card of external switch connection, for transmitting synchronizing signal between first controller and second controller
Two network interface cards, minicomputer interface expansion card is connected with interchanger by the first network interface card, further connects main frame;By small-sized
Computer interface expansion card SCSI and the connection of Serial Attached Small Computer Interface Expanding card, in first controller, second
Carry out data transmission between controller and the disk array.Additionally include caching RAW and hard disk.
The M disk constitutes a disk array, and in embodiments of the present invention, M disk is to be connected in series
SCSI (Serial Attached SCSI, SAS) hard disk, M SAS hard disk is serial by one by a M disk
Connect minicomputer interface expansion card (SAS Expander) and constitute a disk array, SAS Expander and two controls
Device A and B SCSI card connection.
SAS Expander are that SAS port is exchanged and extended chip, one side expansion interface quantity, hang controller
Connect more disks to constitute disk array, on the other hand it has port exchange capacity, can make two controllers A and B can
Any one disk being had access to according to SAS addresses in disk array;Two controllers A and B are that inside realizes RAID calculations
The disk array controller of method, their hardware configuration is identical, is mutually redundant, because they are identical, each other mirror image,
One controller is the mirror controller of another controller;Gigabit ethernet switch is used to externally provide data access chain
Road, that is to say, that outside main frame is connected to the interchanger by netting twine and configured after network IP can be to use double control
The data access service that device system is provided.
Described the first network interface card and the second network interface card is PCI-Express, and two controllers are the hardware core parts of system,
High-speed data service link is externally provided by PCI-Express inside controller A and control B.SCSI is used inside each controller
Card is connected to identical disk group.The RAW of high power capacity built in controller is as Cache (caching), for caching hot spot data.Two
Data in individual controller Cache Hot Spare each other, that is to say, that Cache is caching main frame just in real time in system operation
The data preserved in the data being written and read, and the Cache of two mirror controllers are identical, backup each other, so when one
When controller breaks down, it is possible to recover data cached from another controller.Two controllers are used as an entirety pair
Outer offer service, and both hardware configurations are identical, hardware redundancy each other, there is single-point when one of controller therefore
During barrier, another controller can be taken over, and continue externally to provide data, services, and Cache Hot Spares ensure that and be not in
Loss of data.Cache data syn-chronizations between controller are to use optical-fibre channel(Fibre Channel,FC)Carry out data biography
Defeated, with high-speed and high reliability, it is possible to increase the message transmission rate between two controllers, reduction system is overall to ask
Ask the response time.Heartbeat communication is carried out using PCI-Express between two controllers, heartbeat is for reporting this control to other side
Between the packet of the state of device, controller by heartbeat can interpolate that other side reach the standard grade, offline, failure situations such as.
As shown in figure 3, the M disk constitutes a disk array, whole memory spaces of the M disk are divided
For N number of band, each band further comprises M stripe cell (stripe unit, SU), and the M stripe cell belongs to respectively
In different disks, the memory space of each disk is divided into N number of stripe cell;
First controller and the second controller respectively include spatial cache, the spatial cache be divided into
The band space that the band maps one by one;
First controller be N number of band in X band master controller, while be N number of band in
Remaining N-X band from controller;The second controller be X band in N number of band from controller, together
When for remaining N-X band in N number of band master controller.
Master controller for band and divided from controller, a kind of relatively simple embodiment is, controller A conducts
The master controller of the band of serial number odd number, controller A as the band of serial number even number from controller, while controller B
As the master controller of the band of serial number even number, controller B is as the band of serial number odd number from controller.
User can also select opposite embodiment, for example, using controller A as the band of serial number even number master control
Device processed, is seldom repeated.
Controller cache(Cache)In be also the band in caching using band as base unit to data cached management
Space is the same with the stripe size in disk array, and can be dynamically configured as mapping one by one.With band
Similar, each band space in the caching data structure safeguarded in Cache is also by multiple SU(STRIPE UNIT)Constitute, often
One SU is also identical with a stripe unit size in a band, refers to that a band is shared in a certain piece of disk
Address space, as illustrated, each band space is it is possible that existing dirty data (Dirty Su), clean data(Clean
Su), also either with or without data cached.Controller is received after continuous read-write requests, and read-write requests are entered according to STRIPE sizes
Row is divided into small task, and then controller handles each task in units of STRIPE, then completes each STRIPE
Task.
As shown in figure 4, based on the above embodiments, the embodiments of the invention provide a kind of RAID sub-system data write-in side
Method, methods described includes:
401, the write data requests that current controller Receiving Host is sent include said write number in write data request
According to address, the first band in the correspondence disk of the address;
Specifically, the write data requests that current controller Receiving Host is sent, carry in need in write data requests
The write-in data of disk and the address of write-in data are write, the address is corresponding to one section of memory space in disk array, and this is deposited
Storage space is a stripe cell in a band or a band.
After write data requests are received, current controller judges to whether there is free space in caching cache.
402, if there is free space in the caching of current controller, the free space is built with first band
Vertical mapping relations, using the free space as first band band space;
403, if free space is not present in the caching of current controller, obtain free space;
Specifically, if there is no free space, then need to obtain free space in the buffer, to store write-in data,
Specifically, the method for obtaining free space refers to Fig. 6 and is:
Judge to whether there is the first band space in the caching, the clean band space in the first band space position,
Data in first band space are had been stored in disk;
If in the presence of the first band space, the first band space is discharged for free space, for caching said write data;
If in the absence of first band space, selection second strip space carries out disk, the second strip space
For dirty band space, the data in the second strip space are not stored in the corresponding disk in second strip space
Band in, it is described fall disk refer to will be empty with the second strip in disk described in the data Cun Chudao in the second strip space
Between in corresponding band;
By second strip space release, the free space for caching said write data is obtained.
Further, in figure 6 it can be seen that the selection second strip space carries out disk and further comprised:
Choose access times and access time all meets an alternative band space of given threshold as second strip sky
Between, current controller for the corresponding band of the alternative band space master controller;
Specifically, current controller can select an access times fewer by hot spot data life cycle algorithm, or
The band space alternately band space, and the master controller of the corresponding band of the band space that person accesses daily for a long time
For current controller.
Band into the corresponding disk of the alternative band space sends write data requests;
Data in the alternative band are write the band by the band in the disk;
Current controller is after the response that the write operation of the band in receiving the disk is completed, and release is described
Alternative band space;
To being carried from the controller transmission notice of falling disk, the notice of falling disk for the alternative corresponding band of band space
There is the Counter Value of current controller.
The alternative band space corresponding band receives the corresponding band of the alternative band space from controller
The notice of falling disk that sends of master controller after, will be subtracted from the count value of controller described in Counter Value in the notice of falling disk;
, will be described from controller when the Counter Value in subtracting the notice of falling disk from the count value of controller is equal
Band space corresponding with the alternative band space is set to clean state;
, will be described from controller when the Counter Value in subtracting the notice of falling disk from the count value of controller is unequal
In band space corresponding with the alternative band space be set to dirty situation.
After getting free space by the method shown in Fig. 6 again, current controller performs step 404.
404, the free space and first band are set up into mapping relations, the free space is regard as described the
The band space of one band;
Specifically, the method shown in Fig. 6 is to obtain the free space in one section of caching, now needs to be to write again
The corresponding band in address and the free space in caching for entering data set up corresponding relation, are grasped with facilitating follow-up data to write
Make.
405, by said write data buffer storage in the band space of first band;
406, judge current controller whether be first band master controller,
407, if so, then by write data ask be transmitted to first band from controller, with described from control
Device carries out data syn-chronization;
If current controller is not the master controller of first band, write data request is transmitted to described the
The master controller of one band;
Said write data during the master controller of first band asks write data write described first
Band.
408, after the response that the data syn-chronization returned from controller is completed is received, by the band of first band
Write-in data in space write first band.
With reference to Fig. 5, the embodiment of the present invention will be caused to be easier to understand.
Accordingly, based on the RAID sub-system shown in Fig. 2, the embodiment of the present invention additionally provides a kind of RAID sub-system data
Read method, methods described refers to Fig. 7, including:
701, the read data request that Receiving Host is sent includes the address of the target data in the read data request,
The first band in the address correspondence disk;
After read data request is received, current controller will first judge the address corresponding first of the read data request
Whether required target data, that is to say, that whether cache can be hit, if institute if being still stored with the corresponding band space of band
State target data to be stored in the caching of current controller in band space corresponding with first band, then perform 702.
If the target data is not stored in the caching of current controller in band space corresponding with the band,
Then, perform 703. judge the current controller whether be first band master controller;
702, data needed for current controller is read in the band space
703, judge the current controller whether be first band master controller;
If current controller is not the master controller of first band, perform 704.
If current controller is the master controller of first band, step 705 is performed.
704, current controller by the read data request be sent to first band from controller;
In embodiments of the present invention, the mirror controller of current band is first band from controller
705, current controller reads the data in the first band, and the target data is performed afterwards and is buffered in current control
In free space in the caching of device
7056 receive the target data returned from controller, and the target data is buffered in into the slow of current controller
In the free space deposited;
707, current controller returns to the target data stored in the caching to the main frame.
Further, in the free space being buffered in the target data in the caching of current controller:
Current controller needs to judge in caching to be enough to have free space, there is the free time in the caching of current controller
During space, by the data buffer storage in the free space;
Afterwards, the step of current controller is performed by described cache to the main frame return data;
When there is no free space in the caching of current controller, judge empty with the presence or absence of the first band in the caching
Between, the clean band space in first band space position, the data in first band space are had been stored in disk;
If in the presence of the first band space, the first band space is discharged for free space, for caching the data;
Afterwards, the step of current controller is performed by described cache to the main frame return data.
If in the absence of first band space, selection second strip space carries out disk, the second strip space
For dirty band space, the data in the second strip space are not stored in the corresponding disk in second strip space
Band in, it is described fall disk refer to will be empty with the second strip in disk described in the data Cun Chudao in the second strip space
Between in corresponding band;
By second strip space release, free space is obtained;
The target data is buffered in the free space;
Afterwards, current controller performs current controller execution and returns to the data by described cache to the main frame
Step.
The method of disk with shown in Fig. 6 be that embodiment is identical, therefore seldom repeat.
Choose access times and access time all meets an alternative band space of given threshold as second strip sky
Between, current controller for the corresponding band of the alternative band space master controller;
Band into the corresponding disk of the alternative band space sends write data requests;
Data in the alternative band are write the band by the band in the disk;
Current controller is after the response that the write operation of the band in receiving the disk is completed, and release is described
Alternative band space;
To being carried from the controller transmission notice of falling disk, the notice of falling disk for the alternative corresponding band of band space
There is the Counter Value of current controller.
The alternative band space corresponding band receives the corresponding band of the alternative band space from controller
The notice of falling disk that sends of master controller after, will be subtracted from the count value of controller described in Counter Value in the notice of falling disk;
, will be described from controller when the Counter Value in subtracting the notice of falling disk from the count value of controller is equal
Band space corresponding with the alternative band space is set to clean state;
, will be described from controller when the Counter Value in subtracting the notice of falling disk from the count value of controller is unequal
In band space corresponding with the alternative band space be set to dirty situation.
By in RAID sub-system provided in an embodiment of the present invention, two controllers mirrored-redundant each other manages one jointly
Individual disk array, is that each STRIPE of disk array sets master controller and from controller, only STRIPE master controller
The STRIPE can be written and read, each band space in caching is safeguarded in two controllers and writes counter, from controller
Counter records main frame and give the write request number of times come, and the counter records of owner's controller come since writing for controller is same
Walk number of times;When running on Active-Active patterns, two controllers can issue read-write requests to disk array simultaneously, can
To avoid two controllers from reading while write the situation of the uniform areas conflict in domain, and reduce overhead.
Professional should further appreciate that, each example described with reference to the embodiments described herein
Unit and algorithm steps, can be realized with electronic hardware, computer software or the combination of the two, hard in order to clearly demonstrate
The interchangeability of part and software, generally describes the composition and step of each example according to function in the above description.
These functions are performed with hardware or software mode actually, depending on the application-specific and design constraint of technical scheme.
Professional and technical personnel can realize described function to each specific application using distinct methods, but this realize
It is not considered that beyond the scope of this invention.
The method that is described with reference to the embodiments described herein can use hardware, computing device the step of algorithm
Software module, or the two combination are implemented.Software module can be placed in random access memory(RAM), caching, read-only storage
(ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field
In any other form of storage medium well known to interior.
Above-described embodiment, has been carried out further to the purpose of the present invention, technical scheme and beneficial effect
Describe in detail, should be understood that the embodiment that the foregoing is only the present invention, be not intended to limit the present invention
Protection domain, within the spirit and principles of the invention, any modification, equivalent substitution and improvements done etc. all should be included
Within protection scope of the present invention.
Claims (10)
1. a kind of RAID sub-system method for writing data, it is characterised in that methods described includes:
The write data requests that current controller Receiving Host is sent, include the ground of said write data in write data request
The first band in location, the address correspondence disk, the RAID sub-system includes the first controller and second controller and M
Disk, first controller and the second controller mirror image each other;Whole memory spaces of the M disk are divided into
N number of band, each band further comprises M stripe cell, and the M stripe cell is belonging respectively to different disks, each
The memory space of disk is divided into N number of stripe cell, and first band is one in N number of band, described first
Controller and the second controller respectively comprising caching, it is described caching by can by dynamic be mapped to for the band one by one
Corresponding band space;First controller be N number of band in X band master controller, while be it is described N number of
N-X band of remaining in band from controller;The second controller is X band in N number of band from control
Device processed, while being the master controller of remaining N-X band in N number of band;
If whether there is free space in the caching of current controller;Then the free space is set up with first band and reflected
Penetrate relation, using the free space as first band band space;
If free space is not present in the caching of current controller, free space is obtained;
The free space and first band are set up into mapping relations, the free space is regard as first band
Band space;
By said write data buffer storage in the band space of first band;
Judge current controller whether be first band master controller,
If so, then by write data ask to be transmitted to first band from controller, from controller enter line number with described
According to synchronization;
After the response that the data syn-chronization returned from controller is completed is received, by the band space of first band
Write data and write first band;
If it is described in the caching of current controller be not present free space when, obtain free space, further comprise:
Judge to whether there is the first band space in the caching, the clean band space in first band space position, this
Data in one band space are had been stored in disk;
If in the presence of the first band space, the first band space is discharged for free space, for caching said write data;
If in the absence of first band space, selection second strip space carries out disk, and the second strip space is dirty
Band space, the data in the second strip space are not stored in the bar in the corresponding disk in second strip space
Band in, it is described fall disk refer to by disk described in the data Cun Chudao in the second strip space with the second strip space pair
In the band answered;
By second strip space release, the free space that write-in data are twisted into for caching is obtained.
2. method for writing data as claimed in claim 1, judge current controller whether be first band master control
Device processed, afterwards,
If current controller is not the master controller of first band, write data request is transmitted to described first
The master controller of band;
Said write data during the master controller of first band asks write data write first band.
3. method for writing data as claimed in claim 1, it is characterised in that the selection second strip space carries out disk and entered
One step includes:
Choose access times and access time and all meet an alternative band space of given threshold as second strip space, when
Preceding controller for the corresponding band of the alternative band space master controller;
Band into the corresponding disk of the alternative band space sends write data requests;
Data in the alternative band are write the band by the band in the disk;
Current controller discharges described alternative after the response that the write operation of the band in receiving the disk is completed
Band space;
Send that carried in the notice of falling disk, the notice of falling disk ought to the corresponding band of the alternative band space from controller
The Counter Value of preceding controller.
4. method as claimed in claim 3, it is characterised in that the alternative corresponding band of band space connects from controller
After the notice of falling disk of master controller transmission for receiving the corresponding band of the alternative band space, it will subtract from the count value of controller
The Counter Value gone in the notice of falling disk;
When the Counter Value in subtracting fall disk notices from the count value of controller is equal, described in general from controller with institute
State the corresponding band space of alternative band space and be set to clean state;
When the Counter Value in subtracting fall disk notices from the count value of controller is unequal, will described in from controller and
The corresponding band space of the alternative band space is set to dirty situation.
5. a kind of RAID sub-system method for reading data, it is characterised in that methods described includes:
The address of target data, the address correspondence are included in the read data request that Receiving Host is sent, the read data request
The first band in disk, the RAID sub-system includes the first controller and second controller and M disk, first control
Device processed and the second controller mirror image each other;Whole memory spaces of the M disk are divided into N number of band, each bar
Band further comprises M stripe cell, and the M stripe cell is belonging respectively to different disks, the memory space of each disk
It is divided into N number of stripe cell, first band is one in N number of band, first controller and described the
Two controllers include spatial cache respectively, and the spatial cache can be mapped to be one-to-one with the band by dynamic
Band space;First controller be N number of band in X band master controller, while be N number of band in
Remaining N-X band from controller;The second controller be X band in N number of band from controller, together
When for remaining N-X band in N number of band master controller;
If the target data is not stored in the caching of current controller in band space corresponding with the band, sentence
Break the current controller whether be first band master controller;
If current controller is not the master controller of first band, current controller sends the read data request
To first band from controller;
Receive the target data returned from controller;
The target data is buffered in the free space in the caching of current controller;
Current controller returns to the target data stored in the caching to the main frame.
6. method for reading data as claimed in claim 5, it is characterised in that the read data request that the Receiving Host is sent,
The address of the target data is included in the read data request, afterwards:
If the target data is stored in the caching of current controller in band space corresponding with first band, currently
Controller reads required data in the band space;
Afterwards, the step of target data that current controller is stored into the main frame return caching.
7. method for reading data as claimed in claim 5, it is characterised in that judging whether the current controller is described
The master controller of first band, afterwards:
If current controller is the master controller of the band, current controller is read in first band of the disk
Take required data;
Afterwards, perform the step target data being buffered in the free space in the caching of current controller.
8. the method for reading data as described in claim 5 or 7, it is characterised in that described, the target data is buffered in
In free space in the caching of current controller, further comprise:
When there is free space in the caching of current controller, by the data buffer storage in the free space;
Afterwards, the step of current controller is performed by described cache to the main frame return data;
When there is no free space in the caching of current controller, judge to whether there is the first band space, institute in the caching
The data stated in the clean band space in the first band space position, first band space are had been stored in disk;
If in the presence of the first band space, the first band space is discharged for free space, for caching the data;
Afterwards, the step of current controller is performed by described cache to the main frame return data;
If in the absence of first band space, selection second strip space carries out disk, and the second strip space is dirty
Band space, the data in the second strip space are not stored in the bar in the corresponding disk in second strip space
Band in, it is described fall disk refer to by disk described in the data Cun Chudao in the second strip space with the second strip space pair
In the band answered;
By second strip space release, free space is obtained;
The target data is buffered in the free space;
Afterwards, current controller performs current controller and performed by the step cached to the main frame return data
Suddenly.
9. method as claimed in claim 8, it is characterised in that the selection second strip space carries out disk and further wrapped
Include:
Choose access times and access time and all meet an alternative band space of given threshold as second strip space, when
Preceding controller is the master controller of the corresponding band of the alternative band space;
Band into the corresponding disk of the alternative band space sends write data requests;
Data in the alternative band are write the band by the band in the disk;
Current controller discharges described alternative after the response that the write operation of the band in receiving the disk is completed
Band space;
Send that carried in the notice of falling disk, the notice of falling disk ought to the corresponding band of the alternative band space from controller
The Counter Value of preceding controller.
10. method as claimed in claim 9, it is characterised in that the corresponding band of the alternative band space from controller
Receive after the notice of falling disk that the master controller of the corresponding band of the alternative band space is sent, by from the count value of controller
Subtract the Counter Value in the notice of falling disk;
When the Counter Value in subtracting fall disk notices from the count value of controller is equal, described in general from controller with institute
State the corresponding band space of alternative band space and be set to clean state;
When the Counter Value in subtracting fall disk notices from the count value of controller is unequal, will described in from controller and
The corresponding band space of the alternative band space is set to dirty situation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310440116.2A CN103488435B (en) | 2013-09-24 | 2013-09-24 | RAID sub-system and its data read-write method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310440116.2A CN103488435B (en) | 2013-09-24 | 2013-09-24 | RAID sub-system and its data read-write method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103488435A CN103488435A (en) | 2014-01-01 |
CN103488435B true CN103488435B (en) | 2017-08-04 |
Family
ID=49828704
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310440116.2A Active CN103488435B (en) | 2013-09-24 | 2013-09-24 | RAID sub-system and its data read-write method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103488435B (en) |
Families Citing this family (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104461968B (en) * | 2014-11-21 | 2017-08-11 | 华为技术有限公司 | A kind of I/O channel distribution method and device |
CN104793897B (en) * | 2015-02-04 | 2018-04-06 | 深圳神州数码云科数据技术有限公司 | A kind of bitmap storage method |
TWI560558B (en) * | 2015-06-08 | 2016-12-01 | Synology Inc | Method for managing a storage system, and associated apparatus |
CN106547473B (en) * | 2015-09-21 | 2019-08-13 | 华为数字技术(成都)有限公司 | A kind of writing method and device of disk array |
CN105335101B (en) * | 2015-09-29 | 2018-11-20 | 浪潮(北京)电子信息产业有限公司 | A kind of data processing method and system |
CN105389123A (en) * | 2015-10-16 | 2016-03-09 | 浪潮(北京)电子信息产业有限公司 | Storage management method and system based on dual controllers |
CN105389127B (en) * | 2015-11-04 | 2018-06-26 | 华为技术有限公司 | The method, apparatus of message and storage system, controller are transmitted within the storage system |
CN106294077B (en) * | 2016-08-31 | 2019-01-29 | 浪潮(北京)电子信息产业有限公司 | Link expander instrument operating condition monitoring method, system and server |
CN106445415B (en) * | 2016-09-21 | 2019-05-28 | 郑州云海信息技术有限公司 | A kind of caching mirror method and device controlled between storage more |
CN106648473B (en) * | 2016-12-30 | 2019-09-24 | 郑州云海信息技术有限公司 | A kind of dual control RAID synchronous method and device |
CN107688514A (en) * | 2017-08-31 | 2018-02-13 | 郑州云海信息技术有限公司 | A kind of more RAID read-write systems living |
CN109508147B (en) * | 2018-11-09 | 2022-03-08 | 郑州云海信息技术有限公司 | Cache data storage method, system and storage device |
CN110275680B (en) * | 2019-06-24 | 2020-12-01 | 浙江大华技术股份有限公司 | Double-control double-active storage system |
BR112022001182A2 (en) * | 2019-07-22 | 2022-03-29 | Huawei Tech Co Ltd | Method to improve the reliability of storage system, and related appliance |
CN111414317B (en) * | 2020-03-06 | 2022-11-25 | 苏州浪潮智能科技有限公司 | IO request processing method, device, equipment and readable storage medium |
CN113326005B (en) * | 2021-06-11 | 2023-01-06 | 苏州浪潮智能科技有限公司 | Read-write method and device for RAID storage system |
CN113867648B (en) * | 2021-10-14 | 2023-12-29 | 浪潮商用机器有限公司 | Server storage subsystem and control method thereof |
CN115543692B (en) * | 2022-11-16 | 2023-03-28 | 苏州浪潮智能科技有限公司 | Method, device, equipment and medium for recovering metadata by RAID controller |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW201133231A (en) * | 2010-03-25 | 2011-10-01 | Promise Technology Inc | Data storage system and synchronizing method for consistency thereof |
CN102214073A (en) * | 2010-04-08 | 2011-10-12 | 杭州华三通信技术有限公司 | Hot spare switching control method of redundant array of independent disks (RAID) and controller |
CN102682012A (en) * | 2011-03-14 | 2012-09-19 | 成都市华为赛门铁克科技有限公司 | Method and device for reading and writing data in file system |
CN102681794A (en) * | 2012-04-23 | 2012-09-19 | 浪潮(北京)电子信息产业有限公司 | Method and system for realizing redundant array protection of a disk based on double controllers |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101490327B1 (en) * | 2006-12-06 | 2015-02-05 | 퓨전-아이오, 인크. | Apparatus, system and method for managing commands of solid-state storage using bank interleave |
-
2013
- 2013-09-24 CN CN201310440116.2A patent/CN103488435B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW201133231A (en) * | 2010-03-25 | 2011-10-01 | Promise Technology Inc | Data storage system and synchronizing method for consistency thereof |
CN102214073A (en) * | 2010-04-08 | 2011-10-12 | 杭州华三通信技术有限公司 | Hot spare switching control method of redundant array of independent disks (RAID) and controller |
CN102682012A (en) * | 2011-03-14 | 2012-09-19 | 成都市华为赛门铁克科技有限公司 | Method and device for reading and writing data in file system |
CN102681794A (en) * | 2012-04-23 | 2012-09-19 | 浪潮(北京)电子信息产业有限公司 | Method and system for realizing redundant array protection of a disk based on double controllers |
Also Published As
Publication number | Publication date |
---|---|
CN103488435A (en) | 2014-01-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103488435B (en) | RAID sub-system and its data read-write method | |
CN100334567C (en) | Redundant external storage virtualization computer system | |
CN103763383B (en) | Integrated cloud storage system and its storage method | |
US9658912B2 (en) | Method and apparatus for implementing heartbeat service of high availability cluster | |
KR101455016B1 (en) | Method and apparatus to provide a high availability solid state drive | |
CN102770848B (en) | The dynamic management of the task that produces in memory controller | |
US9049242B2 (en) | Atomic cache transactions in a distributed storage system | |
KR101630583B1 (en) | Smart memory buffers | |
CN101566927B (en) | Memory system, memory controller and data caching method | |
US20200371692A1 (en) | Memory disaggregation for compute nodes | |
CN100383749C (en) | Remote copy method and remote copy system | |
CN103761058B (en) | RAID1 and RAID4 mixed structure network store system and method | |
CN103942112B (en) | Disk tolerance method, apparatus and system | |
CN103970712B (en) | Multiple core processing system and method | |
CN105955841B (en) | A kind of method that RAID dual controllers carry out write buffer mirror image using disk | |
GB2416414A (en) | Host-side rerouting of I/O requests in a data storage system with redundant controllers | |
CN103226519A (en) | Elastic cache of redundant cache data | |
CN102576329B (en) | In storage area network, the active-active of virtual memory management is supported | |
CN107329708A (en) | A kind of distributed memory system realizes data cached method and system | |
CN101739220A (en) | Method for designing multi-controller memory array | |
CN102763091A (en) | Integrating a flash cache into large storage systems | |
CN106775504A (en) | Double control disk array system and its data access method | |
CN110196818A (en) | Data cached method, buffer memory device and storage system | |
CN107766181A (en) | A kind of dual controller storage High Availabitity subsystem based on PCIe non-transparent bridges | |
CN106919339B (en) | Hard disk array and method for processing operation request by hard disk array |
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 |