CN109542687B - RAID level conversion method and device - Google Patents

RAID level conversion method and device Download PDF

Info

Publication number
CN109542687B
CN109542687B CN201811405206.7A CN201811405206A CN109542687B CN 109542687 B CN109542687 B CN 109542687B CN 201811405206 A CN201811405206 A CN 201811405206A CN 109542687 B CN109542687 B CN 109542687B
Authority
CN
China
Prior art keywords
raid level
level conversion
data
disk array
disk
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
Application number
CN201811405206.7A
Other languages
Chinese (zh)
Other versions
CN109542687A (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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201811405206.7A priority Critical patent/CN109542687B/en
Publication of CN109542687A publication Critical patent/CN109542687A/en
Application granted granted Critical
Publication of CN109542687B publication Critical patent/CN109542687B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1474Saving, restoring, recovering or retrying in transactions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0634Configuration or reconfiguration of storage systems by changing the state or mode of one or more devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application provides a method and a device for RAID level conversion, wherein the method for RAID level conversion comprises the following steps: firstly, performing first RAID level conversion on the determined storage area; in the process of executing the first RAID level conversion, when the first type of fault is determined to occur, performing a back-stepping operation on the first RAID level conversion according to the log chain, and continuously executing the first RAID level conversion; and after the first RAID level conversion is executed, performing second RAID level conversion on other areas except the storage area in the disk array. According to the technical scheme, RAID level conversion is firstly carried out on a part of storage areas in the disk array, and faults occurring in the process are eliminated, so that the occurrence rate of faults can be reduced in the process of carrying out RAID level conversion on other areas except the storage areas in the disk array, and the protection on data in the disk array is enhanced.

Description

RAID level conversion method and device
Technical Field
The present application relates to the field of data storage technologies, and in particular, to a RAID (Redundant array of Independent Disks) level conversion method and apparatus.
Background
RAID is a disk array that manages data storage, and one disk array includes a plurality of hard disks, and different RAID levels are formed in different combination modes of the hard disks in the disk array. Common RAID levels are RAID0, RAID1, RAID5, RAID6, and the like. The advantages and disadvantages of different RAID levels are different, for example, RAID0 uses a data blocking technique, and has the advantages of high throughput and load balancing, and the disadvantages of poor reliability and security; RAID5 uses a distributed parity technique, and parity data is uniformly distributed on each disk array drive in a spiral shape, which has the advantages of fast read/write speed, high security, and high space utilization, and has the disadvantage that if one disk is damaged, the system performance is reduced.
Because different RAID levels have different advantages and disadvantages, the existing RAID levels can be combined on the basis of the existing RAID levels, so that more RAID levels can be constructed, and the constructed RAID levels can balance the advantages and disadvantages of the existing RAID levels. For example, RAID01 is a combination of RAID0 and RAID1, and RAID01 has the advantages of both RAID0 and RAID 1. RAID50 is a combination of RAID5 and RAID0, RAID50 has the advantages of both RAID5 and RAID 0.
For the disk array with the set RAID level, the RAID level of the disk array can also be changed in a RAID level conversion mode. The RAID level conversion comprises structure transfer and data transfer, wherein the structure transfer refers to the conversion of the combination mode of the hard disks in the disk array, and the data transfer refers to the re-storage of the internal data stored in the disk array in the converted hard disks.
Taking FIG. 1 as an example, FIG. 1 illustrates the migration of a disk array from RAID01 to RAID 5. The number of hard disks of the disk array is 4, the capacity of each hard disk is 2T, and the capacity of the disk array is 4T at RAID01 level based on the mirror image structure of RAID 1. In the RAID level conversion process, two-by-two conversion of 4 hard disks is started, the RAID1 level hard disks are differentiated, the mirroring mode is removed, and then the RAID0 is differentiated and converted into a simple volume mode. After the conversion of RAID0 and RAID1 is completed, one of the hard disks is converted into a check disk, the other three hard disks are converted into data disks, and the data stored in the disk array is striped, at which time the RAID level of the disk array is changed to RAID 5.
However, during RAID level conversion of a disk array, if a failure occurs, data in the disk array may be lost. Therefore, how to reduce the occurrence rate of the failure in the RAID level conversion process of the disk array and further enhance the protection of the data in the disk array is an urgent problem to be solved.
Disclosure of Invention
An object of the embodiments of the present application is to provide a RAID level conversion method and apparatus, so as to reduce the occurrence rate of a failure in a RAID level conversion process of a disk array, and further enhance protection of data in the disk array. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a RAID level translation method, where the method includes:
determining a storage area with preset capacity from a disk array to be subjected to RAID level conversion, and performing first RAID level conversion on the storage area;
in the process of executing the first RAID level conversion, if a first type of fault is determined to occur, stopping executing the first RAID level conversion;
performing a back-stepping operation on the first RAID level conversion according to the occurrence time of the first type of fault and a log chain corresponding to the first RAID level conversion, and continuing to execute the first RAID level conversion after the first type of fault is determined to be eliminated;
and after the first RAID level conversion is executed, performing second RAID level conversion on other areas except the storage area in the disk array.
Optionally, when the storage area is a free storage area; performing a back-stepping operation on the first RAID level conversion according to the occurrence time of the first type of fault and the log chain corresponding to the first RAID level conversion, including:
determining a first time matched with the occurrence time of the first type of fault from a log chain, wherein the log chain is used for recording the execution starting time, the execution finishing time and the disk format of the disk array when the execution of each conversion action is finished in the RAID level conversion process;
determining that a first target transition action completed by a transition action has been performed before the first time;
and restoring the disk format of the disk array to the disk format of the disk array when the first target conversion action is executed.
Optionally, when the storage area is a non-free storage area; performing a back-stepping operation on the first RAID level conversion according to the occurrence time of the first type of fault and the log chain corresponding to the first RAID level conversion, including:
determining a second time matched with the occurrence time of the first type of fault from a log chain, wherein the log chain is used for recording the execution starting time, the execution finishing time and the disk format and the data storage state of the disk array when the execution of each conversion action is finished in the RAID level conversion process;
determining that a second target transition action completed by the transition action was performed before the second time;
and restoring the disk format of the disk array to the disk format of the disk array when the execution of the second target conversion action is completed, and restoring the data migrated from the execution completion time of the second target conversion action to the second time to the data storage state when the execution of the second target conversion action is completed.
Optionally, the method further comprises:
in the process of executing the first RAID level conversion, if a second type of fault is determined to occur, judging whether the frequency of the second type of fault is greater than or equal to a first preset threshold value or not;
if yes, reporting the second type of fault and giving an alarm.
Optionally, the method further comprises:
in the process of executing RAID level conversion, if the operation that a client writes data into the disk array is monitored, storing the data to be written into a designated hard disk, wherein the designated hard disk is a hard disk except for the disk array;
and after the second RAID level conversion is finished, writing the data to be written in the specified hard disk into the disk array.
Optionally, the method further comprises:
in the process of performing RAID level conversion, if the operation that a client reads data from the disk array is monitored, judging whether the specified hard disk stores data to be read or not, wherein the specified hard disk stores data of which the read times in a set period are greater than or equal to a second preset threshold;
if not, reading the data to be read from the disk array and returning the data to the client;
and if so, reading the data to be read from the specified hard disk and returning the data to the client.
In a second aspect, an embodiment of the present application provides a RAID level shift apparatus, including:
the first conversion module is used for determining a storage area with preset capacity from a disk array to be subjected to RAID level conversion and performing first RAID level conversion on the storage area;
a stopping module, configured to, in a process of executing the first RAID level conversion, stop executing the first RAID level conversion if it is determined that a first type of failure occurs;
the file returning module is used for carrying out file returning operation on the first RAID level conversion according to the occurrence time of the first type of fault and a log chain corresponding to the first RAID level conversion, and continuously executing the first RAID level conversion after the first type of fault is determined to be eliminated;
and the second conversion module is used for performing second RAID level conversion on other areas except the storage area in the disk array after the first RAID level conversion is executed.
Optionally, when the storage area is a free storage area; the gear returning module is specifically used for:
determining a first time matched with the occurrence time of the first type of fault from a log chain, wherein the log chain is used for recording the execution starting time, the execution finishing time and the disk format of the disk array when the execution of each conversion action is finished in the RAID level conversion process;
determining that a first target transition action completed by a transition action has been performed before the first time;
and restoring the disk format of the disk array to the disk format of the disk array when the first target conversion action is executed.
Optionally, when the storage area is a non-free storage area; the gear returning module is specifically used for:
determining a second time matched with the occurrence time of the first type of fault from a log chain, wherein the log chain is used for recording the execution starting time, the execution finishing time and the disk format and the data storage state of the disk array when the execution of each conversion action is finished in the RAID level conversion process;
determining that a second target transition action completed by the transition action was performed before the second time;
and restoring the disk format of the disk array to the disk format of the disk array when the execution of the second target conversion action is completed, and restoring the data migrated from the execution completion time of the second target conversion action to the second time to the data storage state when the execution of the second target conversion action is completed.
Optionally, the apparatus further comprises:
the first judging module is used for judging whether the frequency of the second type of faults is greater than or equal to a first preset threshold value or not if the second type of faults is determined to occur in the process of executing the first RAID level conversion;
and the reporting module is used for reporting the second type of fault and giving an alarm when the judgment result of the first judging module is yes.
Optionally, the apparatus further comprises:
the storage module is used for storing data to be written into a designated hard disk if the operation that a client writes data into the disk array is monitored in the process of executing RAID level conversion, wherein the designated hard disk is a hard disk except for the disk array;
and the writing module is used for writing the data to be written in the specified hard disk into the disk array after the second RAID level conversion is completed.
Optionally, the apparatus further comprises:
the second judgment module is used for judging whether the specified hard disk stores data to be read or not if the operation that the client reads the data from the disk array is monitored in the process of executing RAID level conversion, wherein the specified hard disk stores the data of which the reading times in a set period are greater than or equal to a second preset threshold value;
the first reading module is used for reading the data to be read from the disk array and returning the data to the client when the judgment result of the second judging module is negative;
and the second reading module is used for reading the data to be read from the specified hard disk and returning the data to the client when the judgment result of the second judging module is yes.
In a third aspect, embodiments provide an electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: implementing any of the RAID level translation method steps described above.
In a fourth aspect, embodiments of the present application provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: implementing any of the RAID level translation method steps described above.
In the technical scheme provided by the embodiment of the application, a storage area with preset capacity is determined from a disk array to be subjected to RAID level conversion; performing RAID level conversion on the storage area, and monitoring whether a fault occurs in the RAID level conversion process aiming at the storage area; if the failure occurs, suspending RAID level conversion aiming at the storage area, eliminating the failure, and continuing to perform RAID level conversion on the storage area; after completing the RAID level conversion aiming at the storage area, carrying out RAID level conversion on other areas except the storage area in the disk array. According to the technical scheme provided by the embodiment of the application, before RAID level conversion is carried out on the whole disk array, RAID level conversion is carried out on a part of storage areas in the disk array, the process is monitored, if a fault occurs in the RAID level conversion process of the storage areas, the fault is eliminated, RAID level conversion is continuously carried out on the storage areas until RAID level conversion on the storage areas is completed, and therefore the occurrence rate of the fault can be reduced in the process of carrying out RAID level conversion on other areas except the storage areas in the disk array, and further protection on data in the disk array is strengthened.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a RAID level conversion process according to an embodiment of the present application;
fig. 2 is a flowchart of a RAID level conversion method according to an embodiment of the present application;
FIG. 3 is a system diagram of a disk array according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of RAID level conversion according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a RAID level conversion apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to reduce the occurrence rate of a failure in the RAID level conversion process of a disk array and further enhance protection of data in the disk array, an embodiment of the present application provides a RAID level conversion method and an apparatus, where the RAID level conversion method includes:
determining a storage area with preset capacity from a disk array to be subjected to RAID level conversion, and performing first RAID level conversion on the storage area;
in the process of executing the first RAID level conversion, if the first type of fault is determined to occur, the first RAID level conversion is stopped to be executed;
performing a back-stepping operation on the first RAID level conversion according to the occurrence time of the first type of fault and a log chain corresponding to the first RAID level conversion, and continuing to execute the first RAID level conversion after determining that the first type of fault is eliminated;
and after the first RAID level conversion is executed, performing second RAID level conversion on other areas except the storage area in the disk array.
In the technical scheme provided by the embodiment of the application, a storage area with preset capacity is determined from a disk array to be subjected to RAID level conversion; performing RAID level conversion on the storage area, and monitoring whether a fault occurs in the RAID level conversion process aiming at the storage area; if the failure occurs, suspending RAID level conversion aiming at the storage area, eliminating the failure, and continuing to perform RAID level conversion on the storage area; after completing the RAID level conversion aiming at the storage area, carrying out RAID level conversion on other areas except the storage area in the disk array. According to the technical scheme provided by the embodiment of the application, before RAID level conversion is carried out on the whole disk array, RAID level conversion is carried out on a part of storage areas in the disk array, the process is monitored, if a fault occurs in the RAID level conversion process of the storage areas, the fault is eliminated, RAID level conversion is continuously carried out on the storage areas until RAID level conversion on the storage areas is completed, and therefore the occurrence rate of the fault can be reduced in the process of carrying out RAID level conversion on other areas except the storage areas in the disk array, and further protection on data in the disk array is strengthened.
First, a RAID level conversion method provided in the embodiment of the present application is described below. The RAID level conversion method provided by the embodiment of the present application may be applied to a disk array controller, where the disk array controller may manage a disk array and perform processing such as storage and forwarding of data in the disk array, and the disk array controller may further perform an operation of RAID level conversion.
As shown in fig. 2, the RAID level shift method includes the following steps.
S201, determining a storage area with preset capacity from a disk array to be subjected to RAID level conversion, and performing first RAID level conversion on the storage area.
The preset capacity can be set by self-definition. In one implementation, when there are multiple hard disks in the disk array that need to be subjected to RAID level conversion, a storage area with a preset capacity may be selected from each hard disk. For example, the disk array includes 4 hard disks that need to be subjected to RAID level conversion, which are respectively: the hard disk 1, the hard disk 2, the hard disk 3 and the hard disk 4 have a preset capacity of 512M, and then 512M storage areas can be selected from the hard disk 1, 512M storage areas from the hard disk 2, 512M storage areas from the hard disk 3 and 512M storage areas from the hard disk 4 respectively.
Wherein the determined storage area may be a free storage area, i.e. a storage area where no data is stored; but also a non-free storage area, i.e. a storage area in which data has been stored.
And when the determined storage area is a free storage area, converting the disk format of the disk array when performing the first RAID level conversion. When the determined storage area is a non-free storage area, the disk format of the disk array needs to be converted and the data stored in the storage area needs to be migrated when the first RAID level conversion is performed.
After the storage area is determined, the first RAID level conversion may be performed on the storage area, that is, the first RAID level conversion only aims at the determined storage area at this time, and the RAID level conversion is not performed on other areas except the storage area.
S202, in the process of executing the first RAID level conversion, if the first type of fault is determined to occur, the first RAID level conversion is stopped to be executed.
The faults possibly occurring in the RAID level conversion process can be divided in a user-defined mode according to the severity, faults with high severity have large influence on RAID level conversion, even RAID level conversion failure can be caused, faults with low severity have small influence on RAID level conversion, and even the faults can be ignored.
On the basis that the faults are divided according to the severity, the faults with higher severity can be taken as the first type of faults. In the process of executing the first RAID level conversion, if it is determined that a first type of failure occurs, that is, a failure that seriously affects the RAID level conversion has occurred, it is necessary to stop executing the first RAID level conversion, and remove the first type of failure.
In one embodiment, in the process of executing the first RAID level conversion, if it is determined that the second type of failure occurs, it is determined whether the number of times of occurrence of the second type of failure is greater than or equal to a first preset threshold; if yes, reporting the second type of fault and giving an alarm.
The second type of failure may be other types of failures with lower severity except the first type of failure, and the second type of failure has a smaller influence on the RAID level conversion, or even has no influence on the RAID level conversion. Therefore, after the second type failure occurs, the process of the first RAID level shift can be continuously performed even if the second type failure is not excluded.
The second type of fault may include a plurality of types of faults, and any one of the faults belonging to the second type of fault is recorded when occurring, and the recorded times are accumulated. For example, the second type of fault includes fault 1, fault 2, and fault 3, and the number of times recorded is 3 when fault 1 occurs and 2 times when fault 2 occurs, and the number of times recorded is updated to 4 when fault 3 occurs.
If the frequency of the second type of faults is judged to be larger than or equal to a first preset threshold value, the second type of faults are judged, and an alarm is given; if the number of times of occurrence of the second type of fault is judged to be smaller than the first preset threshold, no processing is required.
The first preset threshold may be set by a user. For example, the first preset threshold is 5, the second type of fault includes fault 1, fault 2 and fault 3, when the fault 1 occurs 2 times, the fault 2 occurs 2 times, and after the fault 3 occurs 1 time, it can be determined that the number of times of occurrence of the second type of fault is 5 times, and then the fault 1, the fault 2 and the fault 3 are reported and an alarm is given.
In one implementation, the failure may be classified by severity into hint, normal, severe, and fatal 4 levels, which when a failure of a fatal level occurs, results in a failure to switch RAID levels. A fatal level fault may be determined as a first type of fault and a cue level fault may be determined as a second type of fault. In the process of executing the first RAID level shift, if it is determined that the first type failure occurs, indicating that a failure of a fatal level occurs, the execution of the first RAID level shift is stopped. And if the second type of fault is determined to occur, the fault of the prompt level is indicated to occur, reporting the second type of fault and giving an alarm.
Of course, the fault 1 may also be regarded as a second type of fault, the fault 2 may also be regarded as another second type of fault, corresponding preset thresholds are respectively set for the faults 1 and 2, the occurrence times of the faults 1 and 2 are respectively recorded, when it is determined that the occurrence times of the faults 1 are greater than or equal to the corresponding preset thresholds, the alarm is reported, and when it is determined that the occurrence times of the faults 2 are greater than or equal to the corresponding preset thresholds, the alarm is reported and alarmed.
S203, according to the occurrence time of the first type of fault and the log chain corresponding to the first RAID level conversion, performing a gear returning operation on the first RAID level conversion, and after the first type of fault is determined to be eliminated, continuing to execute the first RAID level conversion.
In the embodiment of the application, in the process of performing RAID level conversion, execution information, failure information, and the like of each conversion operation in the RAID level conversion process are recorded in a log monitoring (log chain generation) manner. In the process of executing RAID level conversion, recording the execution start time and the execution finish time of each conversion action, recording information such as a fault ID, a fault priority, the frequency of occurrence of the fault, the time of occurrence of the fault and the like when the fault occurs, recording the return operation behavior in a log chain when the return operation is required when the fault occurs, and adding a mark to represent that the log record is the record of executing the return operation after the fault occurs.
Optionally, in this embodiment of the present application, the log chain may be stored in a designated hard disk other than the disk array.
In one embodiment, when the storage area is a free storage area, the log chain may be used to record information such as the execution start time, the execution completion time, and the disk format of the disk array when the execution of each conversion operation is completed in the RAID level conversion process. It can be considered that the log chain is information related to each conversion action in which the execution order of each conversion action is recorded in time series.
For example, log chain record 8: 00 starts to perform a transition action 1, 8: 10 the conversion action 1 is executed, and the disk format is format 1; and in 8: 10 starts to perform the switching action 2, 8: 20 the conversion action 2 is performed, and the disk format is format 2.
Wherein an instruction in the RAID level translation process may be considered a translation action. For example, the client sends a command to migrate data a in the disk array from location 1 to location 2, and the command may be considered a transition action.
The disk format of the disk array may be different according to the RAID level. For example, when the RAID level of the disk array is RAID1, the disk format of the disk array is a striped format; when the RAID level of the disk array is RAID5, the disk format of three disks in the disk array is a striped format, and the disk format of one disk is a check code format.
After a first type of fault occurs, a time of occurrence of the first type of fault may be determined, and a first time matching the time of occurrence of the first type of fault may be determined from the log chain. Determining from the log chain that the first target conversion action completed before the first time was performed by the conversion action.
When there is only one completed conversion action executed before the first time, the completed conversion action may be directly determined as the first target conversion action.
For example, a RAID level transition includes transition action 1, transition action 2, transition action 3, and transition action 4, where first from 20: 00 begin to perform transition action 1, and at 20: execution is completed in 10 minutes, namely the execution start time of the conversion action 1 is 20: 00, execution end time 20: 10. at 20: 10 begin to perform transition action 2 when, at 20: when 15 hours, it is determined that the first type of fault occurs, the first time determined from the log chain is 20: 15, at 20: before 15, the completed conversion action is only the rotation action 1, and the conversion action 1 is directly determined as the first target conversion action.
When there are at least two completed conversion actions executed before the first time, in one implementation, one conversion action may be arbitrarily selected from the at least two completed conversion actions to serve as the first target conversion action.
For example, a RAID level transition includes transition action 1, transition action 2, transition action 3, and transition action 4, where first from 20: 00 begin to perform transition action 1, and at 20: execution is completed in 10 minutes, namely the execution start time of the conversion action 1 is 20: 00, execution end time 20: 10. at 20: 10 starts to perform transition action 2, and at 20: execution is completed in 20 minutes, namely the execution start time of the conversion action 2 is 20: 10, the execution end time is 20: 20. at 20: 20 begin to perform transition action 3, and at 20: execution is completed in 30 minutes, namely the execution start time of the conversion action 3 is 20: 20, the execution end time is 20: 30. at 20: 30 begin to perform transition action 4 when, at 20: 35, the first type of fault is determined to have occurred, then the first time determined from the log chain is 20: 35, in the range of 20: before 35, the executed completed conversion actions include conversion action 1, conversion action 2 and conversion action 3, and one conversion action selected from conversion action 1, conversion action 2 and conversion action 3 can be determined as the first target conversion action.
In another implementation manner, a conversion action with the execution completion time closest to the first time may be selected from the at least two conversion actions that have been executed and completed as the first target conversion action.
For example, a RAID level transition includes transition action 1, transition action 2, transition action 3, and transition action 4, where first from 20: 00 begin to perform transition action 1, and at 20: execution is completed in 10 minutes, namely the execution start time of the conversion action 1 is 20: 00, execution end time 20: 10. at 20: 10 starts to perform transition action 2, and at 20: execution is completed in 20 minutes, namely the execution start time of the conversion action 2 is 20: 10, the execution end time is 20: 20. at 20: 20 begin to perform transition action 3, and at 20: execution is completed in 30 minutes, namely the execution start time of the conversion action 3 is 20: 20, the execution end time is 20: 30. at 20: 30 begin to perform transition action 4 when, at 20: 35, the first type of fault is determined to have occurred, then the first time determined from the log chain is 20: 35, in the range of 20: before 35, the completed transition actions are executed including transition action 1, transition action 2, and transition action 3, and the execution completion time of transition action 3 is closest to the first time, so transition action 3 is determined to be the first target transition action.
After the first target conversion action is determined, determining the disk format of the disk array when the first target conversion action is executed, and restoring the current disk format of the disk array to the disk format of the disk array when the first target conversion action is executed.
For example, when the first target conversion action of the log chain record is completed, the disk format of the disk array is a striped format, and when the disk format of the disk array is a check code format when the first type of fault occurs, the disk format of the disk array is recovered from the current check code format to the striped format.
In one embodiment, when the storage area is a non-free storage area, that is, the storage area stores data, the log chain may be used to record the execution start time, the execution completion time, and the disk format and the data storage state of the disk array when the execution of each conversion operation is completed in the RAID level conversion process.
The data storage state of the log chain record comprises information such as identification and size of the stored data, the location of data storage and the like.
For example, log chain record 8: 00 starts to perform a transition action 1, 8: 10 the conversion operation 1 is completed, and the disk format is format 1, and the data a in the disk array is stored in location 1. In the following step 8: 10 starts to perform the switching action 2, 8: 20 the converting operation 2 is completed, the format of the disk is format 2, and the data a in the disk array is stored in location 2.
When different conversion actions are performed, the data storage states in the disk array may be different, that is, the storage locations of the data in the disk array may change. For example, data 1 in the disk array is stored at location 1 when the execution of the convert operation 1 is completed, and data 1 in the disk array is stored at location 2 when the execution of the convert operation 2 is completed (data 1 is migrated from location 1 to location 2).
After the occurrence of the first type of fault, a time of occurrence of the first type of fault may be determined, and a second time matching the time of occurrence of the first type of fault may be determined from the log chain. Determining from the log chain that the second target conversion action completed before the second time was performed by the conversion action.
When there is only one completed conversion action executed before the second time, the completed conversion action may be directly determined as the second target conversion action.
When there are at least two completed conversion actions executed before the second time, in one implementation, one conversion action may be arbitrarily selected from the at least two completed conversion actions to be the second target conversion action. In another implementation manner, a conversion action with the execution completion time closest to the second time may be selected from the at least two conversion actions that have been executed and completed as the second target conversion action.
After the second target conversion action is determined, determining the disk format of the disk array when the second target conversion action is executed, and restoring the current disk format of the disk array to the disk format of the disk array when the second target conversion action is executed. And restoring the data migrated during the execution completion time of the second target transition action to the second time to the data storage state at the execution completion time of the second target transition action.
For example, the execution completion time of the second target conversion action recorded by the log chain is 8: and 20, the second time when the first type of fault occurs is 8: 25, then at 8: 20 to 8: during the time period of 25, data A in the disk array migrates from location 1 to location 2 and data B migrates from location 3 to location 4. That is, at 8: at 25, data A is at position 2 and data B is at position 4. When the operation of the gear-returning is carried out, the data A is restored to the position 1 for storage, and the data B is restored to the position 3 for storage.
The log chain is set to record the RAID level conversion process, RAID level conversion can be carried out again through file returning, interruption of RAID level conversion due to faults is avoided, and then a protection effect is achieved on data. And the user can check the content recorded by the log chain, so that the RAID level conversion process can be known.
And S204, after the first RAID level conversion is executed, performing second RAID level conversion on other areas except the storage area in the disk array.
Certainly, in the process of executing the second RAID level conversion, the above-described first RAID level conversion is still performed by using a manner of executing the first RAID level conversion, that is, the log chain is used to record execution information of each conversion action in the process of executing the second RAID level conversion, when it is determined that the first type of fault occurs, the second RAID level conversion is stopped from being executed, the second RAID level conversion is subjected to the shift-back operation according to the occurrence time of the first type of fault and the log chain corresponding to the second RAID level conversion, and after it is determined that the first type of fault is eliminated, the second RAID level conversion is continuously executed. After the second RAID level translation is completed, RAID level translation is completed for the entire disk array.
In one embodiment, the number of hard disks required for different RAID levels is different. For example, as in fig. 1, RAID01 has a number of disks of 4, while RAID5 requires a number of disks of 3 or greater than 3. Therefore, if the number of hard disks before RAID level conversion of the disk array does not satisfy the requirement required by the RAID level after conversion, it is necessary to access a new hard disk to the disk array before RAID level conversion is performed.
Specifically, when it is detected that a hard disk is accessed to the disk array, it is necessary to determine whether the state parameter of the hard disk meets a preset RAID level conversion condition. The hard disk accessed to the disk array is used for RAID level conversion, and comprises first RAID level conversion and second RAID level conversion.
The RAID level transition condition may include at least one of a capacity of a hard disk, a state of the hard disk, and the like, and the capacity of the hard disk set in the RAID level transition condition may be set by user according to the RAID level transition. For example, if the capacity of the hard disk set in the RAID level transition condition is 1G, it indicates that there is at least 1G of available storage space of the newly accessed hard disk for performing the RAID level transition.
The hard disk state includes an available state, a failure state, an impending reimbursement state, and the like, and generally, the hard disk state is an available state in the RAID level transition condition.
When there are a plurality of RAID level conversion conditions, if the state parameter of the hard disk accessed to the disk array does not satisfy at least one of the RAID level conversion conditions, it may be considered that the hard disk does not satisfy the RAID level conversion conditions.
When the RAID level conversion condition is judged not to be satisfied, the unsatisfied state parameters can be reported, so that a user can replace the hard disk satisfying the RAID level conversion condition in time according to the reported state parameters. When the RAID level conversion condition is judged to be satisfied, the hard disk may be determined as a hard disk of the disk array. The hard disk is used in subsequent processes of the first RAID level conversion and the second RAID level conversion.
In one embodiment, in the process of performing RAID level conversion, if an operation of writing data into a disk array by a client is monitored, the data to be written is stored in a designated hard disk (e.g., SSD). The designated hard disk may be the above hard disk for storing the log chain, or may be another hard disk, and in this embodiment, the specific hard disk is not specifically limited herein.
And monitoring the operation of writing data into the disk array by the client if the client is monitored in the process of executing the first RAID level conversion and/or the second RAID level conversion. The data written into the disk array by the client is data outside the disk array.
For example, when a user needs to modify data in the disk array, the user writes the modified new data into the disk array through the client to complete modification of corresponding data in the disk array.
For example, when the client needs to write data into the disk array, a write request is first sent to the disk array controller. When the disk array controller receives a write request, the operation that the client writes data into the disk array is monitored.
The designated hard disk is a hard disk other than the hard disk in the disk array, that is, neither the first RAID level conversion nor the second RAID level conversion involves the designated hard disk.
The designated hard disk is a hard disk connected to the disk array that does not participate in RAID level translation. The attributes of the type, capacity and the like of the specified hard disk can be customized. The type of the Hard Disk may be SSD (Solid State Drives), HDD (Hard Disk Drive), SSHD (Solid State hybrid Drive), etc., and the capacity of the Hard Disk may be 64M, 128M, 512M, etc., which is not limited herein.
After the second RAID level translation is completed, the RAID level translation for the entire disk array is completed. And writing the data to be written in the specified hard disk into the disk array.
In an implementation manner, the disk array may include a plurality of hard disks, and after the RAID level conversion is completed, the data to be written in the designated hard disk may be written in the corresponding hard disk in the disk array.
For example, data to be written in the designated hard disk is data a, and data B, data C, and data D that need to be written in the disk array are stored in addition to data a, so that after the whole RAID level conversion is performed, data a, data B, data C, and data D stored in the designated hard disk are written in the disk array, for example, if the disk array includes 4 hard disks, the respective data are: the data processing system comprises a hard disk 1, a hard disk 2, a hard disk 3 and a hard disk 4, wherein data A needs to be written into the hard disk 1, data B needs to be written into the hard disk 2, data C needs to be written into the hard disk 3, and data D needs to be written into the hard disk 4, after RAID level conversion of a disk array is completed, the data A is written into the hard disk 1, the data B is written into the hard disk 2, the data C is written into the hard disk 3, and the data D is written into the hard disk.
According to the technical scheme provided by the embodiment of the application, in the processes of the first RAID level conversion and the second RAID level conversion, the operation that the client writes data into the disk array can be monitored, once the operation is monitored, the data to be written is firstly stored in the appointed hard disk, and after the second RAID level conversion is completed, the data to be written in the appointed hard disk is written into the disk array. Therefore, the writing operation does not influence the RAID level conversion, normal writing operation of data except the disk array is realized in the RAID level conversion process, and the user experience is improved.
In one embodiment, in the process of performing RAID level conversion, if an operation that a client reads a certain data from a disk array is monitored, it is determined whether the certain data exists in the data stored in a designated hard disk. If the data exists, the certain data can be directly read from the specified hard disk, and if the data does not exist, the certain data needs to be read from the disk array.
The data to be read is data stored in the disk array, and the operation of reading the data from the disk array by the monitored client is that the client reads the data in the disk array out of the disk array.
The method for monitoring the operation of the client reading data from the disk array includes various methods, for example, when the client reads data to be read from the disk array, a read request is first sent to the disk array controller. When the disk array controller receives a read request, the operation that the client reads data from the disk array is monitored.
The designated hard disk stores data, the number of times of reading of which is greater than or equal to a second preset threshold value in a set period. The setting period may be set by a user, for example, the setting period may be an entire process including the first RAID level shift and the second RAID level shift.
The second preset threshold may be set by a user. For example, if the preset threshold is 3, it indicates that the data to be read is stored in the designated hard disk when the number of times of reading the data to be read is greater than or equal to 3. That is, when the data to be read is read for the first time and read for the second time, the data to be read is not stored in the designated hard disk.
In one manner of obtaining data stored in a designated hard disk, after a client reads data to be read from a disk array, the number of times the data to be read is read may be determined from a read record. The reading record is used for recording the times of reading each data in the disk array out of the disk array. That is, each time the client reads the data in the disk array out of the disk array, the data is recorded in the read record, and the read record can record the time of each read and the data information such as the storage path and the size of the read data.
After the number of times of reading of the data to be read is determined, judging whether the determined number of times of reading is greater than or equal to a second preset threshold value; if yes, storing the data to be read in a designated hard disk, and if not, not processing the data to be read.
If the specified hard disk is judged not to be stored with the data to be read, the data to be read is read from the disk array and returned to the client; and if the data to be read is judged to be stored in the appointed hard disk, reading the data to be read from the appointed hard disk and returning the data to the client.
In the case where the data to be read is stored in the specified hard disk, the data to be read can be read from the specified hard disk. Thus, when the client reads data from the disk array, the RAID level conversion is not influenced. Moreover, RAID level conversion does not influence the operation of reading data from the disk array by the client, and the reading speed of the client is accelerated.
In the technical scheme provided by the embodiment of the application, a storage area with preset capacity is determined from a disk array to be subjected to RAID level conversion; performing RAID level conversion on the storage area, and monitoring whether a fault occurs in the RAID level conversion process aiming at the storage area; if the failure occurs, suspending RAID level conversion aiming at the storage area, eliminating the failure, and continuing to perform RAID level conversion on the storage area; after completing the RAID level conversion aiming at the storage area, carrying out RAID level conversion on other areas except the storage area in the disk array. According to the technical scheme provided by the embodiment of the application, before RAID level conversion is carried out on the whole disk array, RAID level conversion is carried out on a part of storage areas in the disk array, the process is monitored, if a fault occurs in the RAID level conversion process of the storage areas, the fault is eliminated, RAID level conversion is continuously carried out on the storage areas until RAID level conversion on the storage areas is completed, and therefore the occurrence rate of the fault can be reduced in the process of carrying out RAID level conversion on other areas except the storage areas in the disk array, and further protection on data in the disk array is strengthened.
The embodiment of the present application further provides a system structure schematic diagram of a disk array, as shown in fig. 3, the hard disks storing data in the disk array include an HDD1 and an HDD2, and a new hard disk is accessed in the disk array, that is, a newly accessed HDD. The HDD1, HDD2, and newly accessed HDD are all used to perform RAID level transfers.
The storage area partitioned from HDD1 is area 1, and the storage areas other than area 1 are areas 4. The storage area partitioned from HDD2 is area 2, and the storage areas other than area 2 are area 5. The storage area partitioned from the newly accessed HDD1 is area 3, and the storage areas other than area 3 are area 6. The first RAID level conversion is performed for area 1, area 2, and area 3. After the first RAID level translation is completed, a second RAID level translation is performed on zone 4, zone 5, and zone 6.
In addition, the disk array is connected with an SSD, wherein a storage area partitioned in the SSD is an area a, the area a is used for storing a log chain, and the other storage areas except the area a are used for storing data to be written into the disk array and data to be read meeting a preset condition in the process of performing RAID level conversion. In other words, in the process of performing RAID level conversion, if it is determined that there is data that needs to be written into the disk array, the data is stored in the SSD, and after it is determined that RAID level conversion is completed, the data is written into the disk array, if it is determined that data needs to be read from the disk array, if the data meets a preset condition (i.e., the number of times of reading in a set period is greater than or equal to a set threshold), the data may be stored in the SSD, and when there is an operation to read the data next time, the data may be directly read from the SSD.
The embodiment of the present application further provides a flow diagram for performing RAID level conversion on a disk array, where a new hard disk for RAID level conversion is accessed to the disk array before RAID level conversion is performed on the disk array, and an SSD for storing data to be written and data to be read is inserted. The log chain is also stored in the SSD.
As shown in fig. 4, the relevant parameters for RAID level conversion are set first. Specifically, a storage area for performing the first RAID level conversion is set, one storage area is divided from the SSD for storing a log chain, and the time of the log chain is synchronized with the system time to prevent the conversion action time from being inconsistent with the system time.
Then, a pretreatment is performed. Specifically, whether the available storage space, the state, the number and the like of each hard disk and a newly accessed hard disk in the disk array meet the conditions of RAID level conversion is detected, if so, the subsequent process can be continued, and if not, the parameters which do not meet the conditions are reported.
And thirdly, under the condition of smooth preprocessing, performing first RAID level conversion on the set storage area, and monitoring whether a fault occurs in the first RAID level conversion process. Specifically, the disk format of the storage area is converted, and the stored data is migrated in the case where the storage area stores data. If a first type of fault occurs in the first RAID level conversion, stopping executing the first RAID level conversion, reporting the first type of fault to a log chain, performing a back-up operation on the first RAID level conversion according to the occurrence time of the first type of fault and the log chain corresponding to the first RAID level conversion, and after the first type of fault is determined to be eliminated, continuing executing the first RAID level conversion until the first RAID level conversion is completed and then continuing to execute subsequent operations.
And after the first RAID level conversion is finished, performing second RAID level conversion on other areas except the storage area in the disk array. Monitoring whether a fault occurs in the process of second RAID level conversion, stopping executing the second RAID level conversion when a first type of fault is determined to occur, reporting the first type of fault to a log chain, performing a back-stepping operation on the second RAID level conversion according to the occurrence time of the first type of fault and the log chain corresponding to the second RAID level conversion, and continuing executing the second RAID level conversion after the first type of fault is determined to be eliminated. And completing the RAID level conversion of the disk array until the second RAID level conversion is completed.
Corresponding to the foregoing RAID level conversion method embodiment, an embodiment of the present application further provides a RAID level conversion apparatus, as shown in fig. 5, where the RAID level conversion apparatus includes:
a first conversion module 510, configured to determine a storage area with a preset capacity from a disk array to be subjected to RAID level conversion, and perform first RAID level conversion on the storage area;
a stopping module 520, configured to, in a process of performing the first RAID level conversion, stop performing the first RAID level conversion if it is determined that the first type of failure occurs;
a rollback module 530, configured to perform a rollback operation on the first RAID level conversion according to the occurrence time of the first type of fault and the log chain corresponding to the first RAID level conversion, and continue to perform the first RAID level conversion after it is determined that the first type of fault is eliminated;
the second converting module 540 is configured to perform second RAID level conversion on other areas except the storage area in the disk array after the first RAID level conversion is performed.
In one embodiment, when the storage area is a free storage area; the shift-back module 530 is specifically configured to:
determining first time matched with the occurrence time of the first type of fault from a log chain, wherein the log chain is used for recording the execution starting time, the execution finishing time and the disk format of a disk array when the execution of each conversion action is finished in the RAID level conversion process;
determining that the conversion action has performed a completed first target conversion action prior to the first time;
and restoring the disk format of the disk array to the disk format of the disk array when the first target conversion action is executed.
In one embodiment, when the storage area is a non-free storage area; the shift-back module 530 is specifically configured to:
determining second time matched with the occurrence time of the first type of fault from a log chain, wherein the log chain is used for recording the execution starting time, the execution finishing time and the disk format and the data storage state of the disk array when the execution of each conversion action is finished in the RAID level conversion process;
determining that the transition action has performed a completed second target transition action prior to the second time;
and restoring the disk format of the disk array to the disk format of the disk array when the execution of the second target conversion action is completed, and restoring the data migrated from the execution completion time of the second target conversion action to the second time to the data storage state when the execution of the second target conversion action is completed.
In one embodiment, the apparatus may further comprise:
the first judging module is used for judging whether the frequency of the second type of faults is greater than or equal to a first preset threshold value or not if the second type of faults is determined to occur in the process of executing the first RAID level conversion;
and the reporting module is used for reporting the second type of fault and giving an alarm when the judgment result of the first judging module is positive.
In one embodiment, the apparatus may further comprise:
the storage module is used for storing data to be written into a designated hard disk if the operation that the client writes the data into the disk array is monitored in the process of executing RAID level conversion, wherein the designated hard disk is a hard disk except for the disk array;
and the writing module is used for writing the data to be written in the specified hard disk into the disk array after the second RAID level conversion is completed.
In one embodiment, the apparatus may further comprise:
the second judgment module is used for judging whether the specified hard disk stores data to be read or not if the operation that the client reads the data from the disk array is monitored in the process of executing RAID level conversion, wherein the specified hard disk stores the data of which the read times are greater than or equal to a second preset threshold value in a set period;
the first reading module is used for reading data to be read from the disk array and returning the data to the client when the judgment result of the second judging module is negative;
and the second reading module is used for reading the data to be read from the specified hard disk and returning the data to the client when the judgment result of the second judging module is yes.
In the technical scheme provided by the embodiment of the application, a storage area with preset capacity is determined from a disk array to be subjected to RAID level conversion; performing RAID level conversion on the storage area, and monitoring whether a fault occurs in the RAID level conversion process aiming at the storage area; if the failure occurs, suspending RAID level conversion aiming at the storage area, eliminating the failure, and continuing to perform RAID level conversion on the storage area; after completing the RAID level conversion aiming at the storage area, carrying out RAID level conversion on other areas except the storage area in the disk array. According to the technical scheme provided by the embodiment of the application, before RAID level conversion is carried out on the whole disk array, RAID level conversion is carried out on a part of storage areas in the disk array, the process is monitored, if a fault occurs in the RAID level conversion process of the storage areas, the fault is eliminated, RAID level conversion is continuously carried out on the storage areas until RAID level conversion on the storage areas is completed, and therefore the occurrence rate of the fault can be reduced in the process of carrying out RAID level conversion on other areas except the storage areas in the disk array, and further protection on data in the disk array is strengthened.
An electronic device is also provided in the embodiments of the present application, as shown in fig. 6, and includes a processor 610 and a machine-readable storage medium 620, where the machine-readable storage medium 620 stores machine-executable instructions that can be executed by the processor 610.
In addition, as shown in fig. 6, the electronic device may further include: a communication interface 630 and a communication bus 640; the processor 610, the machine-readable storage medium 620, and the communication interface 630 are configured to communicate with each other via the communication bus 640, and the communication interface 630 is configured to communicate with other devices.
The processor 610 is configured to perform any of the embodiments of the RAID level translation methods described above, wherein the RAID level translation methods comprise:
determining a storage area with preset capacity from a disk array to be subjected to RAID level conversion, and performing first RAID level conversion on the storage area;
in the process of executing the first RAID level conversion, if a first type of fault is determined to occur, stopping executing the first RAID level conversion;
performing a back-stepping operation on the first RAID level conversion according to the occurrence time of the first type of fault and a log chain corresponding to the first RAID level conversion, and continuing to execute the first RAID level conversion after the first type of fault is determined to be eliminated;
and after the first RAID level conversion is executed, performing second RAID level conversion on other areas except the storage area in the disk array.
According to the technical scheme provided by the embodiment of the application, before RAID level conversion is carried out on the whole disk array, RAID level conversion is carried out on a part of storage areas in the disk array, the process is monitored, if a fault occurs in the RAID level conversion process of the storage areas, the fault is eliminated, RAID level conversion is continuously carried out on the storage areas until RAID level conversion on the storage areas is completed, and therefore the occurrence rate of the fault can be reduced in the process of carrying out RAID level conversion on other areas except the storage areas in the disk array, and further protection on data in the disk array is strengthened.
The communication bus 640 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus 640 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 6, but this is not intended to represent only one bus or type of bus.
The machine-readable storage medium 620 may include a RAM (Random Access Memory) and may also include a NVM (Non-Volatile Memory), such as at least one disk Memory. Additionally, the machine-readable storage medium 620 may also be at least one memory device located remotely from the aforementioned processor.
The Processor 610 may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also DSPs (Digital Signal Processing), ASICs (Application Specific Integrated circuits), FPGAs (Field Programmable Gate arrays) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Corresponding to the embodiment of the RAID level translation method, the present application further provides a machine-readable storage medium storing machine-executable instructions, which when called and executed by a processor, cause the processor to implement the RAID level translation method.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the RAID level conversion apparatus, the electronic device, and the machine-readable storage medium, since they are substantially similar to the RAID level conversion method embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (14)

1. A RAID level conversion method is characterized in that the method comprises the following steps:
determining a storage area with preset capacity from a disk array to be subjected to RAID level conversion, and performing first RAID level conversion on the storage area;
in the process of executing the first RAID level conversion, if a first type of fault is determined to occur, stopping executing the first RAID level conversion; the first type fault represents a fault which affects RAID level conversion and needs to stop executing the first RAID level conversion and eliminate the first type fault;
performing a back-stepping operation on the first RAID level conversion according to the occurrence time of the first type of fault and a log chain corresponding to the first RAID level conversion, and continuing to execute the first RAID level conversion after the first type of fault is determined to be eliminated;
and after the first RAID level conversion is executed, performing second RAID level conversion on other areas except the storage area in the disk array.
2. The method of claim 1, wherein when the storage area is a free storage area; performing a back-stepping operation on the first RAID level conversion according to the occurrence time of the first type of fault and the log chain corresponding to the first RAID level conversion, including:
determining a first time matched with the occurrence time of the first type of fault from a log chain, wherein the log chain is used for recording the execution starting time, the execution finishing time and the disk format of the disk array when the execution of each conversion action is finished in the RAID level conversion process;
determining that a first target transition action completed by a transition action has been performed before the first time;
and restoring the disk format of the disk array to the disk format of the disk array when the first target conversion action is executed.
3. The method of claim 1, wherein when the storage area is a non-free storage area; performing a back-stepping operation on the first RAID level conversion according to the occurrence time of the first type of fault and the log chain corresponding to the first RAID level conversion, including:
determining a second time matched with the occurrence time of the first type of fault from a log chain, wherein the log chain is used for recording the execution starting time, the execution finishing time and the disk format and the data storage state of the disk array when the execution of each conversion action is finished in the RAID level conversion process;
determining that a second target transition action completed by the transition action was performed before the second time;
and restoring the disk format of the disk array to the disk format of the disk array when the execution of the second target conversion action is completed, and restoring the data migrated from the execution completion time of the second target conversion action to the second time to the data storage state when the execution of the second target conversion action is completed.
4. The method of claim 1, further comprising:
in the process of executing the first RAID level conversion, if a second type of fault is determined to occur, judging whether the frequency of the second type of fault is greater than or equal to a first preset threshold value or not; the second type of failure is a failure that enables the first RAID level shift to continue to be executed even if the second type of failure is not excluded;
if yes, reporting the second type of fault and giving an alarm.
5. The method of claim 1, further comprising:
in the process of executing RAID level conversion, if the operation that a client writes data into the disk array is monitored, storing the data to be written into a designated hard disk, wherein the designated hard disk is a hard disk except for the disk array;
and after the second RAID level conversion is finished, writing the data to be written in the specified hard disk into the disk array.
6. The method of claim 1, further comprising:
in the process of performing RAID level conversion, if the operation that a client reads data from the disk array is monitored, judging whether a specified hard disk stores the data to be read, wherein the specified hard disk stores the data of which the read times in a set period are greater than or equal to a second preset threshold; the specified hard disk is a hard disk except the disk array;
if not, reading the data to be read from the disk array and returning the data to the client;
and if so, reading the data to be read from the specified hard disk and returning the data to the client.
7. A RAID level translation apparatus, the apparatus comprising:
the first conversion module is used for determining a storage area with preset capacity from a disk array to be subjected to RAID level conversion and performing first RAID level conversion on the storage area;
a stopping module, configured to, in a process of executing the first RAID level conversion, stop executing the first RAID level conversion if it is determined that a first type of failure occurs; the first type fault represents a fault which affects RAID level conversion and needs to stop executing the first RAID level conversion and eliminate the first type fault;
the file returning module is used for carrying out file returning operation on the first RAID level conversion according to the occurrence time of the first type of fault and a log chain corresponding to the first RAID level conversion, and continuously executing the first RAID level conversion after the first type of fault is determined to be eliminated;
and the second conversion module is used for performing second RAID level conversion on other areas except the storage area in the disk array after the first RAID level conversion is executed.
8. The apparatus of claim 7, wherein when the storage area is a free storage area; the gear returning module is specifically used for:
determining a first time matched with the occurrence time of the first type of fault from a log chain, wherein the log chain is used for recording the execution starting time, the execution finishing time and the disk format of the disk array when the execution of each conversion action is finished in the RAID level conversion process;
determining that a first target transition action completed by a transition action has been performed before the first time;
and restoring the disk format of the disk array to the disk format of the disk array when the first target conversion action is executed.
9. The apparatus of claim 7, wherein when the storage area is a non-free storage area; the gear returning module is specifically used for:
determining a second time matched with the occurrence time of the first type of fault from a log chain, wherein the log chain is used for recording the execution starting time, the execution finishing time and the disk format and the data storage state of the disk array when the execution of each conversion action is finished in the RAID level conversion process;
determining that a second target transition action completed by the transition action was performed before the second time;
and restoring the disk format of the disk array to the disk format of the disk array when the execution of the second target conversion action is completed, and restoring the data migrated from the execution completion time of the second target conversion action to the second time to the data storage state when the execution of the second target conversion action is completed.
10. The apparatus of claim 7, further comprising:
the first judging module is used for judging whether the frequency of the second type of faults is greater than or equal to a first preset threshold value or not if the second type of faults is determined to occur in the process of executing the first RAID level conversion; the second type of failure is a failure that enables the first RAID level shift to continue to be executed even if the second type of failure is not excluded;
and the reporting module is used for reporting the second type of fault and giving an alarm when the judgment result of the first judging module is yes.
11. The apparatus of claim 7, further comprising:
the storage module is used for storing data to be written into a designated hard disk if the operation that a client writes data into the disk array is monitored in the process of executing RAID level conversion, wherein the designated hard disk is a hard disk except for the disk array;
and the writing module is used for writing the data to be written in the specified hard disk into the disk array after the second RAID level conversion is completed.
12. The apparatus of claim 7, further comprising:
the second judgment module is used for judging whether data to be read is stored in a designated hard disk if the operation that the client reads the data from the disk array is monitored in the process of executing RAID level conversion, wherein the designated hard disk stores the data of which the read times are greater than or equal to a second preset threshold value in a set period; the specified hard disk is a hard disk except the disk array;
the first reading module is used for reading the data to be read from the disk array and returning the data to the client when the judgment result of the second judging module is negative;
and the second reading module is used for reading the data to be read from the specified hard disk and returning the data to the client when the judgment result of the second judging module is yes.
13. An electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: carrying out the method steps of any one of claims 1 to 6.
14. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: carrying out the method steps of any one of claims 1 to 6.
CN201811405206.7A 2018-11-23 2018-11-23 RAID level conversion method and device Active CN109542687B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811405206.7A CN109542687B (en) 2018-11-23 2018-11-23 RAID level conversion method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811405206.7A CN109542687B (en) 2018-11-23 2018-11-23 RAID level conversion method and device

Publications (2)

Publication Number Publication Date
CN109542687A CN109542687A (en) 2019-03-29
CN109542687B true CN109542687B (en) 2020-12-25

Family

ID=65849388

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811405206.7A Active CN109542687B (en) 2018-11-23 2018-11-23 RAID level conversion method and device

Country Status (1)

Country Link
CN (1) CN109542687B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112084061A (en) * 2019-06-15 2020-12-15 国际商业机器公司 Reducing data loss events in RAID arrays of the same RAID level

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7213166B2 (en) * 2001-04-11 2007-05-01 Broadcom Corporation In-place data transformation for fault-tolerant disk storage systems
CN101369217A (en) * 2008-08-30 2009-02-18 成都市华为赛门铁克科技有限公司 RAID level transforming method and apparatus
CN101482800A (en) * 2008-01-10 2009-07-15 芯发威达电子(上海)有限公司 Rank conversion method and system for redundant array of independent disks
CN101556802A (en) * 2009-05-25 2009-10-14 杭州华三通信技术有限公司 RAID array transposing method and device thereof
US8392654B2 (en) * 2009-04-17 2013-03-05 Lsi Corporation Raid level migration for spanned arrays
CN104238952A (en) * 2013-06-06 2014-12-24 鸿富锦精密工业(武汉)有限公司 Magnetic disk partition format switching method and system
CN106371950A (en) * 2015-07-20 2017-02-01 中兴通讯股份有限公司 Method and device for achieving RAID level conversion
CN107209547A (en) * 2015-02-13 2017-09-26 国际商业机器公司 Disk in RAID array retains and trouble-saving
CN107479836A (en) * 2017-08-29 2017-12-15 郑州云海信息技术有限公司 Disk failure monitoring method, device and storage system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7213166B2 (en) * 2001-04-11 2007-05-01 Broadcom Corporation In-place data transformation for fault-tolerant disk storage systems
CN101482800A (en) * 2008-01-10 2009-07-15 芯发威达电子(上海)有限公司 Rank conversion method and system for redundant array of independent disks
CN101369217A (en) * 2008-08-30 2009-02-18 成都市华为赛门铁克科技有限公司 RAID level transforming method and apparatus
US8392654B2 (en) * 2009-04-17 2013-03-05 Lsi Corporation Raid level migration for spanned arrays
CN101556802A (en) * 2009-05-25 2009-10-14 杭州华三通信技术有限公司 RAID array transposing method and device thereof
CN104238952A (en) * 2013-06-06 2014-12-24 鸿富锦精密工业(武汉)有限公司 Magnetic disk partition format switching method and system
CN107209547A (en) * 2015-02-13 2017-09-26 国际商业机器公司 Disk in RAID array retains and trouble-saving
CN106371950A (en) * 2015-07-20 2017-02-01 中兴通讯股份有限公司 Method and device for achieving RAID level conversion
CN107479836A (en) * 2017-08-29 2017-12-15 郑州云海信息技术有限公司 Disk failure monitoring method, device and storage system

Also Published As

Publication number Publication date
CN109542687A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
US10459815B2 (en) Method and system for predicting storage device failures
US10013325B1 (en) Providing resiliency to a raid group of storage devices
US8332354B1 (en) Asynchronous replication by tracking recovery point objective
US8417989B2 (en) Method and system for extra redundancy in a raid system
US8930750B2 (en) Systems and methods for preventing data loss
JP2005322399A (en) Maintenance method of track data integrity in magnetic disk storage device
JPH07500203A (en) Data backup system for rollback
CN111858240B (en) Monitoring method, system, equipment and medium of distributed storage system
TW201003662A (en) Memory malfunction prediction system and method
CN109710456B (en) Data recovery method and device
US10176065B2 (en) Intelligent failure prediction and redundancy management in a data storage system
CN104583930A (en) Method of data migration, controller and data migration apparatus
US10606490B2 (en) Storage control device and storage control method for detecting storage device in potential fault state
WO2017097233A1 (en) Fault tolerance method for data storage load and iptv system
CN104461791A (en) Information processing method and device
CN103530206A (en) Data recovery method and device
US20060215456A1 (en) Disk array data protective system and method
CN109542687B (en) RAID level conversion method and device
CN110348245B (en) Data integrity protection method, system and device based on NVM and storage medium
JP2001142650A (en) Method and device for controlling array disk
US20220374310A1 (en) Write request completion notification in response to partial hardening of write data
WO2019054434A1 (en) Failure sign detection device, failure sign detection method, and recording medium in which failure sign detection program is stored
US10599343B2 (en) Proactively resilvering a striped disk array in advance of a predicted disk drive failure
JP5273185B2 (en) Recording medium control system, recording medium control method, and recording medium control program
CN113868000B (en) Link fault repairing method, system and related components

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant