WO2024037122A1 - 一种针对磁盘固件升级过程中的读写数据方法及计算设备 - Google Patents

一种针对磁盘固件升级过程中的读写数据方法及计算设备 Download PDF

Info

Publication number
WO2024037122A1
WO2024037122A1 PCT/CN2023/097834 CN2023097834W WO2024037122A1 WO 2024037122 A1 WO2024037122 A1 WO 2024037122A1 CN 2023097834 W CN2023097834 W CN 2023097834W WO 2024037122 A1 WO2024037122 A1 WO 2024037122A1
Authority
WO
WIPO (PCT)
Prior art keywords
disk
data
target
target data
disks
Prior art date
Application number
PCT/CN2023/097834
Other languages
English (en)
French (fr)
Inventor
张�杰
Original Assignee
超聚变数字技术有限公司
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 超聚变数字技术有限公司 filed Critical 超聚变数字技术有限公司
Publication of WO2024037122A1 publication Critical patent/WO2024037122A1/zh

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Definitions

  • the present application relates to the field of storage technology, and in particular to a method and computing device for reading and writing data during a disk firmware upgrade process.
  • the disk firmware upgrade process includes two steps: download and activation.
  • the disk execution of the firmware download process will not affect the disk's response to read and write commands, but the disk needs to be reset during the active process, resulting in the disk not being able to respond to reads and writes during the active process. Order.
  • Embodiments of the present application provide a method and computing device for reading and writing data during the disk firmware upgrade process, which enables continuous response to the read and write commands of the upper layer business during the target disk firmware upgrade activation process, and avoids the impact of the disk firmware upgrade on the upper layer. business impact and improve user experience.
  • embodiments of the present application provide a method for reading data during a disk firmware upgrade process, which is applied to a RAID controller of a redundant array of independent disks (RAID).
  • the RAID has a redundant function.
  • RAID includes RAID1, RAID5, RAID6, RAID10, RAID50 and RAID60 and other RAIDs with redundant functions;
  • RAID also includes several RAID groups, and each RAID group includes multiple disks.
  • This application provides a disk firmware upgrade process
  • the data reading method in includes: receiving a read data instruction, which is used to instruct reading of target data; determining that the target disk corresponding to the target data is in the firmware upgrade activation state, and the target disk is any one of multiple disks; through downgraded read
  • the first data is read in a method, and the first data is data that is stored in a disk that has a redundant relationship with the target disk among the plurality of disks and has a redundant relationship with the target data; based on the first data, the target data is determined.
  • An embodiment of the present application provides a method for reading data during a disk firmware upgrade process.
  • the target data is read through downgraded reading, that is, by reading from multiple disks that have a redundant relationship with the target disk.
  • the target data has a redundant relationship, and then the target data is determined based on the data that has a redundant relationship with the target data. This enables the disk firmware to continue to respond to the read data instructions of the upper layer business during the upgrade process, avoiding the impact of the disk firmware upgrade on the upper layer. business impact and improve user experience.
  • the plurality of disks include a first disk and a second disk, and the data stored on the first disk and the data stored on the second disk are in a mirroring relationship, where the first disk is the target disk; in other words, the RAID is a mirror.
  • Redundant machine System-controlled RAID such as RAID1 and RAID10, for example, RAID is RAID1, downgraded reading of the first data is to read the mirror data of the target data from the second disk, and the read data is the target data. Realize the degraded read of the RAID of the mirror redundancy mechanism and respond to the host's read data instructions, so that the RAID group continues to respond to the read data instructions between hosts during the target disk upgrade and activation process.
  • the plurality of disks include at least a third disk, a fourth disk, and a fifth disk, wherein the third disk is a target disk; that is, the RAID is a RAID with a redundancy check mechanism. , such as RAID5, RAID6, RAID50 and RAID60, etc., for example, the RAID is RAID5, and the implementation of reading the first data through degraded reading is: reading the data that has a verification relationship with the target data from the fourth disk, Read the verification data corresponding to the target data from the fifth disk. Realize the downgraded read of RAID that checks the redundancy mechanism, and responds to the host's read data instructions, so that the RAID group continues to respond to the read data instructions between hosts during the target disk upgrade and activation process.
  • the RAID is a RAID with a redundancy check mechanism.
  • determining the target data based on the first data includes: determining the target data based on data having a verification relationship with the target data and the verification data.
  • the target data (D12) is obtained through the data (D11) that has a verification relationship with the target data and the verification data (P1) corresponding to the target data, and the target data is returned to the host, realizing the target data Read.
  • embodiments of the present application provide a method for writing data during a disk firmware upgrade process, which is applied to a RAID controller.
  • RAID is a RAID with redundant functions.
  • RAID can be RAID1, RAID5, RAID6, or RAID10. , RAID50 and RAID60, etc.; RAID also includes several RAID groups, and each RAID group includes multiple disks.
  • the method provided by this application for writing data during the disk firmware upgrade process includes: receiving a write data instruction, and the write data instruction is used to Instructs to write the target data; confirm that the target disk corresponding to the target data is in the firmware upgrade activation state, and the target disk is any one of multiple disks; write to the disk that has a redundant relationship with the target disk among the multiple disks through downgrade writing Write the first data, which has a redundant relationship with the target data; write a write log to the memory corresponding to the RAID controller, and the write log is used to reconstruct the target data; when the target disk firmware upgrade and activation is completed, Reconstruct the target data to the target disk based on the write log.
  • the embodiment of the present application provides a method for writing data during the disk firmware upgrade process.
  • the method responds to the host's write data instruction by downgrading the write method without blocking the IO between the RAID group and the host. , continuously responds to the host's data writing instructions, and at the same time, after the target disk upgrade is completed, the write log is used to reconstruct the target data to the target disk to achieve rapid recovery of the target data.
  • the plurality of disks include a first disk and a second disk, and the data stored on the first disk and the data stored on the second disk are in a mirroring relationship, where the first disk is the target disk; in other words, the RAID is The RAID of the mirror redundancy mechanism is such as RAID1 and RAID10. For example, the RAID is RAID1.
  • the downgrade writing method is to write the target data to the second disk. Realize the downgrade writing of the RAID of the mirror redundancy mechanism, respond to the host's write data command, and write the target data to the disk that has a redundant relationship with the target disk, so that the RAID group continues to respond to the host during the upgrade and activation process of the target disk. write data command.
  • the write log includes the logical block address of the target data and the length of the target data; reconstructing the target data to the target disk based on the write log includes: reading the target data from the second disk; based on the logical block address and the length of the target data, write the target data to the target disk, and complete the reconstruction of the target data.
  • reconstructing the target data to the target disk based on the write log includes: reading the target data from the second disk; based on the logical block address and the length of the target data, write the target data to the target disk, and complete the reconstruction of the target data.
  • the plurality of disks include a third disk, a fourth disk and a fifth disk, where the third disk is the target disk; that is to say, the RAID is a RAID with a redundancy check mechanism, such as RAID3 , RAID5, RAID6, RAID50 and RAID60, etc., for example, the RAID is RAID3, and the implementation of writing the first data through downgrade writing is: reading data that has a verification relationship with the target data from the fourth disk; based on The target data and the data having a verification relationship with the target data are determined to determine the verification data corresponding to the target data; the verification data is written to the fifth disk.
  • the RAID is a RAID with a redundancy check mechanism, such as RAID3 , RAID5, RAID6, RAID50 and RAID60, etc.
  • the RAID is RAID3
  • the implementation of writing the first data through downgrade writing is: reading data that has a verification relationship with the target data from the fourth disk; based on The target data and the data having
  • the write log includes the logical block address of the target data and the length of the target data; reconstructing the target data to the target disk based on the write log includes: reading from the fourth disk and having a checksum with the target data. Read the verification data corresponding to the target data from the fifth disk; determine the target data based on the data and verification data that have a verification relationship with the target data; based on the logical block address and the length of the target data, Write the target data to the target disk to complete the reconstruction of the target data.
  • the target data on the target disk can be quickly restored after the target disk is upgraded and activated.
  • embodiments of the present application provide a data reading device during the disk firmware upgrade process, which is applied to a RAID controller.
  • RAID also includes several RAID groups.
  • the RAID group includes multiple disks.
  • the RAID has a redundant function.
  • the implementation of this application provides a data reading device for disk firmware upgrade process, including: a receiving module, a first determination module, a downgrade reading module and a second determination module, wherein the receiving module is used to receive a read data instruction, and the read data instruction Used to instruct reading of target data; the first determination module is used to determine that the target disk corresponding to the target data is in the firmware upgrade activation state, and the target disk is any one of the plurality of disks; the downgrade reading module is used to read through downgrade Read the first data, which is data stored in a disk that has a redundant relationship with the target disk among the plurality of disks and has a redundant relationship with the target data; the second determination module is used to determine the target data based on the first data .
  • the plurality of disks include a first disk and a second disk, and the data stored on the first disk and the data stored on the second disk are in a mirroring relationship, where the first disk is the target disk; RAID is mirror redundancy. RAID with residual mechanisms is such as RAID1 and RAID10. An exemplary RAID is RAID1.
  • the degraded read module is specifically used to: read the mirror data of the target data from the second disk.
  • the plurality of disks include a third disk, a fourth disk and a fifth disk, where the third disk is the target disk; that is, the RAID is RAID with a redundancy check mechanism, such as RAID3, RAID5, RAID6, RAID50, RAID60, etc., for example, the RAID is RAID3, and the degraded reading module is specifically used to: read data that has a verification relationship with the target data from the fourth disk, and read the data corresponding to the target data from the fifth disk. Check data.
  • the second determination module is specifically configured to determine the target data based on the data having a verification relationship with the target data and the verification data.
  • embodiments of the present application provide a data writing device during the disk firmware upgrade process, which is applied to a RAID controller.
  • RAID also includes several RAID groups.
  • the RAID group includes multiple disks.
  • the RAID has a redundant function.
  • the implementation of this application provides a data writing device for the disk firmware upgrade process, including: a receiving module, a determination module, a downgrade writing module, a log writing module and a reconstruction module, wherein the receiving module is used to receive data writing instructions and write data.
  • the instruction is used to instruct the writing of target data; the determination module is used to determine that the target disk corresponding to the target data is in the firmware upgrade activation state, and the target disk is any one of multiple disks; the downgrade write module is used to write to multiple disks through downgrade writing.
  • disk with The target disk writes the first data to a disk that has a redundant relationship, and the first data has a redundant relationship with the target data; the writing log module is used to write a writing log to the memory corresponding to the RAID controller, and the writing log is used to write to the target disk.
  • the data is reconstructed; the reconstruction module is used to reconstruct the target data to the target disk based on writing logs after the target disk firmware upgrade is activated.
  • the plurality of disks include a first disk and a second disk, and the data stored on the first disk and the data stored on the second disk are in a mirroring relationship, where the first disk is the target disk; in other words, the RAID is a mirror.
  • the RAID of the redundancy mechanism is such as RAID1 and RAID10.
  • the RAID is RAID1.
  • the downgrade write module is specifically used to: write target data to the second disk.
  • the write log includes the logical block address of the target data and the length of the target data; the reconstruction module is specifically used to: read the target data from the second disk; based on the logical block address and the target data Length, write the target data to the target disk.
  • the plurality of disks include a third disk, a fourth disk and a fifth disk, where the third disk is the target disk; the degraded write module is specifically used to: read the target data from the fourth disk Data with a verification relationship; based on the target data and data with a verification relationship with the target data, determine the verification data corresponding to the target data; write the verification data to the fifth disk.
  • the writing log includes the logical block address of the target data and the length of the target data; the reconstruction module is specifically used to: read data that has a verification relationship with the target data from the fourth disk, and read the data from the fourth disk that has a verification relationship with the target data. Read the verification data corresponding to the target data from the five disks; determine the target data based on the data and verification data that have a verification relationship with the target data; write the target data to the target disk based on the logical block address and the length of the target data .
  • embodiments of the present application provide a computing device, including a processor, a RAID controller, and multiple disks.
  • the processor and the RAID controller are communicatively connected, and the RAID controller is communicatively connected with the multiple disks; the RAID controller is used for: After receiving the command instructing to read the target data, determine that the target disk corresponding to the target data is in the firmware upgrade activation state, and the target disk is any one of multiple disks; read from multiple disks that have a redundant relationship with the target disk.
  • the first data has a redundant relationship with the target data; based on the first data, the target data is determined.
  • the RAID controller is a RAID card, or the RAID controller is integrated in the processor.
  • the plurality of disks include a first disk and a second disk, and the data stored on the first disk and the data stored on the second disk are in a mirroring relationship, where the first disk is the target disk; in other words, the RAID is a mirror.
  • the RAID of the redundancy mechanism is such as RAID1 and RAID10.
  • the RAID is RAID1.
  • Reading the first data by downgrade means reading the mirror data of the target data from the second disk, and the read data is the target data.
  • the plurality of disks include at least a third disk, a fourth disk, and a fifth disk, wherein the third disk is a target disk; that is, the RAID is a RAID with a redundancy check mechanism. , such as RAID5, RAID6, RAID50 and RAID60, etc., for example, the RAID is RAID5, and the implementation of reading the first data through degraded reading is: reading the data that has a verification relationship with the target data from the fourth disk, Read the verification data corresponding to the target data from the fifth disk.
  • determining the target data based on the first data includes: determining the target data based on data having a verification relationship with the target data and the verification data.
  • Target data D12 is obtained.
  • embodiments of the present application provide a computing device, including a processor, a RAID controller, and multiple disks, The processor and the RAID controller are communicated and connected, and the RAID controller is communicated and connected with multiple disks; the RAID controller is used to: receive write data instructions, and the write data instructions are used to instruct the writing of target data; determine that the target disk corresponding to the target data is in the firmware upgrade state In the activated state, the target disk is any one of multiple disks; write the first data to the disk that has a redundant relationship with the target disk among the multiple disks, and the first data has a redundant relationship with the target data; write the first data to the RAID controller Write the write log in the corresponding memory, and the write log is used to reconstruct the target data; when the target disk firmware upgrade is activated, the target data is reconstructed to the target disk based on the write log.
  • a computing device provided by an embodiment of the present application responds to the host's data writing instructions through downgrade writing during the upgrade and activation process of the target disk, does not block the IO between the RAID group and the host, and continues to respond to the host's data writing instructions. , and at the same time, after the target disk is upgraded and activated, the target data is reconstructed to the target disk using the write log to achieve rapid recovery of the target data.
  • the RAID controller is a RAID card, or the RAID controller is integrated into the processor.
  • the RAID controller provides a variety of implementation methods, and you can choose the appropriate implementation method according to the actual situation.
  • the plurality of disks include a first disk and a second disk, and the data stored on the first disk and the data stored on the second disk are in a mirroring relationship, where the first disk is the target disk; in other words, the RAID is a mirror.
  • the RAID of the redundancy mechanism is such as RAID1 and RAID10.
  • the RAID is RAID1.
  • the downgrade writing method is to write the target data to the second disk. Realize the downgrade writing of the RAID of the mirror redundancy mechanism, respond to the host's write data command, and write the target data to the disk that has a redundant relationship with the target disk, so that the RAID group continues to respond to the host during the upgrade and activation process of the target disk. write data command.
  • the write log includes the logical block address of the target data and the length of the target data; reconstructing the target data to the target disk based on the write log includes: reading the target data from the second disk; based on the logical block address and the length of the target data, write the target data to the target disk, and complete the reconstruction of the target data.
  • reconstructing the target data to the target disk based on the write log includes: reading the target data from the second disk; based on the logical block address and the length of the target data, write the target data to the target disk, and complete the reconstruction of the target data.
  • the plurality of disks include a third disk, a fourth disk and a fifth disk, where the third disk is the target disk; that is, the RAID is a RAID with a redundancy check mechanism, such as RAID5 , RAID6, RAID50 and RAID60, etc., for example, the RAID is RAID5, and the implementation of writing the first data through downgrade writing is: reading data that has a verification relationship with the target data from the fourth disk; based on the target data and the data that has a verification relationship with the target data to determine the verification data corresponding to the target data; write the verification data to the fifth disk.
  • the RAID is a RAID with a redundancy check mechanism, such as RAID5 , RAID6, RAID50 and RAID60, etc.
  • the RAID is RAID5
  • the implementation of writing the first data through downgrade writing is: reading data that has a verification relationship with the target data from the fourth disk; based on the target data and the data that has a verification relationship with the target data to determine
  • the write log includes the logical block address of the target data and the length of the target data; reconstructing the target data to the target disk based on the write log includes: reading from the fourth disk and having a checksum with the target data. Read the verification data corresponding to the target data from the fifth disk; determine the target data based on the data and verification data that have a verification relationship with the target data; based on the logical block address and the length of the target data, Write the target data to the target disk to complete the reconstruction of the target data.
  • the target data on the target disk can be quickly restored after the target disk is upgraded and activated.
  • embodiments of the present application provide a storage system, including a RAID controller and several RAID groups.
  • the RAID group includes multiple disks.
  • the RAID controller can perform the method described in the first aspect and/or the second aspect, To achieve reading and/or writing of data during the disk upgrade activation process.
  • embodiments of the present application provide a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed in a computer, the computer is caused to execute the method described in the first aspect and/or the second aspect. .
  • the present application provides a computer program or computer program product.
  • the computer program or computer program product includes instructions. When the instructions are executed, the methods provided in the first and/or second aspect of the application are implemented. method.
  • Figure 1 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • Figure 2 is a schematic structural diagram of a RAID card in Figure 1;
  • Figure 3 is a flow chart of a disk upgrade method provided by an embodiment of the present application.
  • Figure 4 is a flow chart of a method for reading data during a disk firmware upgrade process provided by an embodiment of the present application
  • Figure 5 is a schematic diagram of RAID1 degraded reading
  • Figure 6 is a schematic diagram of RAID1 storing data
  • Figure 7 is a schematic diagram of degraded read of non-RIAD1 RAID with redundancy function
  • Figure 8 is a schematic diagram of non-RIAD1 RAID with redundancy function to store data
  • Figure 9 is a flow chart of a method for writing data during a disk firmware upgrade process provided by an embodiment of the present application.
  • Figure 10 is a schematic diagram written for RAID1 downgrade
  • Figure 11 is a schematic diagram of the reconstruction of target data for RAID after the target disk upgrade is completed
  • Figure 12 is a schematic diagram of downgrade writing of non-RIAD1 RAID with redundancy function
  • Figure 13 is a schematic diagram of the target data reconstruction after the target disk upgrade is completed for non-RIAD1 RAID with redundancy function
  • Figure 14 is a schematic structural diagram of a data reading device during a disk firmware upgrade process provided by an embodiment of the present application
  • Figure 15 is a schematic structural diagram of a data writing device during a disk firmware upgrade process provided by an embodiment of the present application.
  • RAID refers to the use of multiple independent disks to form a large disk system, thereby achieving better storage performance and higher reliability than a single disk.
  • RAID includes various types of redundant disk arrays such as RAID0, RAID1, RAID3, RAID5, RAID6, RAID10, RAID50 and RAID60.
  • RAID0 combines multiple disks to form a large-capacity storage.
  • we will divide the data into N parts and realize the reading and writing of N disks in an independent manner. Then these N parts of data will be written to the disk concurrently at the same time, so the execution performance is very high.
  • it does not have a redundant function and does not provide data verification or redundant backup. Therefore, once a certain disk is damaged, the data will be lost directly and cannot be restored.
  • RAID1, RAID3, RAID5, RAID6, RAID10, RAID50 and RAID60 all have redundancy capabilities.
  • RAID1 includes two disks, one is the working disk and the other is the mirror disk. When writing data to the disk, the same data is written to the working disk and the mirror disk without any difference.
  • RAID3 divides the data into multiple copies and writes them to multiple disks at the same time in the form of RAID0, but an additional disk is reserved for writing verification data (such as parity code). For example, if there are N disks in total, N-1 of them will be used to write data concurrently, and the Nth disk will be used to record check code data. Once a certain disk is damaged, other N-1 disks can be used to recover data.
  • RAID5 can be said to be an improvement over RAID3.
  • RAID5 mode it is no longer necessary to use a separate disk to write the check code. It distributes the checksum information to various disks. For example, if there are N disks in total, the data to be written will be divided into N parts and written to N disks concurrently. At the same time, the check code information of the data will also be written to these N disks (data and The corresponding check code information must be stored separately on different disks). Once a certain disk is damaged, the remaining data and corresponding parity information can be used to restore the damaged data.
  • RAID6 is improved again on the basis of RAID5 and introduces the concept of double verification, which can ensure that data can be recovered even if two disks are damaged at the same time.
  • RAID6 also has an XOR check area for each data block. In this case, it is equivalent to two check protection measures for each data block, so the data There is more redundancy.
  • RAID10 can be understood as a combination of RAID1 and RAID0. It has the advantages of both RAID1 and RAID0. Based on the RAID1 mode, the disk is divided into two parts. When data is to be written, all data is written on both disks at the same time, which is equivalent to Double copies of data are written, which plays a role in data protection. And on each disk, the data will be divided into N parts for concurrent reading and writing based on RAID0 technology, which also ensures data efficiency.
  • RAID50 and RAID60 are disk arrays with redundant functions that are improved on the basis of RAID5 and RAID6 respectively.
  • FIG 1 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • the server includes a host, a RAID card, a hard disk backplane, and multiple disks (for example, disk 1, disk 2, and disk 3 in Figure 1).
  • the host includes the server's processor (central processing unit, CPU) and operating system.
  • the operating system runs on the processor.
  • Various software can be run on the host.
  • the RAID card is used to provide RAID technology to merge multiple disks into one logical Disk storage space, multiple disks are plugged into the hard disk backplane, the hard disk backplane is connected to the RAID card, and the RAID is connected to the host to provide storage space for the host.
  • the above-mentioned disks can be various types of disks, such as solid state drives (SSD) or mechanical hard disks (HDD), and can be various interface protocols, such as serially connected small computer systems.
  • interface serial attached small computer system interface, SAS
  • disk or serial advanced technology attachment serial advance technology attachment, SATA
  • logical device interface specification non-volatile memory express, NVME
  • other interface protocols that is to say, in In the embodiment of this application, there are no specific limitations on the specific type of disk and the interface protocol used.
  • the host and the RAID card can be connected through various communication methods, such as peripheral component interconnect standard (PCI) bus, peripheral component interconnect express (PCIe) bus, etc. for wired connection.
  • PCI peripheral component interconnect standard
  • PCIe peripheral component interconnect express
  • the connection between the RAID card, hard drive backplane, and multiple disks can be a variety of interface protocols, such as serial attached small computer system interface (SAS), disk, or Serial Advanced Technology Attachment (SAS). serial advance technology attachment (SATA), logical device interface specification (non-volatile memory express, NVME) and other interface protocols.
  • SAS serial attached small computer system interface
  • SAS Serial Advanced Technology Attachment
  • SAS Serial Advance technology attachment
  • NVME non-volatile memory express
  • the embodiments of this application are not limited to the host and RAID card, RAID card, hard disk backplane and multiple disks. Connection method, you can choose the appropriate communication connection method according to the actual situation.
  • the host can carry upper-layer services, and during operation, the upper-layer services can read data stored in the disk array or write data to the disk array through the connection between the host and the disk array.
  • the RAID card is used to implement the function of the RAID controller.
  • the server may not have a RAID card, and the RAID controller may be integrated into the processor of the host to realize the management of multiple disks. .
  • the following takes the implementation of a RAID controller as a RAID card as an example to introduce the reading and writing solution during the disk firmware upgrade process provided by the embodiment of the present application.
  • the structure of the server shown in FIG. 1 does not constitute a limitation on the structure of the server.
  • the server may include more or less components than shown in the figure, or some components may be combined, or may be arranged differently.
  • a RAID card is not included, and the RAID controller is integrated in the processor of the server's host, or the server can include more or fewer disks, etc.
  • the server shown in Figure 1 can be a variety of servers, such as a server with an limited.
  • Figure 2 is a schematic structural diagram of a RAID card in Figure 1.
  • the RAID card 200 includes at least one processor 201 , a memory 202 and a communication interface 203 .
  • the processor 201, the memory 202 and the communication interface 203 are communicatively connected, and the communication connection can be realized in a wired manner (such as a bus) or in a wireless manner.
  • the communication interface 203 is used to receive data sent by other devices (such as IO instructions sent by the host); the memory 202 stores computer instructions, and the processor 201 executes the computer instructions to implement the method provided by the embodiment of the present application.
  • the memory 202 may also store logs, such as write logs for downgrade writes, etc.
  • the RAID card 200 connects multiple disks through various interface protocols, such as SAS, SATA, and NVME, and combines the multiple disks together to form a logical storage space.
  • interface protocols such as SAS, SATA, and NVME
  • the processor 201 can be a central processing unit CPU, and the processor 201 can also be other general-purpose processors, digital signal processors (digital signal processors, DSPs), application specific integrated circuits (application specific integrated circuits). specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor can be a microprocessor or any conventional processor, etc.
  • the memory 202 may include random access memory and provide instructions and data to the processor 201 .
  • Memory 202 may also include non-volatile random access memory.
  • the memory 202 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically removable memory.
  • ROM read-only memory
  • PROM programmable ROM
  • EPROM erasable programmable read-only memory
  • Erase programmable read-only memory electrically EPROM, EEPROM
  • Volatile memory may be random access memory (RAM), which is used as an external cache.
  • RAM static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • Double data rate synchronous dynamic random access memory double data date SDRAM, DDR SDRAM
  • enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
  • synchronous link dynamic random access memory direct rambus RAM, DR RAM
  • FIG 3 shows a disk upgrade method provided by an embodiment of the present application.
  • This upgrade method can be applied to the server shown in Figure 1 and is executed by the RAID card in the server. Understandably, the disk can also be called a hard disk.
  • the disk upgrade method includes: the RAID card receives the hard disk firmware online activation command, and then determines whether the online activation conditions are met and executes the online activation process provided by the embodiment of this application that does not block reading and writing between the RAID group and the host. If not, then Use the normal activation process (that is, the existing activation process that blocks reading and writing between the RAID group and the host). If satisfied, perform the step of setting the RAID group status to "Hard Disk Activation".
  • the condition for judging "whether the online activation conditions are met" is whether the RAID has redundancy function. If so, it is satisfied. If not, it is not satisfied. For example, when the RAID is RAID0 and does not have redundancy function, it is judged that it does not meet the online activation conditions and execute In the ordinary activation process, when the RAID is any one of RAID1, RAID3, RAID5, RAID6, RAID10, RAID50, and RAID60, it is judged that the online activation conditions are met, and the activation process provided by the embodiment of this application is executed.
  • the RAID card After setting the RAID group status to "hard disk activation", the RAID card targets the target hard disk in the RAID group (that is, the hard disk that needs to be upgraded and activated, such as a disk with a firmware bug, and its firmware needs to be upgraded to solve the bug problem) Send the activation command.
  • the RAID group uses the write log (log) to perform the post-activation partial reconstruction process to write the target data to the target hard disk.
  • the RAID The group is deactivated and the activation process ends.
  • the RAID card sends an activation command to the target hard disk, including the RAID card determining whether multiple hard disks with redundant relationships in the RAID group need to be upgraded and activated. If so, the RAID card sorts the multiple hard disks according to the sorting. Send upgrade commands to multiple hard disks in sequence. After the firmware upgrade of one hard disk is completed, send the firmware upgrade command to the next hard disk so that multiple hard disks can be upgraded and activated sequentially according to the order. This avoids the simultaneous use of redundant hard disks in the RAID group.
  • the RAID card can send firmware upgrade activation commands to the hard disks that need to be upgraded and activated at the same time, so that they can be upgraded and activated at the same time, or it can send firmware upgrade commands to the hard disks that need to be upgraded and activated in sequence, so that they can be upgraded and activated one after another.
  • FIG. 4 is a flow chart of a method for reading data during a disk firmware upgrade process provided by an embodiment of the present application. This method can be applied to the RAID card in Figure 1.
  • the embodiment of the present application provides a method for reading data during a disk firmware upgrade process, which at least includes steps S401 to S404.
  • step S401 a read data instruction is received, and the read data instruction is used to instruct reading of target data.
  • the processor of the host sends a read data command to the RAID card.
  • the read data command is used to instruct the reading of target data.
  • the RAID card receives the data read command and executes the command.
  • the read data command carries the address information of the target data.
  • the read data command carries the logical block address (LBA) and length of the target data.
  • LBA logical block address
  • the RAID card After receiving the read data command, the RAID card The command is parsed to obtain the LBA and length information carried in the command. The RAID card uses the LBA and length information to calculate the target disk where the target data is located and the specific location in the target disk.
  • step S402 it is determined that the target disk corresponding to the target data is in a firmware upgrade activation state.
  • the RAID card After the RAID card determines the target disk where the target data is located through LBA, it detects whether the target disk is in the firmware upgrade activation state. If the target disk is in the firmware upgrade activation state, perform subsequent steps S403-S404; if the target disk is not in the firmware upgrade activation state, just execute the normal read command, that is, read the target data from the target disk, and save the target data to the target disk. Target data is returned to the host.
  • step S403 the first data is read through degraded reading.
  • the target disk When the target disk is in the firmware upgrade activation state, the target disk cannot respond to the read command. You can use degraded reading to read the target data from the disk that has a redundant relationship with the target disk in the RAID group where the target disk is located. the first data, and determine the target data based on the first data.
  • RAID can be RAID with a mirror redundancy mechanism, such as RAID1 and RAID10. For example, see Figure 5.
  • the RAID is RAID1.
  • the multiple disks include disk 1 and disk 2.
  • the data stored in disk 1 and the data stored in disk 2 It is a mirror relationship.
  • disk 1 is the target disk
  • disk 1 is in the firmware upgrade state
  • the disk that has a redundant relationship with disk 1 is disk 2.
  • the RAID card reads the mirror data D1 of the target data from disk 2, and D1 can be Return to host as target data.
  • data in disk 1 and disk 2 in RAID 1 are stored in the form of stripes.
  • the same data is stored in disk 1 and disk 2 respectively, and the same data is located on the same strip.
  • disk 1 stores multiple pieces of data D1, D2, D3, and D4, and the same data stored in disk 2 is located on the same strip.
  • data D1 in disk 1 and data D1 in disk 2 Located on stripe 1, data D2 in disk 1 and data D2 in disk 2 are located on stripe 2, data D3 in disk 1 and data D3 in disk 2 are located on stripe 3, data D4 in disk 1 and data D4 in disk 2 is on stripe 4.
  • the LBA and length of the target data are obtained, and the location of the target data is determined to be the location of the data D1 of disk 1, that is, on stripe 1.
  • degraded read is used. method to read data D1 from stripe 1 of disk 2, and return data D1 to the host to complete the execution of the read command.
  • the RAID has a redundancy check mechanism, such as RAID3, RAID5, RAID6, RAID50, and RAID60.
  • the exemplary RAID is RAID3, as shown in Figure 7. Multiple disks in a RAID group are at least It includes Disk 1, Disk 2 and a verification disk; Disk 1 and Disk 2 store business data, and the verification disk stores verification data.
  • the target disk for example, disk 2
  • the firmware upgrade activation state When it is determined that the target disk (for example, disk 2) is in the firmware upgrade activation state, perform downgraded reading to read the data that has a verification relationship with the target data (for example, data D11) from disk 1 and read the target data from the verification disk.
  • Corresponding verification data for example, P1
  • data D11 and P1 are the first data.
  • Figure 8 shows the data storage structure of a RAID group of RAID5.
  • the RAID group includes disk 1, disk 2 and the parity disk.
  • Disk 1, disk 2 and the parity disk in the RAID group are divided into strips according to the same LBA length. Each disk takes the stripe at the same position.
  • the strip units are combined together to form a strip of the RAID group, such as strip 1, strip 2, strip 3 and strip 4 in Figure 6.
  • the strip units of the parity disk in the RAID group are used as the parity area.
  • other strip units serve as data areas, for example, in Figure 8, the storage area where D11 and D21 in strip 1 are located is the data area, and the area where P1 in strip 1 is located is the check area.
  • Data D11 and data D21 in strip 1 are data with a check relationship
  • data P1 in the check area is It is the check data of data D11 or D21.
  • step S404 target data is determined based on the first data.
  • RAID for mirror redundancy mechanism such as RAID1
  • RAID1 because the data in the two disks of the RAID group is in a mirror relationship, Therefore, the first data is the target data.
  • the mirror data of the target data is read from another disk in the RAID group that is not the target disk, and the mirror data is directly returned to the host to complete the execution of reading the data.
  • RAID with redundancy verification mechanism such as RAID3, RAID5, RAID6, RAID50 and RAID60, etc.
  • RAID3 For RAID with redundancy verification mechanism, such as RAID3, RAID5, RAID6, RAID50 and RAID60, etc., based on the redundant relationship between the RAID group and the target disk, reading the data and verification data that has a verification relationship with the target disk, based on Data that has a verification relationship with the target data and verification data determine the target data.
  • the data that has a verification relationship with the target data is D11, and the verification data of the target data is P1.
  • the target data is calculated to be D12, and D12 is used as the target data.
  • disks with a redundant relationship can be understood as multiple disks in a RAID group. When the data in one of the disks is damaged or lost, the data in the disk can be recovered through other disks.
  • the multiple disks That is, disks with a redundant relationship; for example, disk 1 and disk 2 in Figure 5 are disks with a redundant relationship, and disk 1, disk 2, and the check disk in Figure 7 are disks with a redundant relationship.
  • An embodiment of the present application provides a method for reading data during a disk firmware upgrade process.
  • the target data is read through downgraded reading, that is, by reading from multiple disks that have a redundant relationship with the target disk.
  • the target data has a redundant relationship, and then the target data is determined based on the data that has a redundant relationship with the target data. This enables the disk firmware to continue to respond to the read data instructions of the upper-layer business during the upgrade and activation process, and avoids the need for disk firmware upgrade and activation. Impact on upper-level businesses and improve user experience.
  • the embodiment of the present application also provides a writing method during the disk firmware upgrade process.
  • the target disk responds to the host's write data instructions by downgrading the write method without blocking the IO between the RAID group and the host.
  • the write log is used to reconstruct the target data to the target disk to achieve rapid recovery of the target data.
  • Figure 9 is a flow chart of a method for writing data during a disk firmware upgrade process provided by an embodiment of the present application. This method can be applied to the RAID card shown in Figure 1.
  • the embodiment of the present application provides a method for writing data during a disk firmware upgrade process, which at least includes steps S901 to S905.
  • step S901 a write data instruction is received, and the write data instruction is used to instruct writing of target data.
  • the processor of the host sends a write data instruction to the RAID card.
  • the write data instruction is used to instruct the target data to be written to the target location of the target disk.
  • the RAID card receives the data write command and executes the command.
  • the write data command carries the target data and the write address information of the target data.
  • the write data command carries the target data and the LBA and length of the target data.
  • the RAID card After receiving the write data command, the RAID card performs the command on Analyze and obtain the target data, LBA and length information carried in the instruction. The RAID card uses the LBA and length information to calculate the target disk to which the target data is to be written and the specific location in the target disk.
  • step S902 it is determined that the target disk corresponding to the target data is in a firmware upgrade activation state.
  • the RAID card After the RAID card determines the target disk where the target data is located through LBA, it detects whether the target disk is in the firmware upgrade activation state. If the target disk is in the firmware upgrade activation state, perform subsequent steps S703-S705; if the target disk is not in the firmware upgrade activation state, just execute the normal write command, that is, write the target data to the target location in the target disk, and that is complete. Write the execution of the command.
  • step S903 a disk that has a redundant relationship with the target data among the plurality of disks is written in a degraded manner. Write the first data.
  • the target disk When the target disk is in the firmware upgrade activation state, the target disk cannot respond to write commands. You can use the downgrade write method to write redundant data with the target disk in a disk that has a redundant relationship with the target disk in the RAID group where the target disk is located. the first data.
  • RAID for the mirror redundancy mechanism such as RAID1
  • the RAID group includes disk 1 and disk 2
  • the data stored in disk 1 and the data stored in disk 2 are mirroring relationships, when disk 1 is the target disk, the disk 1 is in the firmware upgrade state, and the disk that has a redundant relationship with disk 1 is disk 2.
  • the target data and the LBA and length of the target data are obtained, and the write location of the target data is determined to be the stripe 1 area on disk 1.
  • the downgrade write method is used.
  • the target data is written to the stripe 1 area on disk 2, responding to the write data instruction of the upper-layer business.
  • the RAID is RAID with a redundancy check mechanism, such as RAID3, RAID5, RAID6, RAID50, and RAID60.
  • the RAID is RAID3.
  • a RAID group includes at least disk 1. , Disk 2 and the verification disk; Disk 1, Disk 2 and the verification disk have a redundant relationship. The data in the other disk can be obtained from the data of the other two disks. Disk 1 and Disk 2 store business data. , the verification data is stored in the verification disk.
  • the target disk for example, disk 2
  • the firmware upgrade activation state When it is determined that the target disk (for example, disk 2) is in the firmware upgrade activation state, the first data is written to the disk in the RAID group that has a redundant relationship with the target disk by performing downgrade writing.
  • the target data Dn and the target disk to which the target data is to be written are disk 2, and the data D11 that has a verification relationship with the target data Dn is read from disk 1.
  • step S904 the write log is written into the memory of the RAID card.
  • the process of downgrading writing also includes writing the writing log of downgrading writing into the memory of the RAID card.
  • the writing log is at least It includes the LBA and length information corresponding to the write command, that is, the LBA to which the target data is to be written and the length of the target data. Based on the LBA and length information, the target disk to which the target data is to be written and the specific writing location in the target disk can be determined.
  • step S905 after the target disk firmware upgrade activation is completed, the target data is reconstructed to the target disk based on the write log.
  • RAID is a RAID with a mirror redundancy mechanism, such as RAID1.
  • the target data is read from disk 2.
  • Dn for example, based on the LBA and length information in the write log, it is determined that the target location in target disk 1 corresponding to the target information is the storage area in disk 1 corresponding to stripe 1, then the storage area in disk 2 corresponding to stripe 1 is Read the target data Dn in the area, determine the target data Dn and write it to the target location in disk 1 based on the LBA and length information in the write log, write the target data Dn to the target location in disk 1, and complete the target data of disk 1.
  • Reconstruction enables quick recovery of data after disk 1 firmware upgrade and activation is completed, ensuring consistent disk striping and avoiding data loss.
  • RAID is a RAID with a redundancy check mechanism, such as RAID3, RAID5, RAID6, RAID50 and RAID60.
  • RAID is RAID3, read the data D11 that has a verification relationship with the target data Dn from disk 1, and read the target from the verification disk Verification data P1 of data Dn, (for example, based on the LBA of target data Dn and the length information of target data Dn recorded in the write log, determine the writing location of the target data to be the storage area in disk 2 corresponding to stripe 1, respectively Read data D11 from the storage area of disk 1 corresponding to stripe 1, and read data P1) from the storage area of the verification disk corresponding to stripe 1.
  • reconstructing the target data to the target disk means writing the target data to the target disk to complete the recovery of the target data on the target disk.
  • the embodiment of the present application also provides a data reading device 1200 during the disk firmware upgrade process.
  • the data reading device 1200 includes units or modules for implementing each step of the data reading method in the disk firmware upgrade process shown in Figures 2-6.
  • FIG. 14 is a schematic structural diagram of a data reading device during a disk firmware upgrade process provided by an embodiment of the present application. This device is applied to the RAID controller of the server. For example, it can be the RAID card in Figure 1. As shown in Figure 14, the device 1400 for reading data during the disk firmware upgrade process at least includes:
  • the receiving module 1401 is used to receive read data instructions, and the read data instructions are used to instruct reading of target data;
  • the first determination module 1402 is used to determine that the target disk corresponding to the target data is in the firmware upgrade activation state, and the target disk is any one of the plurality of disks;
  • the degraded read module 1403 is configured to read the first data through degraded reading.
  • the first data is data that is stored in a disk that has a redundant relationship with the target disk among multiple disks and has a redundant relationship with the target data;
  • the second determination module 1404 is used to determine target data based on the first data.
  • the plurality of disks include a first disk and a second disk, and the data stored on the first disk and the data stored on the second disk are in a mirroring relationship, where the first disk is the target disk; that is, the RAID has In the RAID of the mirror redundancy mechanism, such as RAID1, the downgrade reading module 1403 is specifically used to read the mirror data of the target data from the second disk.
  • the plurality of disks include a third disk, a fourth disk and a fifth disk, where the third disk is the target disk; that is, the RAID is RAID with a redundancy check mechanism, such as RAID3, RAID5 and RAID6, etc.
  • the degraded read 1403 module is specifically used to: read the data that has a verification relationship with the target data from the fourth disk, and read the verification data corresponding to the target data from the fifth disk.
  • the second determination module 1404 is specifically configured to determine the target data based on the data having a verification relationship with the target data and the verification data.
  • the device 1400 for reading data in the disk firmware upgrade process may correspond to the execution of the method described in the embodiment of the present application, and the above and other methods for each module in the device 1400 for reading data in the process of disk firmware upgrade.
  • the operations and/or functions are respectively to implement the corresponding processes of each method in Figure 4-8. For the sake of simplicity, they will not be described again here.
  • the embodiment of the present application also provides a data writing device 1500 during the disk firmware upgrade process.
  • the data writing device 1500 in the process includes units or modules for implementing each step of the data writing method in the disk firmware upgrade process shown in Figures 9-13.
  • Figure 15 is a schematic structural diagram of a data writing device during a disk firmware upgrade process provided by an embodiment of the present application. This device is applied to the RAID controller of the server, for example, it can be the RAID card in Figure 1. As shown in Figure 15, the device 1500 for writing data during the disk firmware upgrade process at least includes:
  • the receiving module 1501 is used to receive write data instructions, and the write data instructions are used to instruct writing of target data;
  • the determination module 1502 is used to determine that the target disk corresponding to the target data is in the firmware upgrade activation state, and the target disk is any one of multiple disks;
  • the downgrade writing module 1503 is configured to write the first data to the disk that has a redundant relationship with the target disk among the plurality of disks through downgrade writing, and the first data has a redundant relationship with the target data;
  • the writing log module 1504 is used to write writing logs into the memory corresponding to the RAID controller, and the writing logs are used to reconstruct the target data;
  • the reconstruction module 1505 is used to reconstruct the target data to the target disk based on the write log after the target disk firmware upgrade is activated.
  • the plurality of disks include a first disk and a second disk, and the data stored on the first disk and the data stored on the second disk are in a mirroring relationship, where the first disk is the target disk; in other words, the RAID is RAID1 ,
  • the downgraded write mode 1503 is specifically used to: write target data to the second disk.
  • the write log includes the logical block address of the target data and the length of the target data; the reconstruction module 1505 is specifically configured to: read the target data from the second disk; based on the logical block address and the target data length, write the target data to the target disk.
  • the plurality of disks include a third disk, a fourth disk and a fifth disk, where the third disk is the target disk; the downgrade write module 1503 is specifically used to: read from the fourth disk and the target disk.
  • the data has a verification relationship; based on the target data and the data having a verification relationship with the target data, determine the verification data corresponding to the target data; write the verification data to the fifth disk.
  • the writing log includes the logical block address of the target data and the length of the target data; the reconstruction module 1505 is specifically used to: read data that has a verification relationship with the target data from the fourth disk, from Read the verification data corresponding to the target data from the fifth disk; determine the target data based on the data and verification data that have a verification relationship with the target data; write the target data to the target based on the logical block address and the length of the target data disk.
  • the device 1500 for writing data in the disk firmware upgrade process may correspond to the execution of the method described in the embodiment of the present application, and the above and other methods for each module in the device 1500 for writing data during the disk firmware upgrade process.
  • the operations and/or functions are respectively to implement the corresponding processes of each method in Figure 9-13. For the sake of simplicity, they will not be described again here.
  • Embodiments of the present application provide a computer-readable storage medium on which a computer program is stored. When the computer instructions are executed by a processor, the above-mentioned method is implemented.
  • Embodiments of the present application provide a chip, which includes at least one processor and an interface.
  • the at least one processor determines program instructions or data through the interface; the at least one processor is used to execute the program instructions to Implement the methods mentioned above.
  • Embodiments of the present application provide a computer program or computer program product.
  • the computer program or computer program The program product includes instructions that, when executed, cause the computer to perform the methods mentioned above.
  • RAM random access memory
  • ROM read-only memory
  • electrically programmable ROM electrically erasable programmable ROM
  • registers hard disks, removable disks, CD-ROMs, or anywhere in the field of technology. any other known form of storage media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

提供一种针对磁盘固件升级过程中的读写方法,应用于具有冗余功能的冗余磁盘阵列的RAID控制器,该方法包括:当目标磁盘处于固件升级激活状态时,采用降级读写的方式,从RAID组中与目标磁盘具有冗余关系的磁盘中进行读数据和写数据,同时在降级写的过程中将降级写的写日志写入RAID控制器对应的内存空间中,当目标磁盘固件升级激活完成后,利用写日志将目标数据重构至目标磁盘中,如此实现了在目标磁盘固件升级激活过程中的持续响应上层业务的读写命令,避免了磁盘固件升级对上层业务的影响,提升用户使用体验。

Description

一种针对磁盘固件升级过程中的读写数据方法及计算设备
本申请要求于2022年08月15日提交的申请号为202210974796.5、申请名称为“一种针对磁盘固件升级过程中的读写数据方法及计算设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及存储技术领域,尤其涉及一种针对磁盘固件升级过程中的读写数据方法及计算设备。
背景技术
服务器磁盘(disk)每年发货量上百万片,在网存量上千万片,服务器用户遇到磁盘故障的次数与存量成正比,非常多。其中,磁盘的一种典型故障模式为磁盘固件bug,需要升级磁盘固件解决。磁盘固件升级过程包括下载(download)和激活(active)两个步骤,磁盘执行固件download过程不会影响磁盘响应读写命令,但在active过程中磁盘需要复位,导致active过程中磁盘不能响应读写命令。
当前服务器的磁盘固件升级方案中,都会由于磁盘固件active的限制,阻塞主机(host)读写IO(input output,输入输出)的执行,这可能会导致业务响应超时等问题。
发明内容
本申请的实施例提供一种针对磁盘固件升级过程中的读写数据方法及计算设备,实现了在目标磁盘固件升级激活过程中的持续响应上层业务的读写命令,避免了磁盘固件升级对上层业务的影响,提升用户使用体验。
第一方面,本申请实施例提供了一种针对磁盘固件升级过程中的读数据方法,应用于冗余磁盘阵列(redundant arrays of independent disks,RAID)的RAID控制器,该RAID具有冗余功能,例如,RAID为RAID1、RAID5、RAID6、RAID10、RAID50和RAID60等具有冗余功能的RAID;RAID还包括若干RAID组,每个RAID组包括多个磁盘,本申请提供的一种针对磁盘固件升级过程中的读数据方法包括:接收读数据指令,读数据指令用于指示读取目标数据;确定目标数据对应的目标磁盘处于固件升级激活状态,目标磁盘为多个磁盘中的任一个;通过降级读的方式读取第一数据,第一数据为多个磁盘中与目标磁盘具有冗余关系的磁盘中存储的与目标数据具有冗余关系的数据;基于第一数据,确定目标数据。
本申请实施例提供的一种针对磁盘固件升级过程中的读数据方法,通过降级读的方式,读取目标数据,即通过对多个磁盘中与目标磁盘具有冗余关系的磁盘中读取与目标数据具有冗余关系的数据,再基于与目标数据具有冗余关系的数据确定目标数据,实现了磁盘固件在升级过程中依然可以持续响应上层业务的读数据指令,避免了磁盘固件升级对上层业务的影响,提升用户使用体验。
在一个可能的实现中,多个磁盘包括第一磁盘和第二磁盘,第一磁盘存储的数据和第二磁盘存储的数据为镜像关系,其中,第一磁盘为目标磁盘;换言之,RAID为镜像冗余机 制的RAID例如RAID1和RAID10,示例性的,RAID为RAID1,降级读取第一数据即为,从第二磁盘中读取目标数据的镜像数据,读取到的数据即为目标数据。实现对镜像冗余机制的RAID的降级读,响应主机的读数据指令,使得在目标磁盘升级激活过程中RAID组持续响应主机之间的读数据指令。
在另一个可能的实现中,多个磁盘至少包括第三磁盘、第四磁盘和第五磁盘,其中,所述第三磁盘为目标磁盘;也就是说,RAID为具有冗余校验机制的RAID,例如RAID5、RAID6、RAID50和RAID60等,示例性的,RAID为RAID5,通过降级读的方式读取第一数据的实现为:从第四磁盘中读取与目标数据具有校验关系的数据,从第五磁盘中读取目标数据对应的校验数据。实现对校验冗余机制的RAID的降级读,响应主机的读数据指令,使得在目标磁盘升级激活过程中RAID组持续响应主机之间的读数据指令。
在另一个可能的实现中,基于第一数据,确定目标数据,包括:基于与目标数据具有校验关系的数据和所述校验数据,确定目标数据。
例如,从第四磁盘中读取与目标数据具有校验关系的数据为D11,从第五磁盘中读取目标数据对应的校验数据为P1,则根据校验公式D11⊕P1=D12,计算得到目标数据D12。通过校验公式实现了通过与目标数据具有校验关系的数据(D11)和目标数据对应的校验数据(P1),得到目标数据(D12),将目标数据返回给主机,实现了目标数据的读取。
第二方面,本申请实施例提供了一种针对磁盘固件升级过程中的写数据方法,应用于RAID控制器,RAID为具有冗余功能的RAID,例如,RAID可以为RAID1、RAID5、RAID6、RAID10、RAID50和RAID60等;RAID还包括若干RAID组,每个RAID组包括多个磁盘,本申请提供的一种针对磁盘固件升级过程中的写数据方法包括:接收写数据指令,写数据指令用于指示写入目标数据;确定目标数据对应的目标磁盘处于固件升级激活状态,目标磁盘为多个磁盘中的任一个;通过降级写的方式向多个磁盘中与目标磁盘具有冗余关系的磁盘中写入第一数据,第一数据与目标数据具有冗余关系;向RAID控制器对应的内存中写入写日志,写日志用于对目标数据进行重构;当目标磁盘固件升级激活完成后,基于写日志将目标数据重构至目标磁盘。
本申请实施例提供的一种针对磁盘固件升级过程中的写数据方法,在目标磁盘升级激活过程中,通过降级写的方式,响应主机的写数据指令,不阻塞RAID组与主机之间的IO,持续响应主机的写数据指令,同时在目标磁盘升级完成后,利用写日志将目标数据重构至目标磁盘,实现目标数据的快速恢复。
在另一个可能的实现中,多个磁盘包括第一磁盘和第二磁盘,第一磁盘存储的数据和第二磁盘存储的数据为镜像关系,其中,第一磁盘为目标磁盘;换言之,RAID为镜像冗余机制的RAID例如RAID1和RAID10,示例性的,RAID为RAID1,降级写的方式即为,向第二磁盘中写入目标数据。实现对镜像冗余机制的RAID的降级写,响应主机的写数据指令,将目标数据写入与目标磁盘具有冗余关系的磁盘中,使得在目标磁盘升级激活过程中RAID组持续响应主机之间的写数据指令。
在一个示例中,写日志包括目标数据的逻辑区块地址和目标数据的长度;基于写日志将目标数据重构至目标磁盘,包括:从第二磁盘中读取目标数据;基于逻辑区块地址和目标数据的长度,将目标数据写入目标磁盘,完成目标数据的重构。针对镜像冗余机制的RAID,在目标磁盘升级激活完成后,通过写日志将目标数据写入目标磁盘,实现了目标数据的快 速恢复。
在另一个可能的实现中,多个磁盘包括第三磁盘、第四磁盘和第五磁盘,其中,第三磁盘为目标磁盘;也就是说,RAID为具有冗余校验机制的RAID,例如RAID3、RAID5、RAID6、RAID50和RAID60等,示例性的,RAID为RAID3,通过降级写的方式写入第一数据的实现为:从第四磁盘中读取与目标数据具有校验关系的数据;基于目标数据和与目标数据具有校验关系的数据,确定目标数据对应的校验数据;将校验数据写入第五磁盘。实现对校验冗余机制的RAID的降级写,响应主机的写数据指令,将目标数据对应的校验数据写入RAID组的其他磁盘中,使得在目标磁盘升级激活过程中RAID组持续响应主机之间的写数据指令。
在另一个可能的实现中,写日志包括目标数据的逻辑区块地址和目标数据的长度;基于写日志将目标数据重构至目标磁盘,包括:从第四磁盘中读取与目标数据具有校验关系的数据,从第五磁盘中读取目标数据对应的校验数据;基于与目标数据具有校验关系的数据和校验数据,确定目标数据;基于逻辑区块地址和目标数据的长度,将目标数据写入目标磁盘,完成目标数据的重构。针对校验冗余机制的RAID,在目标磁盘升级激活完成后,目标磁盘的目标数据的快速恢复。
第三方面,本申请实施例提供了一种针对磁盘固件升级过程中的读数据装置,应用于RAID控制器,RAID还包括若干RAID组,RAID组包括多个磁盘,该RAID具有冗余功能,本申请实施提供的一种针对磁盘固件升级过程中的读数据装置包括:接收模块、第一确定模块、降级读模块和第二确定模块,其中,接收模块用于接收读数据指令,读数据指令用于指示读取目标数据;第一确定模块用于确定目标数据对应的目标磁盘处于固件升级激活状态,目标磁盘为所述多个磁盘中的任一个;降级读模块用于通过降级读的方式读取第一数据,第一数据为多个磁盘中与目标磁盘具有冗余关系的磁盘中存储的与目标数据具有冗余关系的数据;第二确定模块用于基于第一数据,确定目标数据。
在另一个可能的实现中,多个磁盘包括第一磁盘和第二磁盘,第一磁盘存储的数据和第二磁盘存储的数据为镜像关系,其中,第一磁盘为目标磁盘;RAID为镜像冗余机制的RAID例如RAID1和RAID10,示例性的RAID为RAID1,降级读模块具体用于:从第二磁盘中读取目标数据的镜像数据。
在另一个可能的实现中,多个磁盘包括第三磁盘、第四磁盘和第五磁盘,其中,第三磁盘为目标磁盘;即RAID为具有冗余校验机制的RAID,例如RAID3、RAID5、RAID6、RAID50和RAID60等,示例性的,RAID为RAID3,降级读模块具体用于:从第四磁盘中读取与目标数据具有校验关系的数据,从第五磁盘中读取目标数据对应的校验数据。
在另一个可能的实现中,第二确定模块具体用于:基于与目标数据具有校验关系的数据和校验数据,确定目标数据。
第四方面,本申请实施例提供了一种针对磁盘固件升级过程中的写数据装置,应用于RAID控制器,RAID还包括若干RAID组,RAID组包括多个磁盘,该RAID具有冗余功能,本申请实施提供的一种针对磁盘固件升级过程中的写数据装置包括:接收模块、确定模块、降级写模块、写日志模块和重构模块,其中,接收模块用于接收写数据指令,写数据指令用于指示写入目标数据;确定模块用于确定目标数据对应的目标磁盘处于固件升级激活状态,目标磁盘为多个磁盘中的任一个;降级写模块用于通过降级写的方式向多个磁盘中与 目标磁盘具有冗余关系的磁盘中写入第一数据,第一数据与目标数据具有冗余关系;写日志模块用于向RAID控制器对应的内存中写入写日志,写日志用于对目标数据进行重构;重构模块用于当目标磁盘固件升级激活完成后,基于写日志将目标数据重构至目标磁盘。
在一个可能的实现中,多个磁盘包括第一磁盘和第二磁盘,第一磁盘存储的数据和第二磁盘存储的数据为镜像关系,其中,第一磁盘为目标磁盘;换言之,RAID为镜像冗余机制的RAID例如RAID1和RAID10,示例性的,RAID为RAID1,降级写模块具体用于:向第二磁盘中写入目标数据。
在另一个可能的实现中,写日志包括目标数据的逻辑区块地址和目标数据的长度;重构模块具体用于:从第二磁盘中读取目标数据;基于逻辑区块地址和目标数据的长度,将目标数据写入目标磁盘。
在另一个可能的实现中,多个磁盘包括第三磁盘、第四磁盘和第五磁盘,其中,第三磁盘为目标磁盘;降级写模块具体用于:从第四磁盘中读取与目标数据具有校验关系的数据;基于目标数据和与目标数据具有校验关系的数据,确定目标数据对应的校验数据;将校验数据写入第五磁盘。
在另一个可能的实现中,写日志包括目标数据的逻辑区块地址和目标数据的长度;重构模块具体用于:从第四磁盘中读取与目标数据具有校验关系的数据,从第五磁盘中读取目标数据对应的校验数据;基于与目标数据具有校验关系的数据和校验数据,确定目标数据;基于逻辑区块地址和目标数据的长度,将目标数据写入目标磁盘。
第五方面,本申请实施例提供一种计算设备,包括处理器、RAID控制器、多个磁盘,处理器和RAID控制器通信连接,RAID控制器与多个磁盘通信连接;RAID控制器用于:接收指示读取目标数据的命令之后,确定目标数据对应的目标磁盘处于固件升级激活状态,目标磁盘为多个磁盘中的任一个;从多个磁盘与目标磁盘具有冗余关系的磁盘中读取第一数据,第一数据与目标数据具有冗余关系;基于第一数据,确定目标数据。
在一个可能的实现中,RAID控制器为RAID卡,或者所述RAID控制器集成在所述处理器中。
在一个可能的实现中,多个磁盘包括第一磁盘和第二磁盘,第一磁盘存储的数据和第二磁盘存储的数据为镜像关系,其中,第一磁盘为目标磁盘;换言之,RAID为镜像冗余机制的RAID例如RAID1和RAID10,示例性的,RAID为RAID1,降级读取第一数据即为,从第二磁盘中读取目标数据的镜像数据,读取到的数据即为目标数据。
在另一个可能的实现中,多个磁盘至少包括第三磁盘、第四磁盘和第五磁盘,其中,所述第三磁盘为目标磁盘;也就是说,RAID为具有冗余校验机制的RAID,例如RAID5、RAID6、RAID50和RAID60等,示例性的,RAID为RAID5,通过降级读的方式读取第一数据的实现为:从第四磁盘中读取与目标数据具有校验关系的数据,从第五磁盘中读取目标数据对应的校验数据。
在另一个可能的实现中,基于第一数据,确定目标数据,包括:基于与目标数据具有校验关系的数据和所述校验数据,确定目标数据。
例如,从第四磁盘中读取与目标数据具有校验关系的数据为D11,从第五磁盘中读取目标数据对应的校验数据为P1,则根据校验公式D11⊕P1=D12,计算得到目标数据D12。
第六方面,本申请实施例提供一种计算设备,包括处理器、RAID控制器、多个磁盘, 处理器和RAID控制器通信连接,RAID控制器与多个磁盘通信连接;RAID控制器用于:接收写数据指令,写数据指令用于指示写入目标数据;确定目标数据对应的目标磁盘处于固件升级激活状态,目标磁盘为多个磁盘中的任一个;向多个磁盘中与目标磁盘具有冗余关系的磁盘中写入第一数据,第一数据与目标数据具有冗余关系;向RAID控制器对应的内存中写入写日志,写日志用于对目标数据进行重构;当目标磁盘固件升级激活完成后,基于写日志将目标数据重构至目标磁盘。
本申请实施例提供的一种计算设备,在目标磁盘升级激活过程中,通过降级写的方式,响应主机的写数据指令,不阻塞RAID组与主机之间的IO,持续响应主机的写数据指令,同时在目标磁盘升级激活完成后,利用写日志将目标数据重构至目标磁盘,实现目标数据的快速恢复。
可选的,RAID控制器为RAID卡,或者RAID控制器集成在处理器中。RAID控制器可提供了多种实现方式,可以根据实际情况进行选择合适的实现方式。
在一个可能的实现中,多个磁盘包括第一磁盘和第二磁盘,第一磁盘存储的数据和第二磁盘存储的数据为镜像关系,其中,第一磁盘为目标磁盘;换言之,RAID为镜像冗余机制的RAID例如RAID1和RAID10,示例性的,RAID为RAID1,降级写的方式即为,向第二磁盘中写入目标数据。实现对镜像冗余机制的RAID的降级写,响应主机的写数据指令,将目标数据写入与目标磁盘具有冗余关系的磁盘中,使得在目标磁盘升级激活过程中RAID组持续响应主机之间的写数据指令。
在一个示例中,写日志包括目标数据的逻辑区块地址和目标数据的长度;基于写日志将目标数据重构至目标磁盘,包括:从第二磁盘中读取目标数据;基于逻辑区块地址和目标数据的长度,将目标数据写入目标磁盘,完成目标数据的重构。针对镜像冗余机制的RAID,在目标磁盘升级激活完成后,通过写日志将目标数据写入目标磁盘,实现了目标数据的快速恢复。
在另一个可能的实现中,多个磁盘包括第三磁盘、第四磁盘和第五磁盘,其中,第三磁盘为目标磁盘;也就是说,RAID为具有冗余校验机制的RAID,例如RAID5、RAID6、RAID50和RAID60等,示例性的,RAID为RAID5,通过降级写的方式写入第一数据的实现为:从第四磁盘中读取与目标数据具有校验关系的数据;基于目标数据和与目标数据具有校验关系的数据,确定目标数据对应的校验数据;将校验数据写入第五磁盘。实现对校验冗余机制的RAID的降级写,响应主机的写数据指令,将目标数据对应的校验数据写入RAID组的其他磁盘中,使得在目标磁盘升级激活过程中RAID组持续响应主机之间的写数据指令。
在另一个可能的实现中,写日志包括目标数据的逻辑区块地址和目标数据的长度;基于写日志将目标数据重构至目标磁盘,包括:从第四磁盘中读取与目标数据具有校验关系的数据,从第五磁盘中读取目标数据对应的校验数据;基于与目标数据具有校验关系的数据和校验数据,确定目标数据;基于逻辑区块地址和目标数据的长度,将目标数据写入目标磁盘,完成目标数据的重构。针对校验冗余机制的RAID,在目标磁盘升级激活完成后,目标磁盘的目标数据的快速恢复。
第七方面,本申请实施例提供一种存储***,包括RAID控制器和若干RAID组,RAID组包括多个磁盘,RAID控制器可执行第一方面,和/或第二方面所述的方法,以实现在磁盘升级激活过程中对数据的读和/或写。
第八方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,当计算机程序在计算机中执行时,令计算机执行第一方面,和/或第二方面所述的方法。
第九方面,本申请提供了一种计算机程序或计算机程序产品,所述计算机程序或计算机程序产品包括指令,当所述指令被执行时,实现本申请第一方面和/或第二方面提供的方法。
附图说明
图1为本申请实施例提供的一种服务器的结构示意图;
图2为图1中的一种RAID卡的结构示意图;
图3为本申请实施例提供的一种磁盘的升级方法的流程图;
图4为本申请实施例提供的一种针对磁盘固件升级过程中的读数据的方法流程图;
图5为针对RAID1降级读的示意图;
图6为RAID1存储数据的示意图;
图7为非RIAD1的具有冗余功能的RAID的降级读的示意图;
图8为非RIAD1的具有冗余功能的RAID存储数据的示意图;
图9为本申请实施例提供的一种针对磁盘固件升级过程中的写数据的方法流程图;
图10为针对RAID1降级写的示意图;
图11为针对RAID在目标磁盘升级完成后的目标数据的重构示意图;
图12为非RIAD1的具有冗余功能的RAID的降级写的示意图;
图13为非RIAD1的具有冗余功能的RAID在目标磁盘升级完成后的目标数据的重构示意图;
图14为本申请实施例提供的一种针对磁盘固件升级过程中的读数据装置的结构示意图;
图15为本申请实施例提供的一种针对磁盘固件升级过程中的写数据装置的结构示意图。
具体实施方式
下面通过附图和实施例,对本申请的技术方案做进一步的详细描述。
为了便于理解本申请实施例提供的方案,先对本方案涉及到的部分术语做简单介绍。
RAID指用多个独立的磁盘组成在一起形成一个大的磁盘***,从而实现比单块磁盘更好的存储性能和更高的可靠性。RAID包括RAID0、RAID1、RAID3、RAID5、RAID6、RAID10、RAID50和RAID60等多种类型的冗余磁盘阵列。
RAID0将多块磁盘组合在一起形成一个大容量的存储。当我们要写数据的时候,会将数据分为N份,以独立的方式实现N块磁盘的读写,那么这N份数据会同时并发的写到磁盘中,因此执行性能非常的高。但是其不具有冗余功能,不提供数据校验或冗余备份,因此一旦某块磁盘损坏了,数据就直接丢失,无法恢复。
RAID1、RAID3、RAID5、RAID6、RAID10、RAID50和RAID60均具有冗余功能。其中,RAID1包括两个磁盘,一个为工作磁盘一个为镜像磁盘,在向磁盘中写数据的时候将同一份数据无差别的写如工作磁盘和镜像磁盘中。
RAID3将数据按照RAID0的形式,分成多份同时写入多块磁盘,但是还会另外再留出一块磁盘用于写校验数据(例如奇偶校验码)。例如总共有N块磁盘,那么就会让其中N-1块用来并发的写数据,第N块磁盘用于记录校验码数据。一旦某一块磁盘坏掉了,就可以利用其它的N-1块磁盘去恢复数据。
RAID5可以说是对RAID3进行了改进,RAID5模式中,不再需要用单独的磁盘写校验码了。它把校验码信息分布到各个磁盘上。例如,总共有N块磁盘,那么会将要写入的数据分成N份,并发的写入到N块磁盘中,同时还将数据的校验码信息也写入到这N块磁盘中(数据与对应的校验码信息必须得分开存储在不同的磁盘上)。一旦某一块磁盘损坏了,就可以用剩下的数据和对应的奇偶校验码信息去恢复损坏的数据。
RAID6在RAID5的基础上再次改进,引入了双重校验的概念,可以在有两块磁盘同时损坏的情况下,也能保障数据可恢复。RAID6除了每块磁盘上都有同级数据XOR校验区以外,还有针对每个数据块的XOR校验区,这样的话,相当于每个数据块有两个校验保护措施,因此数据的冗余性更高了。
RAID10可以理解为RAID1和RAID0的合体,兼具RAID1和RAID0的优点,基于RAID1模式将磁盘分为2份,当要写入数据的时候,将所有数据在两份磁盘上同时写入,相当于写了双份数据,起到了数据保障作用。且在每一份磁盘上又会基于RAID0技术将数据分为N份并发的读写,这样也保障了数据的效率。
RAID50和RAID60分别为在RAID5和RAID6的基础上进行改进的具有冗余功能的磁盘阵列。
图1为本申请实施例提供的一种服务器的结构示意图。如图1所示,该服务器包括主机、RAID卡、硬盘背板和多个磁盘(例如图1中的磁盘1、磁盘2和磁盘3)。其中,主机包括服务器的处理器(central processing unit,CPU)和操作***,操作***运行在处理器上,主机上可以运行各种软件,RAID卡用于提供RAID技术将多个磁盘融合为一个逻辑磁盘存储空间,多个磁盘插接在硬盘背板上,硬盘背板与RAID卡通信连接,RAID与主机通信连接,为主机提供存储空间。
上述磁盘可以是各种类型的磁盘,例如是固态硬盘(solid state drive,SSD),也可以是机械硬盘(hard disk drive,HDD),可以是各种接口协议,例如串行连接的小型计算机***接口(serial attached small computer system interface,SAS)、磁盘或串行高级技术附件(serial advance technology attachment,SATA)、逻辑设备接口规范(non-volatile memory express,NVME)等接口协议,也就是说,在本申请实施例中,对于磁盘具体为何种类型和采用何种接口协议不进行具体限定。
主机和RAID卡之间可以通过多种方式通信连接,例如外设部件互连标准(peripheral component interconnect,PCI)总线、快捷外设部件互连标准(peripheral component interconnect express,PCIe)总线等进行有线连接;RAID卡、硬盘背板和多个磁盘之间的连接可以是多种接口协议,例如串行连接的小型计算机***接口(serial attached small computer system interface,SAS)、磁盘或串行高级技术附件(serial advance technology attachment,SATA)、逻辑设备接口规范(non-volatile memory express,NVME)等接口协议,本申请实施例并不限定主机和RAID卡,RAID卡、硬盘背板和多个磁盘之间的连接方式,可以根据实际情况选择合适的通信连接方式。
主机上可以承载有上层业务,并且上层业务在运行过程中,可以通过主机与磁盘阵列之间的连接,读取磁盘阵列中存储的数据,或者向磁盘阵列中写入数据等。
在图1中,RAID卡用于实现RAID控制器的功能,在一些其他实施例中,服务器也可以不具有RAID卡,RAID控制器可以集成到主机的处理器中,实现对多个磁盘的管理。
下面以RAID控制器的实现为RAID卡为例,介绍本申请实施例提供的针对磁盘固件升级过程中的读写方案。
可以理解的是,图1示出的服务器的结构并不构成对服务器的结构的限定,服务器可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
例如,在一些服务器中,不包括RAID卡,RAID控制器集成设置在服务器的主机的处理器中,或者,服务器可以包括更多或更少的磁盘等。
图1示出的服务器可以为多种服务器,例如X86架构的服务器,具体可以是刀片服务器、高密服务器、机架服务器或高性能服务器等,换言之,本申请实施例对于服务器的具体类别不进行具体限定。
图2为图1中的一种RAID卡的结构示意图。
如图2所示,所述RAID卡200包括至少一个处理器201、内存202和通信接口203。其中,处理器201、内存202和通信接口203通信连接,可以通过有线(例如总线)的方式实现通信连接,也可以通过无线的方式实现通信连接。该通信接口203用于接收其他设备发送的数据(例如主机发送的IO指令);内存202存储有计算机指令,处理器201执行该计算机指令,实现本申请实施例提供的方法。此外,内存202中还可以存储日志,例如针对降级写的写日志等。
RAID卡200通过各种接口协议,例如SAS、SATA和NVME等接口协议连接多个磁盘,将多个磁盘组成在一起形成一个逻辑存储空间。
应理解,在本申请实施例中,该处理器201可以是中央处理单元CPU,该处理器201还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。
该内存202可以包括随机存取存储器,并向处理器201提供指令和数据。内存202还可以包括非易失性随机存取存储器。
该内存202可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data date SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
图3示出了本申请实施例提供的一种磁盘的升级方法,该升级方法可以应用于图1所示的服务器,由服务器中的RAID卡执行。可以理解的,磁盘也可称之为硬盘。该磁盘的升级方法包括:RAID卡接收硬盘固件在线激活命令,然后判断在线激活条件是否满足执行本申请实施例提供的不会阻塞RAID组和主机之间读写的在线激活流程,若不满足则采用普通激活流程(即现有的会阻塞RAID组和主机之间读写的激活流程),若满足则执行设置RAID组状态为“硬盘激活中”步骤。
判断“在线激活条件是否满足”的条件为RAID是否具有冗余功能,若是则满足,若否则不满足,例如,当RAID为RAID0,不具有冗余功能,则判断其不满足在线激活条件,执行普通激活流程,当RAID为RAID1、RAID3、RAID5、RAID6、RAID10、RAID50和RAID60中的任一种时,则判断满足在线激活条件,执行本申请实施例提供的激活流程。
在设置RAID组状态为“硬盘激活中”之后,RAID卡针对该RAID组中的目标硬盘(即需要升级激活的硬盘,例如出现固件bug的磁盘,需要对其固件进行升级以解决该bug问题)发送激活命令,目标硬盘激活成功后,RAID组使用写日志(log)进行激活后局部重构流程,以将目标数据写入目标硬盘中,RAID组中的目标硬盘目标数据重构完成后,RAID组取消激活状态,激活流程结束。
在一个示例中,RAID卡对目标硬盘发送激活命令包括,RAID卡判断RAID组中的具有冗余关系的多个硬盘是否都需要升级激活,若是,则为多个硬盘进行排序,RAID卡根据排序依次向多个硬盘发送升级命令,在一个硬盘固件升级完成后,再向下一个硬盘发送固件升级命令,实现多个硬盘根据排序依次进行升级激活,如此避免RAID组中具有冗余关系的硬盘同时处于固件升级激活中,无法实现降级读写;若RAID组中具有冗余关系的多个硬盘仅有部分硬盘(例如1个硬盘)需要升级激活,剩余部分硬盘可以实现目标数据的降级读写,则RAID卡可以向需要升级激活的硬盘同时发送固件升级激活命令,使之同时进行固件升级激活,也可以依次向需要升级激活的硬盘发送固件升级命令,使之依次进行固件升级激活。
图4为本申请实施例提供的一种针对磁盘固件升级过程中的读数据的方法流程图。该方法可以应用于图1中的RAID卡,本申请实施例提供的一种针对磁盘固件升级过程中的读数据的方法至少包括步骤S401至步骤S404。
在步骤S401中,接收读数据指令,读数据指令用于指示读取目标数据。
当主机上承载的上层业务需要读取磁盘上的数据时,主机的处理器向RAID卡发送读数据指令,该读数据指令用于指示读取目标数据。RAID卡接收该读数据指令,并执行该指令。
在一个示例中,读数据指令携带有目标数据的地址信息,例如,读数据指令携带目标数据的逻辑区块地址(logical block address,LBA)和长度,RAID卡在接收到读数据指令后,对该指令进行解析,得到指令中携带的LBA和长度信息,RAID卡通过该LBA和长度信息,计算得到目标数据所在的目标磁盘和在目标磁盘中的具***置。
在步骤S402中,确定目标数据对应的目标磁盘处于固件升级激活状态。
RAID卡通过LBA确定目标数据位于的目标磁盘后,检测目标磁盘是否处于固件升级激活状态。若目标磁盘处于固件升级激活状态,则执行后续步骤S403-S404;若目标磁盘未处于固件升级激活状态,则执行正常的读命令即可,即从目标磁盘中读取目标数据,并将目 标数据返回至主机。
在步骤S403中,通过降级读的方式读取第一数据。
当目标磁盘处于固件升级激活状态时,目标磁盘不能响应读命令,可以采用降级读的方式,从目标磁盘所在RAID组中与目标磁盘具有冗余关系的磁盘中读取与目标数据具有冗余关系的第一数据,根据第一数据确定目标数据。
RAID可以为镜像冗余机制的RAID,例如RAID1和RAID10,示例性的,参见图5,RAID为RAID1,多个磁盘包括磁盘1和磁盘2,磁盘1中存储的数据和磁盘2中存储的数据为镜像关系,当磁盘1为目标磁盘时,磁盘1处于固件升级状态,与磁盘1具有冗余关系的磁盘为磁盘2,RAID卡从磁盘2中读取目标数据的镜像数据D1,D1即可作为目标数据返回主机。
参见图6所示,RAID1中的磁盘1和磁盘2中的数据以条带的形式进行存储,同一数据分别在磁盘1和磁盘2中进行存储,且相同的数据位于同一条带上。例如,磁盘1中存储有多条数据D1、D2、D3、D4,磁盘2中存储的相同的数据位于同一条带上,如图4中,磁盘1中的数据D1和磁盘2中的数据D1位于条带1上,磁盘1中的数据D2和磁盘2中的数据D2位于条带2上,磁盘1中的数据D3和磁盘2中的数据D3位于条带3上,磁盘1中的数据D4和磁盘2中的数据D4位于条带4上。
因此,通过解析读数据指令,得到目标数据的LBA和长度,确定目标数据的位置为磁盘1的数据D1数据所在位置即条带1上,当磁盘1处于固件升级激活状态时,则采用降级读的方式从磁盘2的条带1上读取数据D1,并将数据D1返回给主机,完成读命令的执行。
在另一个示例中,RAID具有冗余校验机制的RAID,例如RAID3、RAID5、RAID6、RAID50和RAID60等,示例性的,RAID为RAID3,如图7所示,一个RAID组的多个磁盘至少包括磁盘1、磁盘2和校验盘;其中磁盘1和磁盘2中存储有业务数据,校验盘中存储有校验数据。
确定目标磁盘(例如磁盘2)处于固件升级激活状态时,进行降级读的方式分别从磁盘1中读取与目标数据具有校验关系的数据(例如数据D11)和校验盘中读取目标数据对应的校验数据(例如P1),数据D11和P1即为第一数据。
图8示出了RAID5的一个RAID组的数据存储结构。如图8中,将RAID组包括磁盘1、磁盘2和校验盘,将RAID组中的磁盘1、磁盘2和校验盘按照同等的LBA长度划分条带,每个磁盘取同一位置的条带单元组合在一起成为该RAID组的一个条带,例如图6中的条带1、条带2、条带3和条带4,将RAID组中校验盘的条带单元作为校验区,其他条带单元作为数据区,例如图8中的,条带1中的D11和D21所在存储区为数据区,条带1中的P1所在区域为校验区。将上层应用下发的数据存储在数据区,将一个条带中所有作为数据区的条带做异或(⊕)运算,运算得到数据作为该数据的校验数据记录在校验区中。将位于同一条带的数据区中的数据可以称之为具有校验关系的数据,例如条带1中的数据D11和数据D21即为具有校验关系的数据,校验区中的数据P1即为数据D11或D21的校验数据。
在步骤S404中,基于第一数据,确定目标数据。
针对镜像冗余机制的RAID,例如RAID1,由于RAID组的两个磁盘中的数据为镜像关系, 因此,第一数据即为目标数据,从RAID组中非目标磁盘的另一磁盘中读取目标数据的镜像数据,将该镜像数据直接返回给主机,完成读数据的执行。
针对冗余校验机制的RAID,例如RAID3、RAID5、RAID6、RAID50和RAID60等,基于RAID组中与目标磁盘为冗余关系中读取与目标磁盘具有校验关系的数据和校验数据,基于与目标数据具有校验关系的数据和校验数据,确定目标数据。
例如,图7中,与目标数据具有校验关系的数据为D11,目标数据的校验数据为P1,则根据校验公式D11⊕P1=D12,计算得到目标数据为D12,将D12作为目标数据返回至主机,完成读数据的执行。
需要解释说明的是,具有冗余关系的磁盘可以理解为RAID组的多个磁盘中,当其中一个磁盘中的数据损坏或丢失时,通过其他磁盘可以恢复该磁盘中的数据,该多个磁盘即为具有冗余关系的磁盘;例如图5中的磁盘1和磁盘2即为具有冗余关系的磁盘,图7中的磁盘1、磁盘2和校验盘为具有冗余关系的磁盘。
本申请实施例提供的一种针对磁盘固件升级过程中的读数据方法,通过降级读的方式,读取目标数据,即通过对多个磁盘中与目标磁盘具有冗余关系的磁盘中读取与目标数据具有冗余关系的数据,再基于与目标数据具有冗余关系的数据确定目标数据,实现了磁盘固件在升级激活过程中依然可以持续响应上层业务的读数据指令,避免了磁盘固件升级激活对上层业务的影响,提升用户使用体验。
本申请实施例还提供了一种针对磁盘固件升级过程中的写方法,在目标磁盘升级激活过程中,通过降级写的方式,响应主机的写数据指令,不阻塞RAID组与主机之间的IO,持续响应主机的写数据指令,同时在目标磁盘升级完成后,利用写日志将目标数据重构至目标磁盘,实现目标数据的快速恢复。
图9为本申请实施例提供的一种针对磁盘固件升级过程中的写数据的方法流程图。该方法可应用于图1所示的RAID卡,本申请实施例提供的一种针对磁盘固件升级过程中的写数据的方法至少包括步骤S901至步骤S905。
在步骤S901中,接收写数据指令,写数据指令用于指示写入目标数据。
当主机上承载的上层业务需要向磁盘中写入数据时,主机的处理器向RAID卡发送写数据指令,该写数据指令用于指示向目标磁盘的目标位置写入目标数据。RAID卡接收该写数据指令,并执行该指令。
在一个示例中,写数据指令携带有目标数据以及目标数据的写入地址信息,例如,写数据指令携带目标数据和目标数据的LBA和长度,RAID卡在接收到写数据指令后,对该指令进行解析,得到指令中携带的目标数据以及LBA和长度信息,RAID卡通过该LBA和长度信息,计算得到目标数据所要写入的目标磁盘以及目标磁盘中的具***置。
在步骤S902中,确定目标数据对应的目标磁盘处于固件升级激活状态。
RAID卡通过LBA确定目标数据位于的目标磁盘后,检测目标磁盘是否处于固件升级激活状态。若目标磁盘处于固件升级激活状态,则执行后续步骤S703-S705;若目标磁盘未处于固件升级激活状态,则执行正常的写命令即可,即将目标数据写入目标磁盘中的目标位置,即完成写命令的执行。
在步骤S903中,通过降级写的方式向多个磁盘中与目标数据具有冗余关系的磁盘中 写入第一数据。
当目标磁盘处于固件升级激活状态时,目标磁盘不能响应写命令,可以采用降级写的方式,在目标磁盘所在RAID组中与目标磁盘具有冗余关系的磁盘中写入与目标数据具有冗余关系的第一数据。
示例性的,针对镜像冗余机制的RAID,例如RAID1,RAID组包括磁盘1和磁盘2,磁盘1中存储的数据和磁盘2中存储的数据为镜像关系,当磁盘1为目标磁盘时,磁盘1处于固件升级状态,与磁盘1具有冗余关系的磁盘为磁盘2,将目标数据Dn(也即目标数据即为第一数据)写入磁盘2中,完成写命令执行(参见图8所示)。
通过解析写数据指令,得到目标数据和目标数据的LBA和长度,确定目标数据的写入位置为磁盘1上的条带1区域,当磁盘1处于固件升级激活状态时,则采用降级写的方式将目标数据写入磁盘2上的条带1区域,响应了上层业务的写数据指令。
在另一个示例中,RAID为具有冗余校验机制的RAID,例如RAID3、RAID5、RAID6、RAID50和RAID60等,示例性的,RAID为RAID3,如图10所示,一个RAID组至少包括磁盘1、磁盘2和校验盘;磁盘1、磁盘2和校验盘具有冗余关系,可以通过其他两个磁盘的数据求得另一个磁盘中的数据,其中磁盘1和磁盘2中存储有业务数据,校验盘中存储有校验数据。
确定目标磁盘(例如磁盘2)处于固件升级激活状态时,进行降级写的方式向RAID组中与目标磁盘具有冗余关系的磁盘中写入第一数据。
示例性的,如图12所示,通过解析写数据指令,确定目标数据Dn以及目标数据要写入的目标磁盘为磁盘2,从磁盘1中读取与目标数据Dn具有校验关系的数据D11,通过校验公式D11⊕Dn=P1,得到目标数据对应的校验数据P1,将目标数据的校验数据P1写入校验盘中,响应上层业务的写数据命令。
在步骤S904中,向RAID卡的内存中写入写日志。
参见图10和图12所示,无论是RAID1还是非RAID1的具有冗余功能的RAID,在降级写的过程中还包括向RAID卡的内存中写入降级写的写日志,例如,写日志至少包括写命令对应的LBA和长度信息,即目标数据要写入的LBA和目标数据的长度,根据该LBA和长度信息可确定目标数据要写入的目标磁盘以及目标磁盘中的具体写入位置。
在步骤S905中,当目标磁盘固件升级激活完成后,基于写日志将目标数据重构至目标磁盘。
示例性的,RAID为具有镜像冗余机制的RAID,例如RAID1,当目标磁盘即磁盘1固件升级激活完成后,执行数据重构,示例性的,参见图11,从磁盘2中读取目标数据Dn,例如,基于写日志中的LBA和长度信息确定目标信息对应的目标磁盘1中的目标位置为条带1对应的磁盘1中的存储区域,则从条带1对应的磁盘2中的存储区域中读取目标数据Dn,基于写日志中的LBA和长度信息确定目标数据Dn写入磁盘1中的目标位置,将目标数据Dn,写入磁盘1中的目标位置,完成磁盘1的目标数据的重构,实现在磁盘1固件升级激活完成后的数据的快速恢复,保证磁盘的分条一致和避免数据丢失。
RAID为具有冗余校验机制的RAID,例如RAID3、RAID5、RAID6、RAID50和RAID60等,当目标磁盘即磁盘2固件升级激活完成后,执行数据重构,示例性的,参见图13,RAID为RAID3,从磁盘1中读取与目标数据Dn具有校验关系的数据D11,从校验盘中读取目标 数据Dn的校验数据P1,(例如基于写日志中记录的目标数据Dn的LBA和目标数据Dn的长度信息,确定目标数据的写入位置为条带1对应的磁盘2中的存储区域,分别从条带1对应的磁盘1的存储区域读取数据D11,和从条带1对应的校验盘的存储区域读取数据P1),根据校验公式D11⊕P1=Dn,基于写日志中记录的目标数据Dn的LBA和目标数据Dn的长度信息,确定目标数据Dn写入磁盘2的目标位置,将目标数据Dn,写入磁盘1中的目标位置,完成磁盘1的目标数据的重构,实现在磁盘1固件升级激活完成后的数据的快速恢复,保证磁盘的分条一致和避免数据丢失。
可以理解的是,将目标数据重构至目标磁盘的含义为,将目标数据写入目标磁盘,以完成目标磁盘的目标数据的恢复。
与前述的针对磁盘固件升级过程中的读数据方法的实施例基于相同的构思,本申请实施例中还提供了一种针对磁盘固件升级过程中的读数据装置1200,该针对磁盘固件升级过程中的读数据装置1200包括用以实现图2-6所示的针对磁盘固件升级过程中的读数据方法中的各个步骤的单元或模块。
图14为本申请实施例提供的针对磁盘固件升级过程中的读数据装置的结构示意图。该装置应用于服务器的RAID控制器,例如可以是图1中的RAID卡,如图14所示,该针对磁盘固件升级过程中的读数据装置1400至少包括:
接收模块1401,用于接收读数据指令,读数据指令用于指示读取目标数据;
第一确定模块1402,用于确定目标数据对应的目标磁盘处于固件升级激活状态,目标磁盘为所述多个磁盘中的任一个;
降级读模块1403,用于通过降级读的方式读取第一数据,第一数据为多个磁盘中与目标磁盘具有冗余关系的磁盘中存储的与目标数据具有冗余关系的数据;
第二确定模块1404,用于基于第一数据,确定目标数据。
在另一个可能的实现中,多个磁盘包括第一磁盘和第二磁盘,第一磁盘存储的数据和第二磁盘存储的数据为镜像关系,其中,第一磁盘为目标磁盘;即RAID为具有镜像冗余机制的RAID,例如RAID1,降级读模块1403具体用于:从第二磁盘中读取目标数据的镜像数据。
在另一个可能的实现中,多个磁盘包括第三磁盘、第四磁盘和第五磁盘,其中,第三磁盘为目标磁盘;即RAID为具有冗余校验机制的RAID,例如RAID3、RAID5和RAID6等,降级读1403模块具体用于:从第四磁盘中读取与目标数据具有校验关系的数据,从第五磁盘中读取目标数据对应的校验数据。
在另一个可能的实现中,第二确定模块1404具体用于:基于与目标数据具有校验关系的数据和校验数据,确定目标数据。
根据本申请实施例的针对磁盘固件升级过程中的读数据装置1400可对应于执行本申请实施例中描述的方法,并且针对磁盘固件升级过程中的读数据装置1400中的各个模块的上述和其它操作和/或功能分别为了实现图4-8中的各个方法的相应流程,为了简洁,在此不再赘述。
与前述的针对磁盘固件升级过程中的写数据方法的实施例基于相同的构思,本申请实施例中还提供了一种针对磁盘固件升级过程中的写数据装置1500,该针对磁盘固件升级过 程中的写数据装置1500包括用以实现图9-13所示的针对磁盘固件升级过程中的写数据方法中的各个步骤的单元或模块。
图15为本申请实施例提供的针对磁盘固件升级过程中的写数据装置的结构示意图。该装置应用于服务器的RAID控制器,例如可以是图1中的RAID卡,如图15所示,该针对磁盘固件升级过程中的写数据装置1500至少包括:
接收模块1501,用于接收写数据指令,写数据指令用于指示写入目标数据;
确定模块1502,用于确定目标数据对应的目标磁盘处于固件升级激活状态,目标磁盘为多个磁盘中的任一个;
降级写模块1503,用于通过降级写的方式向多个磁盘中与目标磁盘具有冗余关系的磁盘中写入第一数据,第一数据与目标数据具有冗余关系;
写日志模块1504,用于向RAID控制器对应的内存中写入写日志,写日志用于对目标数据进行重构;
重构模块1505,用于当目标磁盘固件升级激活完成后,基于写日志将目标数据重构至目标磁盘。
在一个可能的实现中,多个磁盘包括第一磁盘和第二磁盘,第一磁盘存储的数据和第二磁盘存储的数据为镜像关系,其中,第一磁盘为目标磁盘;换言之,RAID为RAID1,针对RAID1,降级写模1503具体用于:向第二磁盘中写入目标数据。
在另一个可能的实现中,写日志包括目标数据的逻辑区块地址和目标数据的长度;重构模块1505具体用于:从第二磁盘中读取目标数据;基于逻辑区块地址和目标数据的长度,将目标数据写入目标磁盘。
在另一个可能的实现中,多个磁盘包括第三磁盘、第四磁盘和第五磁盘,其中,第三磁盘为目标磁盘;降级写模块1503具体用于:从第四磁盘中读取与目标数据具有校验关系的数据;基于目标数据和与目标数据具有校验关系的数据,确定目标数据对应的校验数据;将校验数据写入第五磁盘。
在另一个可能的实现中,写日志包括目标数据的逻辑区块地址和目标数据的长度;重构模块具体1505用于:从第四磁盘中读取与目标数据具有校验关系的数据,从第五磁盘中读取目标数据对应的校验数据;基于与目标数据具有校验关系的数据和校验数据,确定目标数据;基于逻辑区块地址和目标数据的长度,将目标数据写入目标磁盘。
根据本申请实施例的针对磁盘固件升级过程中的写数据装置1500可对应于执行本申请实施例中描述的方法,并且针对磁盘固件升级过程中的写数据装置1500中的各个模块的上述和其它操作和/或功能分别为了实现图9-13中的各个方法的相应流程,为了简洁,在此不再赘述。
本申请的实施例提供了一种计算机可读存储介质,其上存储有计算机程序,当所述计算机指令在被处理器执行时,使得上文提及的方法被实现。
本申请的实施例提供了一种芯片,该芯片包括至少一个处理器和接口,所述至少一个处理器通过所述接口确定程序指令或者数据;该至少一个处理器用于执行所述程序指令,以实现上文提及的方法。
本申请的实施例提供了一种计算机程序或计算机程序产品,该计算机程序或计算机程 序产品包括指令,当该指令执行时,令计算机执行上文提及的方法。
本领域普通技术人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执轨道,取决于技术方案的特定应用和设计约束条件。本领域普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执轨道的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
以上所述的具体实施方式,对本申请的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本申请的具体实施方式而已,并不用于限定本申请的保护范围,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (17)

  1. 一种针对磁盘固件升级过程中的读数据方法,其特征在于,应用于冗余磁盘阵列RAID控制器,所述冗余磁盘阵列还包括若干RAID组,所述RAID组包括多个磁盘,所述冗余磁盘阵列具有冗余功能,所述方法包括:
    接收读数据指令,所述读数据指令用于指示读取目标数据;
    确定所述目标数据对应的目标磁盘处于固件升级激活状态,所述目标磁盘为所述多个磁盘中的任一个;
    从所述多个磁盘中与所述目标磁盘具有冗余关系的磁盘中读取第一数据,所述第一数据与所述目标数据具有冗余关系;
    基于所述第一数据,确定目标数据。
  2. 根据权利要求1所述的方法,其特征在于,所述多个磁盘包括第一磁盘和第二磁盘,所述第一磁盘存储的数据和第二磁盘存储的数据为镜像关系,其中,所述第一磁盘为目标磁盘;
    所述从所述多个磁盘中与所述目标磁盘具有冗余关系的磁盘中读取第一数据,包括:
    从所述第二磁盘中读取所述目标数据的镜像数据。
  3. 根据权利要求1所述的方法,其特征在于,所述多个磁盘至少包括第三磁盘、第四磁盘和第五磁盘,其中,所述第三磁盘为目标磁盘;
    所述从所述多个磁盘中与所述目标磁盘具有冗余关系的磁盘中读取第一数据,包括:
    从所述第四磁盘中读取与所述目标数据具有校验关系的数据,从所述第五磁盘中读取所述目标数据对应的校验数据。
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述第一数据,确定目标数据,包括:
    基于与所述目标数据具有校验关系的数据和所述校验数据,确定所述目标数据。
  5. 一种针对磁盘固件升级过程中的写数据方法,其特征在于,应用于冗余磁盘阵列的RAID控制器,所述冗余磁盘阵列包括若干RAID组,所述RAID组包括多个磁盘,所述冗余磁盘阵列具有冗余功能,所述方法包括:
    接收写数据指令,所述写数据指令用于指示写入目标数据;
    确定所述目标数据对应的目标磁盘处于固件升级激活状态,所述目标磁盘为所述多个磁盘中的任一个;
    向所述多个磁盘中与所述目标磁盘具有冗余关系的磁盘中写入第一数据,所述第一数据与所述目标数据具有冗余关系;
    向所述RAID控制器对应的内存中写入写日志,所述写日志用于对所述目标数据进行重构;
    当所述目标磁盘固件升级激活完成后,基于所述写日志将所述目标数据重构至所述目标磁盘。
  6. 根据权利要求5所述的方法,其特征在于,所述多个磁盘包括第一磁盘和第二磁盘,所述第一磁盘存储的数据和第二磁盘存储的数据为镜像关系,其中,所述第一磁盘为目标磁盘;
    所述向所述多个磁盘中与所述目标磁盘具有冗余关系的磁盘中写入第一数据,包括:
    向所述第二磁盘中写入所述目标数据。
  7. 根据权利要求6所述的方法,其特征在于,所述写日志包括所述目标数据的逻辑区块地址和所述目标数据的长度;
    所述基于所述写日志将所述目标数据重构至所述目标磁盘,包括:
    从所述第二磁盘中读取所述目标数据;
    基于所述逻辑区块地址和所述目标数据的长度,将所述目标数据写入所述目标磁盘。
  8. 根据权利要求5所述的方法,其特征在于,所述多个磁盘包括第三磁盘、第四磁盘和第五磁盘,其中,所述第三磁盘为目标磁盘;
    所述向所述多个磁盘中与所述目标磁盘具有冗余关系的磁盘中写入第一数据,包括:
    从所述第四磁盘中读取与所述目标数据具有校验关系的数据;
    基于所述目标数据和与所述目标数据具有校验关系的数据,确定所述目标数据对应的校验数据;
    将所述校验数据写入所述第五磁盘。
  9. 根据权利要求8所述的方法,其特征在于,所述写日志包括所述目标数据的逻辑区块地址和所述目标数据的长度;
    所述基于所述写日志将所述目标数据重构至所述目标磁盘,包括:
    从所述第四磁盘中读取与所述目标数据具有校验关系的数据,从所述第五磁盘中读取所述目标数据对应的校验数据;
    基于所述与所述目标数据具有校验关系的数据和所述校验数据,确定所述目标数据;
    基于所述逻辑区块地址和所述目标数据的长度,将所述目标数据写入所述目标磁盘。
  10. 一种计算设备,其特征在于,包括处理器、RAID控制器、多个磁盘,所述处理器和所述RAID控制器通信连接,所述RAID控制器与多个磁盘通信连接;
    所述RAID控制器用于:
    接收指示读取目标数据的命令之后,确定所述目标数据对应的目标磁盘处于固件升级激活状态,所述目标磁盘为所述多个磁盘中的任一个;
    从所述多个磁盘与所述目标磁盘具有冗余关系的磁盘中读取第一数据,所述第一数据与所述目标数据具有冗余关系;
    基于所述第一数据,确定目标数据。
  11. 根据权利要求10所述的计算设备,其特征在于,所述RAID控制器为RAID卡,或者所述RAID控制器集成在所述处理器中。
  12. 根据权利要求10或11所述的计算设备,其特征在于,所述多个磁盘至少包括第三磁盘、第四磁盘和第五磁盘,其中,所述第三磁盘为目标磁盘;
    所述从所述多个磁盘中与所述目标磁盘具有冗余关系的磁盘中读取第一数据,包括:
    从所述第四磁盘中读取与所述目标数据具有校验关系的数据,从所述第五磁盘中读取所述目标数据对应的校验数据。
  13. 根据权利要求12所述的计算设备,其特征在于,所述基于所述第一数据,确定目标数据,包括:
    基于与所述目标数据具有校验关系的数据和所述校验数据,确定所述目标数据。
  14. 一种计算设备,其特征在于,包括处理器、RAID控制器、多个磁盘,所述处理器和所述RAID控制器通信连接,所述RAID控制器与多个磁盘通信连接;
    所述RAID控制器用于:
    接收写数据指令,所述写数据指令用于指示写入目标数据;
    确定所述目标数据对应的目标磁盘处于固件升级激活状态,所述目标磁盘为所述多个磁盘中的任一个;
    向所述多个磁盘中与所述目标磁盘具有冗余关系的磁盘中写入第一数据,所述第一数据与所述目标数据具有冗余关系;
    向所述RAID控制器对应的内存中写入写日志,所述写日志用于对所述目标数据进行重构;
    当所述目标磁盘固件升级激活完成后,基于所述写日志将所述目标数据重构至所述目标磁盘。
  15. 根据权利要求14所述的计算设备,其特征在于,所述RAID控制器为RAID卡,或者所述RAID控制器集成在所述处理器中。
  16. 根据权利要求14或15所述的计算设备,其特征在于,所述多个磁盘包括第三磁盘、第四磁盘和第五磁盘,其中,所述第三磁盘为目标磁盘;
    所述向所述多个磁盘中与所述目标磁盘具有冗余关系的磁盘中写入第一数据,包括:
    从所述第四磁盘中读取与所述目标数据具有校验关系的数据;
    基于所述目标数据和与所述目标数据具有校验关系的数据,确定所述目标数据对应的校验数据;
    将所述校验数据写入所述第五磁盘。
  17. 根据权利要求16所述的计算设备,其特征在于,所述写日志包括所述目标数据的逻辑区块地址和所述目标数据的长度;
    所述基于所述写日志将所述目标数据重构至所述目标磁盘,包括:
    从所述第四磁盘中读取与所述目标数据具有校验关系的数据,从所述第五磁盘中读取所述目标数据对应的校验数据;
    基于所述与所述目标数据具有校验关系的数据和所述校验数据,确定所述目标数据;
    基于所述逻辑区块地址和所述目标数据的长度,将所述目标数据写入所述目标磁盘。
PCT/CN2023/097834 2022-08-15 2023-06-01 一种针对磁盘固件升级过程中的读写数据方法及计算设备 WO2024037122A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210974796.5A CN115344205A (zh) 2022-08-15 2022-08-15 一种针对磁盘固件升级过程中的读写数据方法及计算设备
CN202210974796.5 2022-08-15

Publications (1)

Publication Number Publication Date
WO2024037122A1 true WO2024037122A1 (zh) 2024-02-22

Family

ID=83952725

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/097834 WO2024037122A1 (zh) 2022-08-15 2023-06-01 一种针对磁盘固件升级过程中的读写数据方法及计算设备

Country Status (2)

Country Link
CN (1) CN115344205A (zh)
WO (1) WO2024037122A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115344205A (zh) * 2022-08-15 2022-11-15 超聚变数字技术有限公司 一种针对磁盘固件升级过程中的读写数据方法及计算设备
CN116185311B (zh) * 2023-04-27 2023-08-08 苏州浪潮智能科技有限公司 独立磁盘冗余阵列的升级迁移方法、降级迁移方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070260775A1 (en) * 2006-03-31 2007-11-08 Fujitsu Limited Storage device, storage control firmware activation program exchange method, and program product for activating and exchanging storage control program
US20090077547A1 (en) * 2007-09-19 2009-03-19 Kakinoki Masaya Disk array apparatus
CN108984107A (zh) * 2017-06-02 2018-12-11 伊姆西Ip控股有限责任公司 提高存储***的可用性
CN109582337A (zh) * 2018-12-04 2019-04-05 浪潮电子信息产业股份有限公司 一种固件升级的方法、装置和计算机可读存储介质
CN114579163A (zh) * 2020-11-30 2022-06-03 超聚变数字技术有限公司 一种磁盘固件升级方法、计算装置及***
CN115344205A (zh) * 2022-08-15 2022-11-15 超聚变数字技术有限公司 一种针对磁盘固件升级过程中的读写数据方法及计算设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101923441B (zh) * 2009-06-17 2012-08-22 成都市华为赛门铁克科技有限公司 混合磁盘冗余阵列的写请求处理方法、控制器和存储***
CN103513942B (zh) * 2013-10-21 2016-06-29 华为技术有限公司 独立冗余磁盘阵列的重构方法及装置
CN105718207A (zh) * 2014-12-03 2016-06-29 华为技术有限公司 一种数据处理方法、数据读写装置和存储***
CN112181298B (zh) * 2020-09-25 2022-05-17 杭州宏杉科技股份有限公司 阵列访问方法、装置、存储设备及机器可读存储介质
CN113434182A (zh) * 2021-06-29 2021-09-24 深圳忆联信息***有限公司 固态硬盘固件升级立即生效的实现方法、装置及计算机设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070260775A1 (en) * 2006-03-31 2007-11-08 Fujitsu Limited Storage device, storage control firmware activation program exchange method, and program product for activating and exchanging storage control program
US20090077547A1 (en) * 2007-09-19 2009-03-19 Kakinoki Masaya Disk array apparatus
CN108984107A (zh) * 2017-06-02 2018-12-11 伊姆西Ip控股有限责任公司 提高存储***的可用性
CN109582337A (zh) * 2018-12-04 2019-04-05 浪潮电子信息产业股份有限公司 一种固件升级的方法、装置和计算机可读存储介质
CN114579163A (zh) * 2020-11-30 2022-06-03 超聚变数字技术有限公司 一种磁盘固件升级方法、计算装置及***
CN115344205A (zh) * 2022-08-15 2022-11-15 超聚变数字技术有限公司 一种针对磁盘固件升级过程中的读写数据方法及计算设备

Also Published As

Publication number Publication date
CN115344205A (zh) 2022-11-15

Similar Documents

Publication Publication Date Title
US10459814B2 (en) Drive extent based end of life detection and proactive copying in a mapped RAID (redundant array of independent disks) data storage system
WO2024037122A1 (zh) 一种针对磁盘固件升级过程中的读写数据方法及计算设备
US8065558B2 (en) Data volume rebuilder and methods for arranging data volumes for improved RAID reconstruction performance
US7062704B2 (en) Storage array employing scrubbing operations using multiple levels of checksums
US7017107B2 (en) Storage array employing scrubbing operations at the disk-controller level
US6981171B2 (en) Data storage array employing block verification information to invoke initialization procedures
US8839028B1 (en) Managing data availability in storage systems
TWI450087B (zh) 複數個磁碟陣列系統之資料儲存方法及資料儲存系統
CN104035830B (zh) 一种数据恢复方法和装置
JP2912802B2 (ja) ディスクアレイ装置の故障対処方法および装置
US7890795B1 (en) Auto-adapting cache memory system and memory
US20110264949A1 (en) Disk array
US20140215147A1 (en) Raid storage rebuild processing
US20070088990A1 (en) System and method for reduction of rebuild time in raid systems through implementation of striped hot spare drives
US20090113235A1 (en) Raid with redundant parity
US20060236029A1 (en) Power-safe disk storage apparatus, systems, and methods
US20090271659A1 (en) Raid rebuild using file system and block list
US20060236149A1 (en) System and method for rebuilding a storage disk
KR20090129416A (ko) 메모리 관리 시스템 및 방법
US9223658B2 (en) Managing errors in a raid
US20130198585A1 (en) Method of, and apparatus for, improved data integrity
US10802958B2 (en) Storage device, its controlling method, and storage system having the storage device
US20080162826A1 (en) Storage system and data guarantee method
US20170371782A1 (en) Virtual storage
US20100138603A1 (en) System and method for preventing data corruption after power failure

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23854028

Country of ref document: EP

Kind code of ref document: A1