CN104598336A - Rebuilding method and device based on RAID (redundant array of independent disk) algorithm - Google Patents

Rebuilding method and device based on RAID (redundant array of independent disk) algorithm Download PDF

Info

Publication number
CN104598336A
CN104598336A CN201510058699.1A CN201510058699A CN104598336A CN 104598336 A CN104598336 A CN 104598336A CN 201510058699 A CN201510058699 A CN 201510058699A CN 104598336 A CN104598336 A CN 104598336A
Authority
CN
China
Prior art keywords
data
raid
band
rebuild
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510058699.1A
Other languages
Chinese (zh)
Other versions
CN104598336B (en
Inventor
高华龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhou Yunke Beijing Technology Co ltd
Wuhan Shenzhou Digital Cloud Technology Co ltd
Original Assignee
Divine Land Beijing Yun Ke Data Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Divine Land Beijing Yun Ke Data Technologies Co Ltd filed Critical Divine Land Beijing Yun Ke Data Technologies Co Ltd
Priority to CN201510058699.1A priority Critical patent/CN104598336B/en
Publication of CN104598336A publication Critical patent/CN104598336A/en
Application granted granted Critical
Publication of CN104598336B publication Critical patent/CN104598336B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a rebuilding method based on an RAID (redundant array of independent disk) algorithm. The method comprises the following steps that during data rebuilding, a strip lock of a strip to be rebuilt is obtained, and data of the strip is read; data of a disk to be rebuilt is constructed and written according to the read data. The invention also provides a rebuilding device based on the RAID algorithm. The rebuilding device comprises a reading module and a writing module. Through a rebuilding thread independent from the RAID algorithm, the process relevant to the rebuilding in the RAID algorithm is subjected to high-degree abstraction, and can be intervened by events received by an RAID structure, the realization process of each RAID algorithm is simplified, and the maintenance of the whole system is easier.

Description

Based on method for reconstructing and the device of RAID algorithm
Technical field
The present invention relates to field of computer technology, be specifically related to the method for reconstructing based on RAID algorithm and device.
Background technology
Disk array (Redundant Arrays of independent Disks is called for short RAID), has the meaning of " array with redundant ability that independent disk is formed ".Principle utilizes array mode to make disk group, coordinates the design of data scatter arrangement, promotes the security of data.Disk array is by the more cheap disk of a lot of price, is combined into the disk group that a capacity is huge, utilizes indivedual disk to provide data to produce the whole disk system usefulness of addition effect promoting.Utilize this technology, data are cut into many sections, leave in respectively on each hard disk.When data reconstruction, by data as calculated after again insert in new hard disk.
In traditional RAID, because the principle of each algorithm inside is different, therefore in specific algorithm, provide method for reconstructing often, produced by certain concrete algoritic module and rebuild thread.
Traditional method for reconstructing, each algorithm is needed to realize method for reconstructing all separately, not only create the code that large amount of complex is difficult to safeguard like this, add and safeguard risk, and algorithm outside cannot be intervened reconstruction, switching efficiently and effectively cannot plant or start reconstruction thread when state changes.
Summary of the invention
For the defect of prior art, the invention provides a kind of method for reconstructing based on RAID and device, by independent of the reconstruction thread outside RAID algorithm, make to obtain high abstraction about the process of rebuilding in RAID algorithm, and the event intervention that can be received by RAID structure, simplify the implementation procedure of each algorithm of RAID, make whole system more easily safeguard.
First aspect, the invention provides a kind of method for reconstructing based on RAID algorithm, and described method comprises:
When carrying out data reconstruction, obtaining and needing the bar of the band rebuild locking, reading the data of described band;
The data of dish needing to rebuild are write according to the described data configuration read.
Preferably, described when carrying out data reconstruction, the bar obtaining band is locking, and before reading the step of the data of described band, described method also comprises:
Judge that whether disk array RAID is effective, if effectively, then read the data of band, otherwise stop rebuilding thread.
Preferably, described by after the step of the position of the described data Write fault dish of reading, described method also comprises:
The reconstruction marking described band in the bitmap bitmap of RAID completes.
Preferably, the data of the described band of described reading, comprising:
Structure reads the data that IO reads described band.
Preferably, the described described data configuration according to reading also writes the data needing the dish rebuild, and comprising:
According to the described data configuration call back function read, described data write is needed the dish rebuild.
Second aspect, the invention provides a kind of reconstructing device based on RAID algorithm, and described device comprises:
Read through model, for when carrying out data reconstruction, obtaining and needing the bar of the band rebuild locking, reading the data of described band;
Writing module, for writing according to the described data configuration read the data of dish needing to rebuild.
Preferably, described device also comprises:
Determination module, for judging that whether disk array RAID is effective, if effectively, then reads the data of band, otherwise stops rebuilding thread.
Preferably, described device also comprises:
Mark module, completes for the reconstruction marking described band in the bitmap bitmap of RAID.
Preferably, described read through model, specifically for:
Structure reads the data that IO reads described band.
Preferably, described writing module, specifically for:
According to the described data configuration call back function read, described data write is needed the dish rebuild.
As shown from the above technical solution, the invention provides a kind of method for reconstructing based on RAID and device, by independent of the reconstruction thread outside RAID algorithm, make to obtain high abstraction about the process of rebuilding in RAID algorithm, and the event intervention that can be received by RAID structure, simplify the implementation procedure of each algorithm of RAID, make whole system more easily safeguard.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these figure.
Fig. 1 is the schematic flow sheet of the method for reconstructing based on RAID algorithm that one embodiment of the invention provides;
Fig. 2 is the schematic flow sheet of the method for reconstructing based on RAID algorithm that another embodiment of the present invention provides;
Fig. 3 is the structural representation of the reconstructing device based on RAID algorithm that one embodiment of the invention provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
As shown in Figure 1, Fig. 1 shows the process flow diagram of the method for reconstructing based on RAID algorithm that one embodiment of the invention provides, and the method comprises the steps:
101, when carrying out data reconstruction, obtaining and needing the bar of the band rebuild locking, reading the data of described band.
Wherein, structure reads the data that IO reads described band.
102, write according to the described data configuration read the data of dish needing to rebuild.
Wherein, according to the described data configuration call back function read, described data write is needed the dish rebuild.
Alternatively, also comprise before step 101: judge that whether disk array RAID is effective, if effectively, then read the data of band, otherwise stop rebuilding thread.
Alternatively, also comprise after step 102: the reconstruction marking described band in the bitmap bitmap of RAID completes.
Specifically, the object of rebuilding in RAID algorithm is, as RAID because after the extracting or damage and be in degrading state of module dish, due to the insertion of disk or entering of HotSpare disk, RAID is made to enter reconstruction state, in this case, correct in order to ensure the information of data disks in RAID group and check disk, need the data ensureing once to drop out the position of disk to be re-write.
In fact rebuild for thread for each, if in units of band, process of reconstruction can be summed up as the information in reading disk, and writes the information of once out of order dish, two steps.In the present invention, only need RAID generic structure to provide, add bar locking, and the call back function writing once out of order dish data just can complete the process of reconstruction.
Specific works flow process of the present invention:
Start the process of rebuilding, the progress of reconstruction is all count from 0, and each unit rebuild is 1 band, after each reconstruction writes into, can mark this and rebuild in the bitmap of RAID at every turn.Start directly to skip when running into rebuilt band in scan rebuilding process in the past.Whether the process of reconstruction of each band is that the bar obtaining this band is locking, be suitable for continuing to rebuild under checking RAID current state, if be applicable to, reads the data of this band, then call corresponding RAID algorithm write back tune.
For each RAID algorithm, without the need to being concerned about the scheduling of thread resources, with the reading of data, only need pay close attention to how from one section of continuous print data strip, calculate or directly intercept out data, and sending in the disk being marked as and demoting and extract, and the reconstruction module taken out provides time-out independently, start, regulate the interfaces such as thread priority, call for RAID management framework.
The method that the present embodiment provides, simplify the reconstruction process logic of RAID algorithm, enhance the maintainability of algorithm, enhance the ability of RAID corresponding time, decrease the time that state switches, more promptly open and suspend reconstruction thread, removing bad to disk and the phenomenon of flash has very great help.
As shown in Figure 2, Fig. 2 shows another the comparatively process flow diagram of the method for reconstructing based on RAID algorithm of providing of specific embodiment of the present invention, and the method comprises the steps:
201, judge that whether RAID is effective, if so, then go to step 203, otherwise go to step 202.
202, stop rebuilding thread and exiting.
203, judge to rebuild thread whether to receive and suspend request, if so, then device step 204, otherwise device step 205.
204, reconstruction thread be adjusted to halted state and exit.
205, bar is obtained locking.
206, structure is read IO and is read strip data.
207, the data of the dish that need rebuild are write according to the data configuration read.
208, released strip is locking.
209, judge whether reconstruction completes, and if so, then goes to step, otherwise goes to step 211.
210, stop rebuilding thread and exiting.
211, recall reconstruction thread waits to be scheduled next time.
Present embodiments provide a kind of method for reconstructing based on RAID and device, by independent of the reconstruction thread outside RAID algorithm, make to obtain high abstraction about the process of rebuilding in RAID algorithm, and the event intervention that can be received by RAID structure, simplify the implementation procedure of each algorithm of RAID, make whole system more easily safeguard.
As shown in Figure 3, Fig. 3 shows the structural representation of the reconstructing device based on RAID algorithm that one embodiment of the invention provides, and this device comprises: read through model 301 and writing module 302.
Read through model 301, for when carrying out data reconstruction, obtaining and needing the bar of the band rebuild locking, reading the data of described band.
Writing module 302, for writing according to the described data configuration read the data of dish needing to rebuild.
Wherein, described device also comprises: determination module, for judging that whether disk array RAID is effective, if effectively, then reads the data of band, otherwise stops rebuilding thread.
Wherein, described device also comprises: mark module, completes for the reconstruction marking described band in the bitmap bitmap of RAID.
Wherein, read through model 301, specifically for: structure reads the data that IO reads described band.
Wherein, writing module 302, specifically for: according to the described data configuration call back function read, described data write is needed the dish rebuild.
Above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that; It still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (10)

1. based on a method for reconstructing for RAID algorithm, it is characterized in that, described method comprises:
When carrying out data reconstruction, obtaining and needing the bar of the band rebuild locking, reading the data of described band;
The data of dish needing to rebuild are write according to the described data configuration read.
2. method according to claim 1, is characterized in that, described when carrying out data reconstruction, and the bar obtaining band is locking, and before reading the step of the data of described band, described method also comprises:
Judge that whether disk array RAID is effective, if effectively, then read the data of band, otherwise stop rebuilding thread.
3. method according to claim 1, is characterized in that, described by after the step of the position of the described data Write fault dish of reading, described method also comprises:
The reconstruction marking described band in the bitmap bitmap of RAID completes.
4. method according to claim 1, is characterized in that, the data of the described band of described reading, comprising:
Structure reads the data that IO reads described band.
5. method according to claim 1, is characterized in that, the described described data configuration according to reading also writes the data needing the dish rebuild, and comprising:
According to the described data configuration call back function read, described data write is needed the dish rebuild.
6. based on a reconstructing device for RAID algorithm, it is characterized in that, described device comprises:
Read through model, for when carrying out data reconstruction, obtaining and needing the bar of the band rebuild locking, reading the data of described band;
Writing module, for writing according to the described data configuration read the data of dish needing to rebuild.
7. device according to claim 6, is characterized in that, described device also comprises:
Determination module, for judging that whether disk array RAID is effective, if effectively, then reads the data of band, otherwise stops rebuilding thread.
8. device according to claim 6, is characterized in that, described device also comprises:
Mark module, completes for the reconstruction marking described band in the bitmap bitmap of RAID.
9. device according to claim 6, is characterized in that, described read through model, specifically for:
Structure reads the data that IO reads described band.
10. device according to claim 6, is characterized in that, described writing module, specifically for:
According to the described data configuration call back function read, described data write is needed the dish rebuild.
CN201510058699.1A 2015-02-04 2015-02-04 Method for reconstructing and device based on RAID algorithm Active CN104598336B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510058699.1A CN104598336B (en) 2015-02-04 2015-02-04 Method for reconstructing and device based on RAID algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510058699.1A CN104598336B (en) 2015-02-04 2015-02-04 Method for reconstructing and device based on RAID algorithm

Publications (2)

Publication Number Publication Date
CN104598336A true CN104598336A (en) 2015-05-06
CN104598336B CN104598336B (en) 2018-04-24

Family

ID=53124150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510058699.1A Active CN104598336B (en) 2015-02-04 2015-02-04 Method for reconstructing and device based on RAID algorithm

Country Status (1)

Country Link
CN (1) CN104598336B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107748650A (en) * 2017-10-09 2018-03-02 暨南大学 Data reconstruction strategy based on lock mechanism in a kind of network code cluster storage system
CN108874314A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 A kind of reconstructing method and device of raid-array
CN112732167A (en) * 2019-10-28 2021-04-30 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for managing a storage system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101305334A (en) * 2004-12-29 2008-11-12 辉达公司 Intelligent storage engine for disk drive operations with reduced local bus traffic
CN101329641A (en) * 2008-06-11 2008-12-24 华中科技大学 Method for rebuilding data of magnetic disk array
US7958304B1 (en) * 2008-04-30 2011-06-07 Network Appliance, Inc. Dynamically adapting the fault tolerance and performance characteristics of a raid-based storage system by merging and splitting raid groups
CN102521068A (en) * 2011-11-08 2012-06-27 华中科技大学 Reconstructing method of solid-state disk array
CN102945191A (en) * 2012-11-15 2013-02-27 浪潮电子信息产业股份有限公司 RAID5 (redundant array of independent disk 5) data transfer method
CN103699336A (en) * 2013-12-03 2014-04-02 中国科学院计算技术研究所 Method and system for distributing and reestablishing data of magnetic disc array

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101305334A (en) * 2004-12-29 2008-11-12 辉达公司 Intelligent storage engine for disk drive operations with reduced local bus traffic
US7958304B1 (en) * 2008-04-30 2011-06-07 Network Appliance, Inc. Dynamically adapting the fault tolerance and performance characteristics of a raid-based storage system by merging and splitting raid groups
CN101329641A (en) * 2008-06-11 2008-12-24 华中科技大学 Method for rebuilding data of magnetic disk array
CN102521068A (en) * 2011-11-08 2012-06-27 华中科技大学 Reconstructing method of solid-state disk array
CN102945191A (en) * 2012-11-15 2013-02-27 浪潮电子信息产业股份有限公司 RAID5 (redundant array of independent disk 5) data transfer method
CN103699336A (en) * 2013-12-03 2014-04-02 中国科学院计算技术研究所 Method and system for distributing and reestablishing data of magnetic disc array

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
舒星: "磁盘阵列在线重建与RAID5扩容的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107748650A (en) * 2017-10-09 2018-03-02 暨南大学 Data reconstruction strategy based on lock mechanism in a kind of network code cluster storage system
CN107748650B (en) * 2017-10-09 2020-07-03 暨南大学 Data reconstruction strategy based on locking mechanism in network coding cluster storage system
CN108874314A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 A kind of reconstructing method and device of raid-array
CN112732167A (en) * 2019-10-28 2021-04-30 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for managing a storage system
CN112732167B (en) * 2019-10-28 2024-04-16 伊姆西Ip控股有限责任公司 Method and apparatus for managing storage system

Also Published As

Publication number Publication date
CN104598336B (en) 2018-04-24

Similar Documents

Publication Publication Date Title
CN103513942B (en) The reconstructing method of raid-array and device
WO2019196199A1 (en) Method and device for processing bad tracks of disk and computer storage medium
CN102682012A (en) Method and device for reading and writing data in file system
CN102184129B (en) Fault tolerance method and device for disk arrays
CN104598336A (en) Rebuilding method and device based on RAID (redundant array of independent disk) algorithm
JP2012533796A5 (en)
CN113051104B (en) Method and related device for recovering data between disks based on erasure codes
CN104142872A (en) Quick reestablishment method for RAID (redundan array of inexpensive disk)
CN103885726A (en) Efficient multi-thread log writing-in method
CN103810072A (en) Device and method for guaranteeing order execution of multithread tasks
CN105183583A (en) Method for data reconstruction of disk array, and disk array system
CN115599309B (en) NVMe disk array data processing method, device, equipment and storage medium
CN102708062A (en) Multimedia storage method and multimedia storage device based on data block
CN107885613A (en) A kind of method for writing data based on RAID5, device and medium
CN101729421A (en) Storage method and device based on time division multiplex
CN106469119A (en) A kind of data write buffer method based on NVDIMM and its device
CN101777009A (en) Load control method of application program
CN104572374B (en) Processing method, device and the storage device of storage
CN104407806B (en) The amending method and device of RAID group hard disc information
CN104156276B (en) It is a kind of to prevent two pieces of RAID methods of disk failures
CN106155847A (en) A kind of disk array
CN103914318A (en) Program starting method and device
CN100492306C (en) Data recovery method for independent magnetic disc redundant array damaging and its system
CN104598171A (en) Array reconstruction method and device based on metadata
CN113704380A (en) Distributed superposition analysis method and device based on spatial grid and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20170331

Address after: Nanshan District Guangdong streets, Shenzhen city 518131 Guangdong Province Road No. 8 financial services technology innovation base 1 building 11 floor F3

Applicant after: Shenzhen science and Technology Co.,Ltd. digital cloud data

Address before: 100085 Beijing, Haidian District, No. 9 on the ground floor of the digital science and Technology Plaza, 9

Applicant before: YUNKE CHINA DATA TECHNOLOGY LTD.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20190508

Address after: 430200 Six Floors of 777B Office Building, Guanggu Third Road, Donghu New Technology Development Zone, Wuhan City, Hubei Province

Patentee after: Wuhan Shenzhou Digital Cloud Technology Co.,Ltd.

Address before: 518131 F3, 11th floor, No. 8 Kefa Road, Yuehai Street, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: Shenzhen science and Technology Co.,Ltd. digital cloud data

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230418

Address after: 6 / F, office building B, No.777, Guanggu Third Road, Donghu New Technology Development Zone, Wuhan, Hubei 430200

Patentee after: Wuhan Shenzhou Digital Cloud Technology Co.,Ltd.

Patentee after: Shenzhou Yunke (Beijing) Technology Co.,Ltd.

Address before: 6 / F, office building B, No.777, Guanggu Third Road, Donghu New Technology Development Zone, Wuhan, Hubei 430200

Patentee before: Wuhan Shenzhou Digital Cloud Technology Co.,Ltd.

TR01 Transfer of patent right