A kind of dual control storage array solid state hard disk caching accelerated method
Technical field
The present invention relates to computer memory technical fields, and in particular to a kind of dual control storage array solid state hard disk caching acceleration
Method.
Background technique
Traditional mechanical hard disk (HDD) has large capacity advantage, but performance is relatively relatively low, especially random I/O performance,
The performance bottleneck for often becoming system, show under virtualized environment and becomes apparent, because virtualizing scene, to aggravate I/O random
Change.Compared to HDD, solid state hard disk (SSD) advantage with high performance, especially in terms of random I/O, advantage clearly, still
The hardware cost of SSD is relatively high.
Industry has done some optimizations in terms of combining the high-performance of large capacity and SSD of HDD at present, basic ideas be using
Caching of the SSD as HDD.Dsc data is cached by SSD, when storage control reads and writes data, once hit caching, just directly
It is read and write from caching.In SSD cold data caching can according to it is certain strategy under brush in HDD.It is utilized HDD's to reach
Large capacity advantage, and promote the purpose of HDD performance.
In the storage system of double storage controllers, since the metadata being buffered in controller memory will not periodic refreshing
To SSD, once master controller breaks down, storage service is switched to from controller, cache metadata do not update to from
Controller can not reorganize caching from controller, to cause loss of data.Therefore, the caching for realization dual controller adds
Speed will guarantee that the metadata of caching is lower in real time and brush to SSD.
Summary of the invention
(1) technical problems to be solved
The technical problem to be solved by the present invention is how to provide a kind of caching accelerated method of double storage controllers, realize
After the failure of one storage control, the storage operation of data is taken over by another controller, i.e., caching system still can be after
Continue and work in another controller, and guarantees that data storage service is not interrupted.
(2) technical solution
In order to solve the above-mentioned technical problems, the present invention provides a kind of dual control storage array solid state hard disks to cache acceleration side
Method, comprising the following steps:
(1) it creation caching: initializes cache object respectively in the memory of two storage controls A, B, and establishes caching
The caching of object indexes, and the corresponding caching index of each cache object, caching index is organized as a caching index tree,
Cache object is stored in the caching index tree in non-leaf nodes and indexes key, corresponding cache object is found according to these key and exists
Position on HDD;
The data cached mapping relations with HDD data of caching index record SSD, including HDD block data address, SSD
Data block address, data block size, caching number and data access time;
Every four caching index organizations are a caching group, and each caching group is one piece of contiguous memory in memory, corresponding
Unique caching group #;
The corresponding caching index tree of one rear end equipment, caching index tree are assigned with unique caching group #;
(2) caching read-write: traversal caching index updates the data access time of caching index, more for the caching of hit
Another controller memory index tree is newly arrived, reads and writes data from the SSD data block address of index;For the caching in unnatural death, from
HDD reads and writes data, and to memory index tree application available index, records the data to the corresponding SSD data block address of index;
(3) cache synchronization: the caching in storage control A memory is indexed by way of queue, is simultaneously sent to and deposits
In the memory for storing up controller B, the caching of storage control B is indexed by way of queue, storage control A is simultaneously sent to
In;
(4) it caches write-back: being executed by caching write-back thread, caching write-back thread statistics caching use space, caching uses
Space is the sum of the size of data in all caching indexes, when caching use space higher than highest threshold value, caches write-back thread
Start write-back buffer, by traversing the caching index tree, the caching group on index tree is cached described in poll, by each caching rope
Draw the corresponding position that corresponding caching is written back to back-end logic volume, the caching index of write-back is by the synchronous setting of two storage controls
Stop write-back buffer when spatial cache is lower than lowest threshold for available mode.
Preferably, in step (4), the corresponding caching of each caching index is written back to back-end logic volume by lru algorithm
Corresponding position.
Preferably, the caching index tree tissue is a B+ tree.
(3) beneficial effect
The present invention provides a kind of caching accelerated method of double storage controllers, after realizing a storage control failure,
The storage operation of data is taken over by another controller, i.e., caching system can still continue to work in another controller, and
Guarantee that data storage service is not interrupted.Caching index tree real-time synchronization in two storage controls is in mirrored state.When one
A storage control breaks down when failing, another controller can take in the storage on the fault point seamless pipe controller
Business.The present invention both ensure that the efficient performance of SSD buffer memory, in turn ensure the high reliability of SSD buffer memory.This method can
Applied to the business scenario in double storage controllers mixing storage array product, used simultaneously for SSD and HDD.It is total reducing
On the basis of body possesses cost, while not only having ensure that reliability, but also the overall performance of product is improved.
Detailed description of the invention
Fig. 1 is caching index structure schematic diagram of the invention;
Fig. 2 is caching index tree of the invention and caching group structural schematic diagram;
Fig. 3 is that dual control of the invention caches accelerated method data flow figure.
Specific embodiment
To keep the purpose of the present invention, content and advantage clearer, with reference to the accompanying drawings and examples, to of the invention
Specific embodiment is described in further detail.
As shown in Figure 1 to Figure 3, a kind of dual control storage array solid state hard disk caching accelerated method proposed by the present invention include with
Lower step:
(1) it creation caching: initializes cache object respectively in the memory of two storage controls A, B, and establishes caching
The caching of object indexes, and the corresponding caching index of each cache object, caching index is organized as a caching index tree,
Cache object is stored in the caching index tree in non-leaf nodes and indexes key, corresponding cache object is found according to these key and exists
Position on HDD creates following data structure in the present invention:
The caching index: the data cached mapping relations with HDD data of record SSD, including HDD block data address, SSD
Data block address, data block size, caching number and data access time;
Caching group: every four caching index organizations are a caching group, and each caching group is in one piece continuous in memory
It deposits, corresponding unique caching group #;
The caching index tree: the corresponding caching index tree of a rear end equipment, caching index tree tissue are a B+
Tree is assigned with unique caching group #;
(2) caching read-write: traversal caching index updates the data access time of caching index, more for the caching of hit
Another controller memory index tree is newly arrived, reads and writes data from the SSD data block address of index;For the caching in unnatural death, from
HDD reads and writes data, and to memory index tree application available index, records the data to the corresponding SSD data block address of index;
(3) cache synchronization: the caching in storage control A memory is indexed by way of queue, is simultaneously sent to and deposits
In the memory for storing up controller B, the caching of storage control B is indexed by way of queue, storage control A is simultaneously sent to
In;In this way, the caching index tree in two storage control memories keeps realtime uniform;
(4) cache write-back: caching write-back is executed by special caching write-back thread, and write-back thread statistics caching uses empty
Between, caching use space is that the sum of the size of data in all caching indexes is delayed when caching use space is higher than highest threshold value
It is stored back to and writes thread and start write-back buffer, by traversing the caching index tree, caching group on caching index tree described in poll will
Each caching index is corresponding to cache the corresponding position that back-end logic volume is written back to by lru algorithm, and the caching of write-back indexes quilt
Two storage controls synchronize and are set as available mode, when spatial cache is lower than lowest threshold, stop write-back buffer.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, without departing from the technical principles of the invention, several improvement and deformations can also be made, these improvement and deformations
Also it should be regarded as protection scope of the present invention.