WO2023056728A1 - Method and apparatus for reconstructing redundant arrays of independent drives, and device and medium - Google Patents

Method and apparatus for reconstructing redundant arrays of independent drives, and device and medium Download PDF

Info

Publication number
WO2023056728A1
WO2023056728A1 PCT/CN2022/078100 CN2022078100W WO2023056728A1 WO 2023056728 A1 WO2023056728 A1 WO 2023056728A1 CN 2022078100 W CN2022078100 W CN 2022078100W WO 2023056728 A1 WO2023056728 A1 WO 2023056728A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
target object
record
disk array
bitmap
Prior art date
Application number
PCT/CN2022/078100
Other languages
French (fr)
Chinese (zh)
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 WO2023056728A1 publication Critical patent/WO2023056728A1/en

Links

Images

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/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/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • 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/0688Non-volatile semiconductor memory arrays

Definitions

  • the present application relates to the field of storage technologies, and in particular to a disk array reconfiguration method, device, equipment and medium.
  • RAID Redundant Arrays of Independent Drives
  • the embodiment of the present application discloses a method for reconfiguring a disk array, including:
  • the data block allocation record object When it is detected that the disk array meets the reconstruction conditions, it is judged according to the data block allocation record object whether the data blocks in any target object are not allocated to the corresponding LUN; wherein, the above-mentioned target object is the basic unit of the disk array reconstruction, including one or more strips;
  • it also includes:
  • the above-mentioned allocation record element corresponding to the target object is incremented by 1;
  • the above-mentioned judging whether the data blocks in any target object are not allocated to the corresponding LUN according to the data block allocation record object includes:
  • it also includes:
  • each bit in the above-mentioned data writing record bitmap represents a The data writing status of the above-mentioned target objects
  • the bit position corresponding to the target object with data written in the data write record bitmap is set to 1.
  • the above-mentioned judging whether there is data writing in the above-mentioned target object according to the data writing record bitmap includes:
  • it also includes:
  • each bit in the above-mentioned data deletion record bitmap represents a data deletion situation of the above-mentioned target object
  • the LUN deletes data
  • the corresponding bit position of the target object in the above-mentioned data deletion record bitmap is set to 0;
  • the above-mentioned judging whether all the data in the above-mentioned target object has been deleted according to the data deletion record bitmap includes:
  • An OR operation is performed on the data writing record bitmap and the data deletion record bitmap to obtain an updated data deletion record bitmap.
  • the embodiment of the present application discloses a device for reconfiguring a disk array, including:
  • the disk array monitoring module is used to monitor whether the disk array meets the reconstruction condition
  • Allocation record judging module used for when the above-mentioned disk array monitoring module detects that the disk array satisfies the reconstruction condition, then judge whether the data blocks in any target object are not allocated to the corresponding LUN according to the data block allocation record object; wherein, the above-mentioned The target object is the basic unit of disk array reconstruction, including one or more stripes; if none of them are allocated to the corresponding LUN, the above target object is ignored;
  • the deletion record judging module is triggered to judge whether the data in the above-mentioned target object is completely deleted according to the data deletion record bitmap; if the data in the above-mentioned target object is all deleted, then the above-mentioned target object is ignored;
  • the write record judging module is triggered to judge whether there is data writing in the above-mentioned target object according to the data write-in record bitmap, and if not, then ignore the above-mentioned target object;
  • the embodiment of the present application discloses an electronic device, the electronic device includes a memory and one or more processors, and computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, a or multiple processors execute the steps of the disk array reconfiguration method provided in any one of the above embodiments.
  • the present application discloses one or more non-volatile storage media storing computer-readable instructions.
  • the computer-readable instructions When executed by one or more processors, one or more processors can perform any of the above-mentioned operations. Steps of a method for reconfiguring a disk array provided by an embodiment.
  • FIG. 1 shows an application scenario diagram of a method for reconfiguring a disk array provided by one or more embodiments of the present application
  • FIG. 2 is a flowchart of a method for reconfiguring a disk array disclosed in one or more embodiments of the present application
  • FIG. 3 is a schematic diagram of a specific storage hierarchy relationship provided by one or more embodiments of the present application.
  • FIG. 4 is a schematic diagram of the relationship between a specific target object and a band provided by one or more embodiments of the present application;
  • FIG. 5 is a specific target object reconstruction flowchart disclosed in one or more embodiments of the present application.
  • FIG. 6 is a schematic structural diagram of a disk array reconfiguration device disclosed in one or more embodiments of the present application.
  • Fig. 7 is a structural diagram of an electronic device disclosed by one or more embodiments of the present application.
  • RAID may need to be reconstructed due to hard disk failures and bad blocks.
  • During the reconstruction process if a bad disk or bad block occurs again, it is very likely to cause catastrophic consequences such as RAID unavailability and data loss. Therefore, RAID reconstruction time is an important indicator of storage reliability, and how to shorten the RAID reconstruction time is an urgent problem to be solved. Therefore, the present application provides a disk array reconfiguration solution, which can shorten the reconfiguration time of the disk array, thereby improving storage reliability.
  • the disk array reconfiguration method provided in this application can be applied to a computer device.
  • the computer device can be a server, and its internal structure can be shown in FIG. 1 .
  • the computer device includes a processor, memory, network interface and database connected by a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions and a database.
  • the internal memory provides an environment for the execution of the operating system and computer readable instructions in the non-volatile storage medium.
  • the database of the computer device is used to store data such as data block allocation record objects.
  • the network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer readable instructions are executed by the processor, the method for reconfiguring the disk array is implemented.
  • the server may be implemented by an independent server or a server cluster composed of multiple servers.
  • the embodiment of the present application discloses a method for reconfiguring a disk array, which is described by taking the method applied to the electronic device in Figure 1 as an example, including:
  • Step S11 When it is detected that the disk array satisfies the reconstruction condition, then judge whether the data blocks in any target object are not allocated to the corresponding LUN according to the data block allocation record object (that is, the Logical Unit Number refers to the logical unit number); wherein, The above target object is the basic unit of disk array reconstruction, including one or more stripes.
  • monitor the disk array and in response to detecting that the disk array meets the reconstruction condition, judge whether the data blocks in any target object are not allocated to the corresponding LUN according to the data block allocation record object.
  • the above-mentioned data block allocation record object is created, and the allocation record element corresponding to each of the above-mentioned target objects in the above-mentioned data block allocation record object is initialized to 0;
  • the above-mentioned allocation record element corresponding to the target object will be incremented by 1; in response to the acquired data block release request of the LUN, each For a data block of any one of the above target objects corresponding to the above LUN, the above-mentioned allocation record element corresponding to the target object is subtracted by 1; when the above-mentioned disk array is deleted, the above-mentioned data block allocation record object is deleted.
  • each target object has a corresponding allocation record element in the above-mentioned data block allocation record object.
  • the LUN when creating or expanding a LUN, the LUN will apply for a data block from the RAID, and after each data block is allocated to the LUN, the data block allocation record object is updated, and 1 is added to the corresponding allocation record element.
  • the LUN releases data blocks to the RAID.
  • the data block allocation record object is updated, and the corresponding allocation record element is decremented by 1. In this way, the data block allocation recording object can record the number of allocated data blocks in the target object.
  • the above-mentioned determination according to the data block allocation record object whether the data blocks in any target object are not allocated to the corresponding LUN includes: determining whether the above-mentioned allocation record element corresponding to any target object in the data block allocation record object is 0 ; If so, it is determined that none of the data blocks in the target object are allocated to the corresponding LUN; otherwise, it is determined that there is a data block in the target object allocated to the corresponding LUN.
  • the above-mentioned allocation record element corresponding to any target object in the data block allocation record object is 0, and in response to the above-mentioned allocation record element corresponding to any target object in the data block allocation record object being 0, it is determined that the target None of the data blocks in the object are allocated to the corresponding LUN; in response to the fact that the above-mentioned allocation record element corresponding to any target object in the data block allocation record object is not 0, it is determined that there is a data block in the target object allocated to the corresponding LUN .
  • Step S12 If none of them are allocated to the corresponding LUN, then ignore the above target object; otherwise, judge whether all the data in the above target object has been deleted according to the data deletion record bitmap.
  • the above-mentioned data deletion record bitmap can be created, and all bits in the above-mentioned data deletion record bitmap can be initialized to 1; wherein, each bit in the above-mentioned data deletion record bitmap represents one of the above-mentioned targets The data deletion status of the object; when the LUN deletes data, if all the data in any of the above target objects is deleted, the corresponding bit position of the target object in the above data deletion record bitmap is set to 0;
  • the above-mentioned judging whether the data in the above-mentioned target object is completely deleted according to the data deletion record bitmap includes: judging whether the corresponding bit of the above-mentioned target object in the above-mentioned data deletion record bitmap is 0; All data in the object is deleted.
  • Step S13 If all the data in the above target object is deleted, then ignore the above target object; otherwise, judge whether there is data writing in the above target object according to the data writing record bitmap.
  • each bit in the above-mentioned data writing record bitmap represents a The data writing status of the above-mentioned target object; when data is written into the LUN, the corresponding bit position of the above-mentioned target object with data written in the above-mentioned data writing record bitmap is 1.
  • the above-mentioned judging whether there is data writing in the above-mentioned target object according to the data writing record bitmap includes: judging whether the bit corresponding to the above-mentioned target object in the above-mentioned data writing record bitmap is 1; There is data written in the object; otherwise, it is judged that there is no data written in the above target object.
  • the RAID calculates the target object corresponding to the written data, and then sets the corresponding bit position of the target object in the data writing record bitmap to 1.
  • the data writing record bitmap is used to record whether there is data writing in the corresponding target object.
  • the embodiment of the present application when data is written into the LUN, after the bit position corresponding to the target object with data written in the data write record bitmap is set to 1, the embodiment of the present application also writes the data into the record bitmap And performing an OR operation on the above data deletion record bitmap to obtain an updated data deletion record bitmap. That is, the OR operation result is assigned to the data deletion record bitmap.
  • Step S14 If there is data written in the above target object, reconstruct the above target object, otherwise ignore the above target object.
  • the above-mentioned target object may be reconstructed by using a preset reconstruction algorithm, wherein the adopted reconstruction algorithm may refer to the prior art, which will not be repeated here.
  • the above-mentioned target object is the disk array reconstruction
  • the basic unit of the structure including one or more stripes; if none of them are allocated to the corresponding LUN, ignore the above target object, otherwise judge whether all the data in the above target object has been deleted according to the data deletion record bitmap; if the above target If all the data in the object is deleted, the above target object will be ignored, otherwise, it will be judged whether there is data written in the above target object according to the data writing record bitmap; if there is data written in the above target object, then the above target object will be reconstructed, Otherwise ignore the above target object.
  • this application screens out the target objects that need to be reconstructed through the data block allocation record object, data deletion record bitmap, and data writing record bitmap, and performs reconstruction, thus greatly reducing the amount of reconstructed data , which can shorten the reconstruction time of the disk array, thereby improving the reliability of storage.
  • the embodiment of the present application provides a specific storage hierarchy relationship, one or more Drives (that is, hard disks) form a RAID, and the RAID is divided into multiple Extent (that is, the aforementioned data block).
  • the extent will be selected from one or more RAIDs in the Pool.
  • FIG. 4 the embodiment of the present application provides a schematic diagram of the relationship between a specific target object and a stripe, a RAID composed of 6 disks, and the RAID space is divided into multiple strips (ie, stripes).
  • Pack that is, the aforementioned target object
  • Fig. 4 gives examples of target object 0 and target object 1, and the target objects include multiple stripes such as stripe 0 and stripe 1.
  • the embodiment of this application records the usage of the Pack in real time. It is unused at the beginning, and the relevant Pack objects are updated when creating LUNs, deleting LUNs, expanding/shrinking LUNs, migrating LUNs, writing data, and deleting data.
  • the reconstruction condition is triggered (bad blocks, bad disks, etc.)
  • analyze these Pack objects to find out the Pack that really needs to be reconstructed, and then perform reconstruction. This can greatly reduce the amount of data to be reconstructed, thereby shortening the reconstruction time and improving the reliability of the storage system.
  • Drive includes mechanical hard disk and solid-state hard disk; RAID is composed of many independent disks, which are combined into a large-capacity disk group, and the bonus effect generated by using individual disks to provide data improves the performance of the entire disk system; in storage devices, LUN It is the concept of volume; multiple RAIDs can be added to a Pool, and multiple LUNs can also be created. Extent is an attribute of Pool. Pool divides the RAID contained in it into data blocks according to the extent size, which is also the smallest data unit of LUN. LUN expansion/reduction: adding capacity to a LUN is capacity expansion, and reducing the capacity of a LUN is capacity reduction.
  • RAID divides data into strips (stripes), a strip spans all data disks, and stores a part of the strip on each disk, called sagment, also known as strip depth. The number of sectors or blocks contained in a stripe is called the stripe length.
  • a Pack contains one or more Strips, which is the basic unit of RAID reconstruction.
  • pack_alloc_info is equal to the number of extents it spans. If the extent is released, such as LUN deletion or LUN shrinkage, the corresponding element of pack_alloc_info will be reduced by one. Further, create a data deletion record bitmap and record it as pack_delete_bitmap, which is used to record the deletion of pack data on the LUN. The default is all 1, and it will be set to 0 only when all data of the pack is deleted.
  • the LUN will release the extent to the RAID, and when each extent is released, the corresponding pack_alloc_info will be updated, and the alloc_info will be reduced by one.
  • the RAID module will calculate the pack, and then set the corresponding bit of pack_written_bitmap to 1.
  • Update pack_delete_bitmap pack_written_bitmap
  • LUN deletes data, updates pack_delete_bitmap, and only sets it to 0 when all data in the pack is deleted.
  • FIG. 5 is a specific target object reconstruction flow chart disclosed in the embodiment of the present application.
  • Check the pack_alloc_info first if the alloc_info corresponding to the pack is 0, it means it is not used by any LUN, and there is no need to refactor. Otherwise, check pack_delete_bitmap. If the corresponding bit of the pack area in pack_delete_bitmap is 0, it means that all user data in it has been deleted, and there is no need to refactor. Otherwise, check pack_written_bitmap.
  • the embodiment of the present application records/updates the usage status of the PACK objects in the RAID in real time, and according to the status of multiple Pack usage-related objects, minimizes the amount of data to be reconstructed, thereby shortening the RAID reconstruction time and improving the overall performance of the storage system. reliability.
  • a disk array reconfiguration device including:
  • the disk array monitoring module 11 is used to monitor whether the disk array meets the reconstruction condition
  • Allocation record judging module 12 used for when the above-mentioned disk array monitoring module 11 monitors that the disk array satisfies the reconstruction condition, then judge whether the data blocks in any target object are not assigned to the corresponding LUN according to the data block allocation record object; , the above target object is the basic unit of disk array reconstruction, including one or more stripes; if none of them are allocated to the corresponding LUN, the above target object is ignored;
  • trigger deletion record judgment module 13 judge whether the data in the above-mentioned target object is all deleted according to the data deletion record bitmap; If the data in the above-mentioned target object is all deleted, then ignore the above-mentioned target object;
  • the above-mentioned target object is the disk array reconstruction
  • the basic unit of the structure including one or more stripes; if none of them are allocated to the corresponding LUN, ignore the above target object, otherwise judge whether all the data in the above target object has been deleted according to the data deletion record bitmap; if the above target If all the data in the object is deleted, ignore the above target object; otherwise, judge whether there is data written in the above target object according to the data writing record bitmap; if there is data written in the above target object, then reconstruct the above target object, Otherwise ignore the above target object.
  • this application screens out the target objects that need to be reconstructed through the data block allocation record object, data deletion record bitmap, and data writing record bitmap, and performs reconstruction, thus greatly reducing the amount of reconstructed data , which can shorten the reconstruction time of the disk array, thereby improving the reliability of storage.
  • the shown device also includes:
  • the data block allocation record object creation module is used to create the above-mentioned data block allocation record object when creating the above-mentioned disk array, and initialize the allocation record element corresponding to each of the above-mentioned target objects in the above-mentioned data block allocation record object to 0;
  • the data block allocation record object recording module is used to add 1 to the allocation record element corresponding to the target object when a data block in any of the above target objects is allocated to the above LUN when the data block application of the LUN is obtained. Operation: when the data block release request of the LUN is obtained, each time a data block of any of the above-mentioned target objects corresponding to the above-mentioned LUN is released, the above-mentioned allocation record element corresponding to the target object is decremented by 1;
  • the data block allocation record object deletion module is used to delete the data block allocation record object when the above-mentioned disk array is deleted.
  • the allocation record judging module 12 is specifically used to judge whether the above-mentioned allocation record element corresponding to any target object in the data block allocation record object is 0; LUN; otherwise, it is determined that there are data blocks allocated to the corresponding LUN in the target object.
  • the above-mentioned device also includes:
  • the data writing record bitmap creation module is used to create the above-mentioned data writing record bitmap when creating the above-mentioned disk array, and initialize all the bits in the above-mentioned data writing record bitmap to 0; wherein, the above-mentioned data writing Each bit in the entry record bitmap represents the data writing situation of one of the above-mentioned target objects;
  • the data writing recording module is used to set the bit position corresponding to the above-mentioned target object with data writing in the above-mentioned data writing record bitmap to 1 when writing data into the LUN.
  • the write record judging module 14 is specifically used to judge whether the bit corresponding to the above-mentioned target object in the above-mentioned data write record bitmap is 1; if so, then judge that there is data writing in the above-mentioned target object; No data was written in the target object.
  • the above-mentioned device also includes:
  • a data deletion record bitmap creation module configured to create the above-mentioned data deletion record bitmap, and initialize all bits in the above-mentioned data deletion record bitmap to 1; wherein, each bit in the above-mentioned data deletion record bitmap represents a Data deletion of the above-mentioned target objects;
  • a data deletion record module configured to set the corresponding bit position of the target object in the above-mentioned data deletion record bitmap to 0 if all data in any of the above-mentioned target objects is deleted when the LUN deletes data;
  • deletion record judging module is specifically used for:
  • the above-mentioned device also includes:
  • the data deletion record bitmap update module is used to write the record bit to the above-mentioned data after the corresponding bit position of the above-mentioned target object with data written in the above-mentioned data write-in record bitmap is 1 by the above-mentioned data write-in record module
  • An OR operation is performed on the graph and the above-mentioned data deletion record bitmap to obtain an updated data deletion record bitmap.
  • the embodiment of the present application discloses an electronic device.
  • the electronic device includes a memory and one or more processors.
  • Computer-readable instructions are stored in the memory.
  • the one or more processors Execute the steps of the method for reconfiguring the disk array provided in any one of the above embodiments.
  • the embodiment of the present application discloses an electronic device, including: a processor 21 and a memory 22 .
  • the above-mentioned memory 22 is used for storing computer-readable instructions; the above-mentioned processor 21 is used for executing the above-mentioned computer-readable instructions, so as to implement the disk array reconfiguration method disclosed in the foregoing embodiments.
  • the embodiment of the present application also discloses one or more non-volatile storage media storing computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, one or more processors execute The steps of the disk array reconfiguration method provided by any one of the above embodiments.
  • each embodiment is described in a progressive manner, each embodiment focuses on the differences from other embodiments, and the same or similar parts of the various embodiments can be referred to each other.
  • the description is relatively simple, and for the related information, please refer to the description of the method part.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM, or any other Any other known storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed in the present application are a method and apparatus for reconstructing redundant arrays of independent drives, and a device and a medium. The method comprises: when it is detected that redundant arrays of independent drives meet a reconstruction condition, determining, according to a data block allocation record object, whether none of data blocks in any target object is allocated to a corresponding LUN, wherein the target object is a basic unit of the reconstruction of the redundant arrays of independent drives, and comprises one or more strips; if none of the data blocks is allocated to the corresponding LUN, ignoring the target object, and otherwise, determining, according to a data deletion record bitmap, whether all the data in the target object is deleted; if all the data in the target object is deleted, ignoring the target object, and otherwise, determining, according to a data writing record bitmap, whether there is data written into the target object; and if there is data written into the target object, reconstructing the target object, and otherwise, ignoring the target object. In this way, the data volume of reconstruction is greatly reduced, and a reconstruction time of redundant arrays of independent drives can be shortened, thereby improving the reliability of storage.

Description

一种磁盘阵列重构方法、装置、设备及介质A disk array reconstruction method, device, equipment and medium
相关申请的交叉引用Cross References to Related Applications
本申请要求于2021年10月08日提交中国专利局,申请号为202111168480.9,申请名称为“一种磁盘阵列重构方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the China Patent Office on October 08, 2021, with the application number 202111168480.9, and the title of the application is "a disk array reconstruction method, device, equipment and medium", the entire content of which is passed References are incorporated in this application.
技术领域technical field
本申请涉及存储技术领域,特别涉及一种磁盘阵列重构方法、装置、设备及介质。The present application relates to the field of storage technologies, and in particular to a disk array reconfiguration method, device, equipment and medium.
背景技术Background technique
随着数字经济的发展,已经进入数字化转型的加速阶段,数据作为企业的核心资产,将发挥巨大的价值,数据保护对于企业至关重要。各应用领域对计算机存储***的性能和可靠性需求与日俱增。RAID(即Redundant Arrays of Independent Drives,磁盘阵列)可能因出现硬盘故障、坏块等需要进行重构,在重构过程中,如果再次发生坏盘或坏块,极有可能导致RAID不可用,数据发生丢失等灾难性后果。故RAID重构时间是存储可靠性的一个重要指标,如何缩短RAID的重构时间是目前亟待解决的问题。With the development of the digital economy, it has entered the accelerated stage of digital transformation. Data, as the core asset of enterprises, will play a huge value, and data protection is crucial to enterprises. The performance and reliability requirements of computer storage systems are increasing day by day in various application fields. RAID (that is, Redundant Arrays of Independent Drives, disk array) may need to be reconstructed due to hard disk failures, bad blocks, etc. During the reconstruction process, if bad disks or bad blocks occur again, it is very likely that the RAID will be unavailable. Disastrous consequences such as loss occur. Therefore, RAID reconstruction time is an important indicator of storage reliability, and how to shorten the RAID reconstruction time is an urgent problem to be solved.
发明内容Contents of the invention
第一方面,本申请的实施例公开了一种磁盘阵列重构方法,包括:In the first aspect, the embodiment of the present application discloses a method for reconfiguring a disk array, including:
当监测到磁盘阵列满足重构条件,则根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN;其中,上述目标对象为磁盘阵列重构的基本单位,包括一个或多个条带;When it is detected that the disk array meets the reconstruction conditions, it is judged according to the data block allocation record object whether the data blocks in any target object are not allocated to the corresponding LUN; wherein, the above-mentioned target object is the basic unit of the disk array reconstruction, including one or more strips;
若均未分配给相应的LUN,则忽略上述目标对象,否则根据数据删除记录位图判断上述目标对象中的数据是否被全部删除;If none of them are assigned to the corresponding LUN, ignore the above target object, otherwise judge whether all the data in the above target object has been deleted according to the data deletion record bitmap;
若上述目标对象中的数据被全部删除,则忽略上述目标对象,否则根据数据写入记录位图判断上述目标对象中是否有数据写入;If the data in the above-mentioned target object is all deleted, then ignore the above-mentioned target object, otherwise judge whether there is data written in the above-mentioned target object according to the data writing record bitmap;
若上述目标对象中有数据写入,则重构上述目标对象,否则忽略上述目标对象。If there is data written in the above target object, reconstruct the above target object, otherwise ignore the above target object.
根据本申请的一个实施例,还包括:According to an embodiment of the present application, it also includes:
在创建上述磁盘阵列时,创建上述数据块分配记录对象,并将上述数据块分配记录 对象中每一上述目标对象对应的分配记录元素初始化为0;When creating the above-mentioned disk array, create the above-mentioned data block allocation record object, and initialize the allocation record element corresponding to each of the above-mentioned target objects in the above-mentioned data block allocation record object to 0;
当获取到LUN的数据块申请时,每为上述LUN分配任一上述目标对象中的一个数据块,则对该目标对象对应的上述分配记录元素进行加1操作;When the data block application of the LUN is obtained, each time a data block in any of the above-mentioned target objects is allocated to the above-mentioned LUN, the above-mentioned allocation record element corresponding to the target object is incremented by 1;
当获取到LUN的数据块释放请求时,每释放上述LUN对应的任一上述目标对象的一个数据块,则对该目标对象对应的上述分配记录元素进行减1操作;When the data block release request of the LUN is obtained, each time a data block of any one of the above-mentioned target objects corresponding to the above-mentioned LUN is released, the above-mentioned allocation record element corresponding to the target object is decremented by 1;
当删除上述磁盘阵列时,则删除上述数据块分配记录对象。When the above-mentioned disk array is deleted, the above-mentioned data block allocation record object is deleted.
根据本申请的一个实施例,上述根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN,包括:According to an embodiment of the present application, the above-mentioned judging whether the data blocks in any target object are not allocated to the corresponding LUN according to the data block allocation record object includes:
判断数据块分配记录对象中任一目标对象对应的上述分配记录元素是否为0;Judging whether the above-mentioned allocation record element corresponding to any target object in the data block allocation record object is 0;
若是,则判定该目标对象中的数据块均未分配给相应的LUN;If so, it is determined that none of the data blocks in the target object are allocated to the corresponding LUN;
否则,判定该目标对象中有数据块分配给相应的LUN。Otherwise, it is determined that there are data blocks allocated to the corresponding LUN in the target object.
根据本申请的一个实施例,还包括:According to an embodiment of the present application, it also includes:
在创建上述磁盘阵列时,创建上述数据写入记录位图,并将上述数据写入记录位图中的全部比特位初始化为0;其中,上述数据写入记录位图中每个比特位代表一个上述目标对象的数据写入情况;When creating the above-mentioned disk array, create the above-mentioned data writing record bitmap, and initialize all bits in the above-mentioned data writing record bitmap to 0; wherein, each bit in the above-mentioned data writing record bitmap represents a The data writing status of the above-mentioned target objects;
在LUN写入数据时,则将有数据写入的上述目标对象在上述数据写入记录位图中对应的比特位置为1。When data is written into the LUN, the bit position corresponding to the target object with data written in the data write record bitmap is set to 1.
根据本申请的一个实施例,上述根据数据写入记录位图判断上述目标对象中是否有数据写入,包括:According to an embodiment of the present application, the above-mentioned judging whether there is data writing in the above-mentioned target object according to the data writing record bitmap includes:
判断上述数据写入记录位图中上述目标对象对应的比特位是否为1;Judging whether the bit corresponding to the above-mentioned target object in the above-mentioned data writing record bitmap is 1;
若是,则判定上述目标对象中有数据写入;If so, it is determined that there is data written in the above-mentioned target object;
否则,判定上述目标对象中无数据写入。Otherwise, it is determined that no data is written in the above target object.
根据本申请的一个实施例,还包括:According to an embodiment of the present application, it also includes:
创建上述数据删除记录位图,并将上述数据删除记录位图中的全部比特位初始化为1;其中,上述数据删除记录位图中每个比特位代表一个上述目标对象的数据删除情况;Create the above-mentioned data deletion record bitmap, and initialize all bits in the above-mentioned data deletion record bitmap to 1; wherein, each bit in the above-mentioned data deletion record bitmap represents a data deletion situation of the above-mentioned target object;
在LUN删除数据时,若任一上述目标对象中的数据被全部删除,则将该目标对象在上述数据删除记录位图中对应的比特位置为0;When the LUN deletes data, if all the data in any of the above-mentioned target objects is deleted, the corresponding bit position of the target object in the above-mentioned data deletion record bitmap is set to 0;
相应的,上述根据数据删除记录位图判断上述目标对象中的数据是否被全部删除,包括:Correspondingly, the above-mentioned judging whether all the data in the above-mentioned target object has been deleted according to the data deletion record bitmap includes:
判断上述目标对象在上述数据删除记录位图中对应的比特位是否为0;Judging whether the bit corresponding to the above-mentioned target object in the above-mentioned data deletion record bitmap is 0;
若是,则判定上述目标对象中的数据被全部删除。If yes, it is determined that all data in the above target object is deleted.
根据本申请的一个实施例,上述在LUN写入数据时,则将有数据写入的上述目标对象在上述数据写入记录位图中对应的比特位置为1之后,还包括:According to an embodiment of the present application, when data is written into the LUN, after the corresponding bit position of the above-mentioned target object with data written into the above-mentioned data writing record bitmap is 1, it further includes:
对上述数据写入记录位图以及上述数据删除记录位图进行或运算,得到更新后的数据删除记录位图。An OR operation is performed on the data writing record bitmap and the data deletion record bitmap to obtain an updated data deletion record bitmap.
第二方面,本申请的实施例公开了一种磁盘阵列重构装置,包括:In the second aspect, the embodiment of the present application discloses a device for reconfiguring a disk array, including:
磁盘阵列监控模块,用于监测磁盘阵列是否满足重构条件;The disk array monitoring module is used to monitor whether the disk array meets the reconstruction condition;
分配记录判断模块,用于当上述磁盘阵列监控模块监测到磁盘阵列满足重构条件,则根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN;其中,上述目标对象为磁盘阵列重构的基本单位,包括一个或多个条带;若均未分配给相应的LUN,则忽略上述目标对象;Allocation record judging module, used for when the above-mentioned disk array monitoring module detects that the disk array satisfies the reconstruction condition, then judge whether the data blocks in any target object are not allocated to the corresponding LUN according to the data block allocation record object; wherein, the above-mentioned The target object is the basic unit of disk array reconstruction, including one or more stripes; if none of them are allocated to the corresponding LUN, the above target object is ignored;
否则触发删除记录判断模块,根据数据删除记录位图判断上述目标对象中的数据是否被全部删除;若上述目标对象中的数据被全部删除,则忽略上述目标对象;Otherwise, the deletion record judging module is triggered to judge whether the data in the above-mentioned target object is completely deleted according to the data deletion record bitmap; if the data in the above-mentioned target object is all deleted, then the above-mentioned target object is ignored;
否则触发写入记录判断模块,根据数据写入记录位图判断上述目标对象中是否有数据写入,若否,则忽略上述目标对象;Otherwise, the write record judging module is triggered to judge whether there is data writing in the above-mentioned target object according to the data write-in record bitmap, and if not, then ignore the above-mentioned target object;
若上述目标对象中有数据写入,则启动目标对象重构模块,重构上述目标对象。If there is data written in the target object, start the target object reconstruction module to reconstruct the target object.
第三方面,本申请的实施例公开了一种电子设备,该电子设备包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被处理器执行时,使得一个或多个处理器执行上述任意一个实施例提供的磁盘阵列重构方法的步骤。In the third aspect, the embodiment of the present application discloses an electronic device, the electronic device includes a memory and one or more processors, and computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, a or multiple processors execute the steps of the disk array reconfiguration method provided in any one of the above embodiments.
第四方面,本申请公开了一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述任意一个实施例提供的磁盘阵列重构方法的步骤。本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。In a fourth aspect, the present application discloses one or more non-volatile storage media storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, one or more processors can perform any of the above-mentioned operations. Steps of a method for reconfiguring a disk array provided by an embodiment. The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below. Other features and advantages of the application will be apparent from the description, drawings, and claims.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present application, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.
图1示出本申请一个或多个实施例提供的磁盘阵列重构方法的应用场景图;FIG. 1 shows an application scenario diagram of a method for reconfiguring a disk array provided by one or more embodiments of the present application;
图2为本申请一个或多个实施例公开的一种磁盘阵列重构方法流程图;FIG. 2 is a flowchart of a method for reconfiguring a disk array disclosed in one or more embodiments of the present application;
图3为本申请一个或多个实施例提供的一种具体的存储层次关系示意图;FIG. 3 is a schematic diagram of a specific storage hierarchy relationship provided by one or more embodiments of the present application;
图4为本申请一个或多个实施例提供的一种具体的目标对象和条带的关系示意图;FIG. 4 is a schematic diagram of the relationship between a specific target object and a band provided by one or more embodiments of the present application;
图5为本申请一个或多个实施例公开的一种具体的目标对象重构流程图;FIG. 5 is a specific target object reconstruction flowchart disclosed in one or more embodiments of the present application;
图6为本申请一个或多个实施例公开的一种磁盘阵列重构装置结构示意图;FIG. 6 is a schematic structural diagram of a disk array reconfiguration device disclosed in one or more embodiments of the present application;
图7为本申请一个或多个实施例公开的一种电子设备结构图。Fig. 7 is a structural diagram of an electronic device disclosed by one or more embodiments of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
RAID可能因出现硬盘故障、坏块等需要进行重构,在重构过程中,如果再次发生坏盘或坏块,极有可能导致RAID不可用,数据发生丢失等灾难性后果。故RAID重构时间是存储可靠性的一个重要指标,如何缩短RAID的重构时间是目前亟待解决的问题。为此,本申请提供了一种磁盘阵列重构方案,能够缩短磁盘阵列的重构时间,从而提升存储的可靠性。RAID may need to be reconstructed due to hard disk failures and bad blocks. During the reconstruction process, if a bad disk or bad block occurs again, it is very likely to cause catastrophic consequences such as RAID unavailability and data loss. Therefore, RAID reconstruction time is an important indicator of storage reliability, and how to shorten the RAID reconstruction time is an urgent problem to be solved. Therefore, the present application provides a disk array reconfiguration solution, which can shorten the reconfiguration time of the disk array, thereby improving storage reliability.
本申请提供的磁盘阵列重构方法,可以应用于计算机设备,该计算机设备可以是服务器,其内部结构图可以如图1所示。该计算机设备包括通过***总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作***、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作***和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储数据块分配记录对象等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现磁盘阵列重构方法。其中,该服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The disk array reconfiguration method provided in this application can be applied to a computer device. The computer device can be a server, and its internal structure can be shown in FIG. 1 . The computer device includes a processor, memory, network interface and database connected by a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer readable instructions and a database. The internal memory provides an environment for the execution of the operating system and computer readable instructions in the non-volatile storage medium. The database of the computer device is used to store data such as data block allocation record objects. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer readable instructions are executed by the processor, the method for reconfiguring the disk array is implemented. Wherein, the server may be implemented by an independent server or a server cluster composed of multiple servers.
参见图2所示,本申请实施例公开了一种磁盘阵列重构方法,以该方法应用于图1中的电子设备为例进行说明,包括:Referring to Figure 2, the embodiment of the present application discloses a method for reconfiguring a disk array, which is described by taking the method applied to the electronic device in Figure 1 as an example, including:
步骤S11:当监测到磁盘阵列满足重构条件,则根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN(即Logical Unit Number指逻辑单元号);其中,上述目标对象为磁盘阵列重构的基本单位,包括一个或多个条带。Step S11: When it is detected that the disk array satisfies the reconstruction condition, then judge whether the data blocks in any target object are not allocated to the corresponding LUN according to the data block allocation record object (that is, the Logical Unit Number refers to the logical unit number); wherein, The above target object is the basic unit of disk array reconstruction, including one or more stripes.
具体地,监测磁盘阵列,响应于监测到磁盘阵列满足重构条件,根据数据块分配记 录对象判断任一目标对象中的数据块是否均未分配给相应的LUN。Specifically, monitor the disk array, and in response to detecting that the disk array meets the reconstruction condition, judge whether the data blocks in any target object are not allocated to the corresponding LUN according to the data block allocation record object.
在具体的实施方式中,可以实时监测磁盘阵列是否出现硬盘故障、坏块等,当监测到磁盘阵列出现上述情况,则判定磁盘阵列满足重构条件,需要重构。In a specific implementation manner, it is possible to monitor in real time whether the disk array has a hard disk failure, bad blocks, etc., and when the above situation is detected in the disk array, it is determined that the disk array meets the reconstruction conditions and needs to be reconstructed.
在具体的实施方式中,在创建上述磁盘阵列时,创建上述数据块分配记录对象,并将上述数据块分配记录对象中每一上述目标对象对应的分配记录元素初始化为0;响应于获取到LUN的数据块申请,每为上述LUN分配任一上述目标对象中的一个数据块,则对该目标对象对应的上述分配记录元素进行加1操作;响应于获取到LUN的数据块释放请求,每释放上述LUN对应的任一上述目标对象的一个数据块,则对该目标对象对应的上述分配记录元素进行减1操作;当删除上述磁盘阵列时,则删除上述数据块分配记录对象。In a specific implementation manner, when creating the above-mentioned disk array, the above-mentioned data block allocation record object is created, and the allocation record element corresponding to each of the above-mentioned target objects in the above-mentioned data block allocation record object is initialized to 0; Each time a data block in any of the above-mentioned target objects is allocated for the above-mentioned LUN, the above-mentioned allocation record element corresponding to the target object will be incremented by 1; in response to the acquired data block release request of the LUN, each For a data block of any one of the above target objects corresponding to the above LUN, the above-mentioned allocation record element corresponding to the target object is subtracted by 1; when the above-mentioned disk array is deleted, the above-mentioned data block allocation record object is deleted.
其中,每个目标对象在上述数据块分配记录对象中存在1个对应的分配记录元素。Wherein, each target object has a corresponding allocation record element in the above-mentioned data block allocation record object.
可以理解的是,在创建或者扩容LUN时,LUN会向RAID申请数据块,在每个数据块分配给LUN后,更新数据块分配记录对象,对相应的分配记录元素加1。在删除/缩容LUN,LUN会向RAID释放数据块,在每个数据块释放时,更新数据块分配记录对象,对相应的分配记录元素减1。这样,通过数据块分配记录对象可以记录目标对象中已分配的数据块的数量。It can be understood that when creating or expanding a LUN, the LUN will apply for a data block from the RAID, and after each data block is allocated to the LUN, the data block allocation record object is updated, and 1 is added to the corresponding allocation record element. When deleting/shrinking a LUN, the LUN releases data blocks to the RAID. When each data block is released, the data block allocation record object is updated, and the corresponding allocation record element is decremented by 1. In this way, the data block allocation recording object can record the number of allocated data blocks in the target object.
相应的,上述根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN,包括:判断数据块分配记录对象中任一目标对象对应的上述分配记录元素是否为0;若是,则判定该目标对象中的数据块均未分配给相应的LUN;否则,判定该目标对象中有数据块分配给相应的LUN。Correspondingly, the above-mentioned determination according to the data block allocation record object whether the data blocks in any target object are not allocated to the corresponding LUN includes: determining whether the above-mentioned allocation record element corresponding to any target object in the data block allocation record object is 0 ; If so, it is determined that none of the data blocks in the target object are allocated to the corresponding LUN; otherwise, it is determined that there is a data block in the target object allocated to the corresponding LUN.
具体地,判断数据块分配记录对象中任一目标对象对应的上述分配记录元素是否为0,响应于数据块分配记录对象中任一目标对象对应的所述上述分配记录元素为0,判定该目标对象中的数据块均未分配给相应的LUN;响应于数据块分配记录对象中任一目标对象对应的所述上述分配记录元素不为0,判定该目标对象中有数据块分配给相应的LUN。Specifically, it is judged whether the above-mentioned allocation record element corresponding to any target object in the data block allocation record object is 0, and in response to the above-mentioned allocation record element corresponding to any target object in the data block allocation record object being 0, it is determined that the target None of the data blocks in the object are allocated to the corresponding LUN; in response to the fact that the above-mentioned allocation record element corresponding to any target object in the data block allocation record object is not 0, it is determined that there is a data block in the target object allocated to the corresponding LUN .
步骤S12:若均未分配给相应的LUN,则忽略上述目标对象,否则根据数据删除记录位图判断上述目标对象中的数据是否被全部删除。Step S12: If none of them are allocated to the corresponding LUN, then ignore the above target object; otherwise, judge whether all the data in the above target object has been deleted according to the data deletion record bitmap.
具体地,响应于该目标对象中的数据块均未分配给相应的LUN,忽略上述目标对象;响应于该目标对象中有数据块分配给相应的LUN,根据数据删除记录位图判断上述目标对象中的数据是否被全部删除。Specifically, in response to none of the data blocks in the target object being allocated to the corresponding LUN, ignore the target object; in response to the allocation of data blocks in the target object to the corresponding LUN, judge the target object according to the data deletion record bitmap Whether all the data in is deleted.
在具体的实施方式中,可以创建上述数据删除记录位图,并将上述数据删除记录位图中的全部比特位初始化为1;其中,上述数据删除记录位图中每个比特位代表一个上述 目标对象的数据删除情况;在LUN删除数据时,若任一上述目标对象中的数据被全部删除,则将该目标对象在上述数据删除记录位图中对应的比特位置为0;In a specific implementation manner, the above-mentioned data deletion record bitmap can be created, and all bits in the above-mentioned data deletion record bitmap can be initialized to 1; wherein, each bit in the above-mentioned data deletion record bitmap represents one of the above-mentioned targets The data deletion status of the object; when the LUN deletes data, if all the data in any of the above target objects is deleted, the corresponding bit position of the target object in the above data deletion record bitmap is set to 0;
相应的,上述根据数据删除记录位图判断上述目标对象中的数据是否被全部删除,包括:判断上述目标对象在上述数据删除记录位图中对应的比特位是否为0;若是,则判定上述目标对象中的数据被全部删除。Correspondingly, the above-mentioned judging whether the data in the above-mentioned target object is completely deleted according to the data deletion record bitmap includes: judging whether the corresponding bit of the above-mentioned target object in the above-mentioned data deletion record bitmap is 0; All data in the object is deleted.
具体地,响应于上述目标对象在上述数据删除记录位图中对应的比特位为0,判定上述目标对象中的数据被全部删除。Specifically, in response to the fact that the bit corresponding to the target object in the data deletion record bitmap is 0, it is determined that all data in the target object is deleted.
步骤S13:若上述目标对象中的数据被全部删除,则忽略上述目标对象,否则根据数据写入记录位图判断上述目标对象中是否有数据写入。Step S13: If all the data in the above target object is deleted, then ignore the above target object; otherwise, judge whether there is data writing in the above target object according to the data writing record bitmap.
具体地,响应于上述目标对象中的数据被全部删除,忽略上述目标对象;响应于上述目标对象中的数据未被全部删除,根据数据写入记录位图判断上述目标对象中是否有数据写入。Specifically, in response to all data in the above target object being deleted, ignore the above target object; in response to not all data in the above target object being deleted, judging whether there is data written in the above target object according to the data writing record bitmap .
在创建上述磁盘阵列时,创建上述数据写入记录位图,并将上述数据写入记录位图中的全部比特位初始化为0;其中,上述数据写入记录位图中每个比特位代表一个上述目标对象的数据写入情况;在LUN写入数据时,则将有数据写入的上述目标对象在上述数据写入记录位图中对应的比特位置为1。When creating the above-mentioned disk array, create the above-mentioned data writing record bitmap, and initialize all bits in the above-mentioned data writing record bitmap to 0; wherein, each bit in the above-mentioned data writing record bitmap represents a The data writing status of the above-mentioned target object; when data is written into the LUN, the corresponding bit position of the above-mentioned target object with data written in the above-mentioned data writing record bitmap is 1.
相应的,上述根据数据写入记录位图判断上述目标对象中是否有数据写入,包括:判断上述数据写入记录位图中上述目标对象对应的比特位是否为1;若是,则判定上述目标对象中有数据写入;否则,判定上述目标对象中无数据写入。Correspondingly, the above-mentioned judging whether there is data writing in the above-mentioned target object according to the data writing record bitmap includes: judging whether the bit corresponding to the above-mentioned target object in the above-mentioned data writing record bitmap is 1; There is data written in the object; otherwise, it is judged that there is no data written in the above target object.
具体地,响应于上述数据写入记录位图中上述目标对象对应的比特位为1,判定上述目标对象中有数据写入;响应于上述数据写入记录位图中上述目标对象对应的比特位不为1,判定上述目标对象中无数据写入。Specifically, in response to the bit corresponding to the above-mentioned target object in the above-mentioned data writing record bitmap being 1, it is determined that there is data writing in the above-mentioned target object; If it is not 1, it is judged that no data is written in the above target object.
可以理解的是,在LUN写入数据时,RAID计算得到写入数据对应的目标对象,进而将上述目标对象在上述数据写入记录位图中对应的比特位置为1。It can be understood that when data is written into the LUN, the RAID calculates the target object corresponding to the written data, and then sets the corresponding bit position of the target object in the data writing record bitmap to 1.
也即,本申请实施例用数据写入记录位图记录相应的目标对象中是否有数据写入。That is, in the embodiment of the present application, the data writing record bitmap is used to record whether there is data writing in the corresponding target object.
进一步的,当删除磁盘阵列时,删除上述数据写入记录位图。Further, when the disk array is deleted, the above data is deleted and written into the record bitmap.
并且,上述在LUN写入数据时,则将有数据写入的上述目标对象在上述数据写入记录位图中对应的比特位置为1之后,本申请实施例还对上述数据写入记录位图以及上述数据删除记录位图进行或运算,得到更新后的数据删除记录位图。也即,将或运算结果赋值给数据删除记录位图。In addition, when data is written into the LUN, after the bit position corresponding to the target object with data written in the data write record bitmap is set to 1, the embodiment of the present application also writes the data into the record bitmap And performing an OR operation on the above data deletion record bitmap to obtain an updated data deletion record bitmap. That is, the OR operation result is assigned to the data deletion record bitmap.
步骤S14:若上述目标对象中有数据写入,则重构上述目标对象,否则忽略上述目标 对象。Step S14: If there is data written in the above target object, reconstruct the above target object, otherwise ignore the above target object.
具体地,响应于上述目标对象中有数据写入,重构上述目标对象;响应于上述目标对象中没有数据写入忽略上述目标对象。Specifically, in response to data writing in the above target object, reconstruct the above target object; in response to no data writing in the above target object, ignore the above target object.
在具体的实施方式中,可以利用预设的重构算法重构上述目标对象,其中,所采用的重构算法可以参考现有技术,在此不再进行赘述。In a specific implementation manner, the above-mentioned target object may be reconstructed by using a preset reconstruction algorithm, wherein the adopted reconstruction algorithm may refer to the prior art, which will not be repeated here.
可见,本申请实施例当监测到磁盘阵列满足重构条件,则根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN;其中,上述目标对象为磁盘阵列重构的基本单位,包括一个或多个条带;若均未分配给相应的LUN,则忽略上述目标对象,否则根据数据删除记录位图判断上述目标对象中的数据是否被全部删除;若上述目标对象中的数据被全部删除,则忽略上述目标对象,否则根据数据写入记录位图判断上述目标对象中是否有数据写入;若上述目标对象中有数据写入,则重构上述目标对象,否则忽略上述目标对象。也即,本申请通过数据块分配记录对象、数据删除记录位图,以及数据写入记录位图筛选出需要重构的目标对象,进行重构,这样,极大的减少了重构的数据量,能够缩短磁盘阵列的重构时间,从而提升存储的可靠性。It can be seen that in the embodiment of the present application, when it is detected that the disk array satisfies the reconstruction condition, it is judged according to the data block allocation record object whether the data blocks in any target object are not allocated to the corresponding LUN; wherein, the above-mentioned target object is the disk array reconstruction The basic unit of the structure, including one or more stripes; if none of them are allocated to the corresponding LUN, ignore the above target object, otherwise judge whether all the data in the above target object has been deleted according to the data deletion record bitmap; if the above target If all the data in the object is deleted, the above target object will be ignored, otherwise, it will be judged whether there is data written in the above target object according to the data writing record bitmap; if there is data written in the above target object, then the above target object will be reconstructed, Otherwise ignore the above target object. That is to say, this application screens out the target objects that need to be reconstructed through the data block allocation record object, data deletion record bitmap, and data writing record bitmap, and performs reconstruction, thus greatly reducing the amount of reconstructed data , which can shorten the reconstruction time of the disk array, thereby improving the reliability of storage.
例如,参见图3所示,本申请实施例提供了一种具体的存储层次关系,一个或者多个Drive(即硬盘)组成RAID,RAID在Pool(即存储池)中按照Extent尺寸切分成多个Extent(即前述数据块)。创建LUN时,会在Pool中的一个或多个RAID中选取Extent。参见图4所示,本申请实施例提供了一种具体的目标对象和条带的关系示意图,一个由6块盘组成的RAID,将这个RAID的空间划分成多个strip(即条带)。Pack(即前述目标对象)则是由一个或多个strip组成。图4中给出目标对象0、目标对象1的实例,目标对象包括条带0、条带1等多个条带。For example, as shown in Figure 3, the embodiment of the present application provides a specific storage hierarchy relationship, one or more Drives (that is, hard disks) form a RAID, and the RAID is divided into multiple Extent (that is, the aforementioned data block). When creating a LUN, the extent will be selected from one or more RAIDs in the Pool. Referring to FIG. 4 , the embodiment of the present application provides a schematic diagram of the relationship between a specific target object and a stripe, a RAID composed of 6 disks, and the RAID space is divided into multiple strips (ie, stripes). Pack (that is, the aforementioned target object) is composed of one or more strips. Fig. 4 gives examples of target object 0 and target object 1, and the target objects include multiple stripes such as stripe 0 and stripe 1.
本申请实施例对Pack的使用情况进行实时记录,初始时为未使用,在发生创建LUN、删除LUN、LUN扩容\缩容、LUN迁移、写入数据、删除数据时更新相关的Pack对象,待重构条件触发时(发生坏块、坏盘等),对这些Pack对象分析,找出真正需要重构的Pack,之后进行重构。这可以极大减少重构的数据量,进而缩短重构时间,提高存储***的可靠性。The embodiment of this application records the usage of the Pack in real time. It is unused at the beginning, and the relevant Pack objects are updated when creating LUNs, deleting LUNs, expanding/shrinking LUNs, migrating LUNs, writing data, and deleting data. When the reconstruction condition is triggered (bad blocks, bad disks, etc.), analyze these Pack objects to find out the Pack that really needs to be reconstructed, and then perform reconstruction. This can greatly reduce the amount of data to be reconstructed, thereby shortening the reconstruction time and improving the reliability of the storage system.
其中,Drive包括机械硬盘、固态硬盘;RAID是由很多块独立的磁盘,组合成一个容量巨大的磁盘组,利用个别磁盘提供数据所产生加成效果提升整个磁盘***效能;在存储设备中,LUN就是卷的概念;一个Pool中可以添加多个RAID,也可以创建多个LUN。Extent是Pool的一个属性,Pool将其包含的RAID按照extent大小切分成数据块,也是LUN的最小数据单元。LUN的扩容/缩容:给LUN增加容量即为扩容,缩小LUN 的容量即为缩容。RAID把数据分成strip(条带),一个条带横跨所有数据磁盘,每个磁盘上存储条带的一部分,称为sagment,也称为条带深度。一个条带包含的扇区或块的个数,称为条带长度。Pack中包含一个或多个Strip,是RAID重构的基本单位。Among them, Drive includes mechanical hard disk and solid-state hard disk; RAID is composed of many independent disks, which are combined into a large-capacity disk group, and the bonus effect generated by using individual disks to provide data improves the performance of the entire disk system; in storage devices, LUN It is the concept of volume; multiple RAIDs can be added to a Pool, and multiple LUNs can also be created. Extent is an attribute of Pool. Pool divides the RAID contained in it into data blocks according to the extent size, which is also the smallest data unit of LUN. LUN expansion/reduction: adding capacity to a LUN is capacity expansion, and reducing the capacity of a LUN is capacity reduction. RAID divides data into strips (stripes), a strip spans all data disks, and stores a part of the strip on each disk, called sagment, also known as strip depth. The number of sectors or blocks contained in a stripe is called the stripe length. A Pack contains one or more Strips, which is the basic unit of RAID reconstruction.
例如,本申请实施例可以创建数据写入记录位图记为pack_written_bitmap,用于记录RAID中所有Pack是否被写入,每个bit代表一个Pack的写入情况,其中,bit==1代表被写入,bit==0代表未被写入。初始全为0。并且,创建数据块分配记录对象记为pack_alloc_info,用于记录pack的空间是否被分配给LUN,以及被LUN使用几个extent,需要指出的是,一个pack有可能跨越一个或者多个extent,初始为0,当RAID的extent被分配给LUN时,会对pack_alloc_info中相应元素加一。如果这个pack所在的多个extent都被分配给LUN,则pack_alloc_info中相应元素等于其跨越的extent数目。如果extent被释放,比如LUN删除或者LUN缩容等,则相应的pack_alloc_info相应元素会被减一。进一步的,创建数据删除记录位图记为pack_delete_bitmap,用于记录LUN上的pack数据删除情况,默认全1,只有当该pack所有数据均被删除才会被设置为0。For example, the embodiment of the present application can create a data writing record bitmap marked as pack_written_bitmap, which is used to record whether all Packs in the RAID are written, and each bit represents the writing situation of a Pack, wherein, bit==1 represents being written input, bit==0 means not written. Initially all are 0. In addition, create a data block allocation record object and record it as pack_alloc_info, which is used to record whether the space of the pack is allocated to the LUN, and how many extents are used by the LUN. It should be pointed out that a pack may span one or more extents. Initially, it is 0, when the RAID extent is allocated to the LUN, one will be added to the corresponding element in pack_alloc_info. If multiple extents where the pack is located are allocated to LUNs, the corresponding element in pack_alloc_info is equal to the number of extents it spans. If the extent is released, such as LUN deletion or LUN shrinkage, the corresponding element of pack_alloc_info will be reduced by one. Further, create a data deletion record bitmap and record it as pack_delete_bitmap, which is used to record the deletion of pack data on the LUN. The default is all 1, and it will be set to 0 only when all data of the pack is deleted.
在具体的实施方式中,创建RAID时,创建pack_written_bitmap,将所有的bit初始化为0,代表未被写入;创建pack_alloc_info,将其所代表的所有pack的alloc_info(即每个pack对应的分配记录元素)都设置为0,代表未被分配。在删除RAID时,删除该RAID的pack_written_bitmap和pack_alloc_info,同时释放了相应的内存。创建/扩容LUN,LUN会向RAID申请extent,在每个extent被分配后,更新相应的pack_alloc_info,对alloc_info加一。删除/缩容LUN,LUN会向RAID释放extent,在每个extent释放时,更新相应的pack_alloc_info,对alloc_info减一。LUN写入数据,在RAID模块会计算得到pack,进而将pack_written_bitmap对应的位置1。更新pack_delete_bitmap=pack_written_bitmap||pack_delete_bitmap;也即,进行或运算,比如A||B,A和B只有全都是零时,结果才是零,否则结果是1。LUN删除数据,更新pack_delete_bitmap,当pack所有数据全被删除,才会设置为0。In a specific implementation, when creating a RAID, create a pack_written_bitmap, and initialize all bits to 0, which means that they have not been written; ) are set to 0, which means they are not assigned. When deleting a RAID, delete the pack_written_bitmap and pack_alloc_info of the RAID, and release the corresponding memory at the same time. To create/expand a LUN, the LUN will apply for an extent from RAID. After each extent is allocated, update the corresponding pack_alloc_info and add one to alloc_info. Delete/shrink the LUN, the LUN will release the extent to the RAID, and when each extent is released, the corresponding pack_alloc_info will be updated, and the alloc_info will be reduced by one. When data is written to the LUN, the RAID module will calculate the pack, and then set the corresponding bit of pack_written_bitmap to 1. Update pack_delete_bitmap=pack_written_bitmap||pack_delete_bitmap; that is, perform an OR operation, such as A||B. Only when A and B are both zero, the result is zero, otherwise the result is 1. LUN deletes data, updates pack_delete_bitmap, and only sets it to 0 when all data in the pack is deleted.
这样,在发生了坏盘或者坏块而触发重构时,单个pack重构的处理流程可以参考图5所示,图5为本申请实施例公开的一种具体的目标对象重构流程图。先检查pack_alloc_info,如果该pack对应的alloc_info为0,则代表它没有被任何LUN使用,无需重构。否则检查pack_delete_bitmap,该pack的区域若在pack_delete_bitmap中对应的bit位是0,说明其中的用户数据全部已删除,则无需重构,否则、检查pack_written_bitmap,如果该pack对应的bit是0,则说明没有数据写入,无需重构, 否则执行数据重构流程。可见,本申请实施例通过实时记录/更新RAID中PACK对象的使用情况,根据多个Pack使用情况相关对象的状态,最大限度减少重构的数据量,进而缩短RAID重构时间,提高存储***整体的可靠性。In this way, when a bad disk or bad block occurs and triggers reconstruction, the processing flow of single pack reconstruction can be referred to as shown in FIG. 5 , which is a specific target object reconstruction flow chart disclosed in the embodiment of the present application. Check the pack_alloc_info first, if the alloc_info corresponding to the pack is 0, it means it is not used by any LUN, and there is no need to refactor. Otherwise, check pack_delete_bitmap. If the corresponding bit of the pack area in pack_delete_bitmap is 0, it means that all user data in it has been deleted, and there is no need to refactor. Otherwise, check pack_written_bitmap. If the corresponding bit of the pack is 0, it means there is no Data is written without reconstruction, otherwise execute the data reconstruction process. It can be seen that the embodiment of the present application records/updates the usage status of the PACK objects in the RAID in real time, and according to the status of multiple Pack usage-related objects, minimizes the amount of data to be reconstructed, thereby shortening the RAID reconstruction time and improving the overall performance of the storage system. reliability.
参见图6所示,本申请实施例公开了一种磁盘阵列重构装置,包括:Referring to Figure 6, the embodiment of the present application discloses a disk array reconfiguration device, including:
磁盘阵列监控模块11,用于监测磁盘阵列是否满足重构条件;The disk array monitoring module 11 is used to monitor whether the disk array meets the reconstruction condition;
分配记录判断模块12,用于当上述磁盘阵列监控模块11监测到磁盘阵列满足重构条件,则根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN;其中,上述目标对象为磁盘阵列重构的基本单位,包括一个或多个条带;若均未分配给相应的LUN,则忽略上述目标对象;Allocation record judging module 12, used for when the above-mentioned disk array monitoring module 11 monitors that the disk array satisfies the reconstruction condition, then judge whether the data blocks in any target object are not assigned to the corresponding LUN according to the data block allocation record object; , the above target object is the basic unit of disk array reconstruction, including one or more stripes; if none of them are allocated to the corresponding LUN, the above target object is ignored;
否则触发删除记录判断模块13,根据数据删除记录位图判断上述目标对象中的数据是否被全部删除;若上述目标对象中的数据被全部删除,则忽略上述目标对象;Otherwise trigger deletion record judgment module 13, judge whether the data in the above-mentioned target object is all deleted according to the data deletion record bitmap; If the data in the above-mentioned target object is all deleted, then ignore the above-mentioned target object;
否则触发写入记录判断模块14,根据数据写入记录位图判断上述目标对象中是否有数据写入,若否,则忽略上述目标对象;Otherwise, trigger the write record judging module 14 to judge whether there is data writing in the above-mentioned target object according to the data write record bitmap, if not, then ignore the above-mentioned target object;
若上述目标对象中有数据写入,则启动目标对象重构模块15,重构上述目标对象。If there is data written into the target object, start the target object reconstruction module 15 to reconstruct the target object.
可见,本申请实施例当监测到磁盘阵列满足重构条件,则根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN;其中,上述目标对象为磁盘阵列重构的基本单位,包括一个或多个条带;若均未分配给相应的LUN,则忽略上述目标对象,否则根据数据删除记录位图判断上述目标对象中的数据是否被全部删除;若上述目标对象中的数据被全部删除,则忽略上述目标对象,否则根据数据写入记录位图判断上述目标对象中是否有数据写入;若上述目标对象中有数据写入,则重构上述目标对象,否则忽略上述目标对象。也即,本申请通过数据块分配记录对象、数据删除记录位图,以及数据写入记录位图筛选出需要重构的目标对象,进行重构,这样,极大的减少了重构的数据量,能够缩短磁盘阵列的重构时间,从而提升存储的可靠性。It can be seen that in the embodiment of the present application, when it is detected that the disk array satisfies the reconstruction condition, it is judged according to the data block allocation record object whether the data blocks in any target object are not allocated to the corresponding LUN; wherein, the above-mentioned target object is the disk array reconstruction The basic unit of the structure, including one or more stripes; if none of them are allocated to the corresponding LUN, ignore the above target object, otherwise judge whether all the data in the above target object has been deleted according to the data deletion record bitmap; if the above target If all the data in the object is deleted, ignore the above target object; otherwise, judge whether there is data written in the above target object according to the data writing record bitmap; if there is data written in the above target object, then reconstruct the above target object, Otherwise ignore the above target object. That is to say, this application screens out the target objects that need to be reconstructed through the data block allocation record object, data deletion record bitmap, and data writing record bitmap, and performs reconstruction, thus greatly reducing the amount of reconstructed data , which can shorten the reconstruction time of the disk array, thereby improving the reliability of storage.
进一步的,所示装置还包括:Further, the shown device also includes:
数据块分配记录对象创建模块,用于在创建上述磁盘阵列时,创建上述数据块分配记录对象,并将上述数据块分配记录对象中每一上述目标对象对应的分配记录元素初始化为0;The data block allocation record object creation module is used to create the above-mentioned data block allocation record object when creating the above-mentioned disk array, and initialize the allocation record element corresponding to each of the above-mentioned target objects in the above-mentioned data block allocation record object to 0;
数据块分配记录对象记录模块,用于当获取到LUN的数据块申请时,每为上述LUN分配任一上述目标对象中的一个数据块,则对该目标对象对应的上述分配记录元素进行加1操作;当获取到LUN的数据块释放请求时,每释放上述LUN对应的任一上述目标对象的 一个数据块,则对该目标对象对应的上述分配记录元素进行减1操作;The data block allocation record object recording module is used to add 1 to the allocation record element corresponding to the target object when a data block in any of the above target objects is allocated to the above LUN when the data block application of the LUN is obtained. Operation: when the data block release request of the LUN is obtained, each time a data block of any of the above-mentioned target objects corresponding to the above-mentioned LUN is released, the above-mentioned allocation record element corresponding to the target object is decremented by 1;
数据块分配记录对象删除模块,用于当删除上述磁盘阵列时,则删除上述数据块分配记录对象。The data block allocation record object deletion module is used to delete the data block allocation record object when the above-mentioned disk array is deleted.
相应的,分配记录判断模块12,具体用于判断数据块分配记录对象中任一目标对象对应的上述分配记录元素是否为0;若是,则判定该目标对象中的数据块均未分配给相应的LUN;否则,判定该目标对象中有数据块分配给相应的LUN。Correspondingly, the allocation record judging module 12 is specifically used to judge whether the above-mentioned allocation record element corresponding to any target object in the data block allocation record object is 0; LUN; otherwise, it is determined that there are data blocks allocated to the corresponding LUN in the target object.
进一步的,上述装置还包括:Further, the above-mentioned device also includes:
数据写入记录位图创建模块,用于在创建上述磁盘阵列时,创建上述数据写入记录位图,并将上述数据写入记录位图中的全部比特位初始化为0;其中,上述数据写入记录位图中每个比特位代表一个上述目标对象的数据写入情况;The data writing record bitmap creation module is used to create the above-mentioned data writing record bitmap when creating the above-mentioned disk array, and initialize all the bits in the above-mentioned data writing record bitmap to 0; wherein, the above-mentioned data writing Each bit in the entry record bitmap represents the data writing situation of one of the above-mentioned target objects;
数据写入记录模块,用于在LUN写入数据时,则将有数据写入的上述目标对象在上述数据写入记录位图中对应的比特位置为1。The data writing recording module is used to set the bit position corresponding to the above-mentioned target object with data writing in the above-mentioned data writing record bitmap to 1 when writing data into the LUN.
相应的,写入记录判断模块14,具体用于判断上述数据写入记录位图中上述目标对象对应的比特位是否为1;若是,则判定上述目标对象中有数据写入;否则,判定上述目标对象中无数据写入。Correspondingly, the write record judging module 14 is specifically used to judge whether the bit corresponding to the above-mentioned target object in the above-mentioned data write record bitmap is 1; if so, then judge that there is data writing in the above-mentioned target object; No data was written in the target object.
进一步的,上述装置还包括:Further, the above-mentioned device also includes:
数据删除记录位图创建模块,用于创建上述数据删除记录位图,并将上述数据删除记录位图中的全部比特位初始化为1;其中,上述数据删除记录位图中每个比特位代表一个上述目标对象的数据删除情况;A data deletion record bitmap creation module, configured to create the above-mentioned data deletion record bitmap, and initialize all bits in the above-mentioned data deletion record bitmap to 1; wherein, each bit in the above-mentioned data deletion record bitmap represents a Data deletion of the above-mentioned target objects;
数据删除记录模块,用于在LUN删除数据时,若任一上述目标对象中的数据被全部删除,则将该目标对象在上述数据删除记录位图中对应的比特位置为0;A data deletion record module, configured to set the corresponding bit position of the target object in the above-mentioned data deletion record bitmap to 0 if all data in any of the above-mentioned target objects is deleted when the LUN deletes data;
相应的,上述删除记录判断模块具体用于:Correspondingly, the above deletion record judging module is specifically used for:
判断上述目标对象在上述数据删除记录位图中对应的比特位是否为0;若是,则判定上述目标对象中的数据被全部删除。It is judged whether the corresponding bit of the target object in the data deletion record bitmap is 0; if yes, it is determined that all the data in the target object is deleted.
进一步的,上述装置还包括:Further, the above-mentioned device also includes:
数据删除记录位图更新模块,用于在上述数据写入记录模块将有数据写入的上述目标对象在上述数据写入记录位图中对应的比特位置为1之后,对上述数据写入记录位图以及上述数据删除记录位图进行或运算,得到更新后的数据删除记录位图。The data deletion record bitmap update module is used to write the record bit to the above-mentioned data after the corresponding bit position of the above-mentioned target object with data written in the above-mentioned data write-in record bitmap is 1 by the above-mentioned data write-in record module An OR operation is performed on the graph and the above-mentioned data deletion record bitmap to obtain an updated data deletion record bitmap.
本申请实施例公开了一种电子设备,该电子设备包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被处理器执行时,使得一个或多个处 理器执行上述任意一个实施例提供的磁盘阵列重构方法的步骤。示例性地,参见图7所示,本申请实施例公开了一种电子设备,包括:处理器21和存储器22。The embodiment of the present application discloses an electronic device. The electronic device includes a memory and one or more processors. Computer-readable instructions are stored in the memory. When the computer-readable instructions are executed by the processor, the one or more processors Execute the steps of the method for reconfiguring the disk array provided in any one of the above embodiments. For example, referring to FIG. 7 , the embodiment of the present application discloses an electronic device, including: a processor 21 and a memory 22 .
其中,上述存储器22,用于存储计算机可读指令;上述处理器21,用于执行上述计算机可读指令,以实现前述实施例中公开的磁盘阵列重构方法。Wherein, the above-mentioned memory 22 is used for storing computer-readable instructions; the above-mentioned processor 21 is used for executing the above-mentioned computer-readable instructions, so as to implement the disk array reconfiguration method disclosed in the foregoing embodiments.
其中,关于上述磁盘阵列重构方法的具体过程可以参考前述实施例中公开的相应内容,在此不再进行赘述。For the specific process of the disk array reconfiguration method above, reference may be made to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
进一步的,本申请实施例还公开了一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述任意一个实施例提供的磁盘阵列重构方法的步骤。Further, the embodiment of the present application also discloses one or more non-volatile storage media storing computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, one or more processors execute The steps of the disk array reconfiguration method provided by any one of the above embodiments.
其中,关于上述磁盘阵列重构方法的具体过程可以参考前述实施例中公开的相应内容,在此不再进行赘述。For the specific process of the disk array reconfiguration method above, reference may be made to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment is described in a progressive manner, each embodiment focuses on the differences from other embodiments, and the same or similar parts of the various embodiments can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.
以上对本申请所提供的一种磁盘阵列重构方法、装置、设备及介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The method, device, equipment and medium for reconfiguring a disk array provided by this application have been introduced in detail above. In this paper, specific examples have been used to illustrate the principle and implementation of this application. The description of the above embodiment is only for To help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation and application scope. In summary, the content of this specification It should not be construed as a limitation of the application.

Claims (10)

  1. 一种磁盘阵列重构方法,其特征在于,包括:A method for reconfiguring a disk array, characterized in that it comprises:
    当监测到磁盘阵列满足重构条件,则根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN;其中,所述目标对象为磁盘阵列重构的基本单位,包括一个或多个条带;及When it is detected that the disk array satisfies the reconstruction condition, it is judged according to the data block allocation record object whether the data blocks in any target object are not allocated to the corresponding LUN; wherein, the target object is the basic unit of the disk array reconstruction, include one or more strips; and
    若均未分配给相应的LUN,则忽略所述目标对象,否则根据数据删除记录位图判断所述目标对象中的数据是否被全部删除;及If neither is allocated to the corresponding LUN, then ignore the target object, otherwise judge whether the data in the target object is completely deleted according to the data deletion record bitmap; and
    若所述目标对象中的数据被全部删除,则忽略所述目标对象,否则根据数据写入记录位图判断所述目标对象中是否有数据写入;及If the data in the target object is all deleted, then ignore the target object, otherwise judge whether there is data writing in the target object according to the data writing record bitmap; and
    若所述目标对象中有数据写入,则重构所述目标对象,否则忽略所述目标对象。If there is data written in the target object, reconstruct the target object, otherwise ignore the target object.
  2. 根据权利要求1所述的磁盘阵列重构方法,其特征在于,还包括:The disk array reconstruction method according to claim 1, further comprising:
    在创建所述磁盘阵列时,创建所述数据块分配记录对象,并将所述数据块分配记录对象中每一所述目标对象对应的分配记录元素初始化为0;及When creating the disk array, create the data block allocation record object, and initialize the allocation record element corresponding to each of the target objects in the data block allocation record object to 0; and
    当获取到LUN的数据块申请时,每为所述LUN分配任一所述目标对象中的一个数据块,则对该目标对象对应的所述分配记录元素进行加1操作;及When the data block application of the LUN is obtained, each time a data block in any one of the target objects is allocated to the LUN, the allocation record element corresponding to the target object is incremented by 1; and
    当获取到LUN的数据块释放请求时,每释放所述LUN对应的任一所述目标对象的一个数据块,则对该目标对象对应的所述分配记录元素进行减1操作;及When the data block release request of the LUN is obtained, each time a data block of any one of the target objects corresponding to the LUN is released, the allocation record element corresponding to the target object is decremented by 1; and
    当删除所述磁盘阵列时,则删除所述数据块分配记录对象。When the disk array is deleted, the data block allocation record object is deleted.
  3. 根据权利要求2所述的磁盘阵列重构方法,其特征在于,所述根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN,包括:The disk array reconstruction method according to claim 2, wherein said judging whether the data blocks in any target object are not assigned to corresponding LUNs according to the data block allocation record object comprises:
    判断数据块分配记录对象中任一目标对象对应的所述分配记录元素是否为0;及judging whether the allocation record element corresponding to any target object in the data block allocation record object is 0; and
    若是,则判定该目标对象中的数据块均未分配给相应的LUN;If so, it is determined that none of the data blocks in the target object are allocated to the corresponding LUN;
    否则,判定该目标对象中有数据块分配给相应的LUN。Otherwise, it is determined that there are data blocks allocated to the corresponding LUN in the target object.
  4. 根据权利要求1所述的磁盘阵列重构方法,其特征在于,还包括:The disk array reconstruction method according to claim 1, further comprising:
    在创建所述磁盘阵列时,创建所述数据写入记录位图,并将所述数据写入记录位图中的全部比特位初始化为0;其中,所述数据写入记录位图中每个比特位代表一个所述目标对象的数据写入情况;及When creating the disk array, create the data write record bitmap, and initialize all bits in the data write record bitmap to 0; wherein, each of the data write record bitmap a bit representing data write status of a said target object; and
    在LUN写入数据时,则将有数据写入的所述目标对象在所述数据写入记录位图中对应的比特位置为1。When data is written into the LUN, the bit position corresponding to the target object with data written in the data writing record bitmap is set to 1.
  5. 根据权利要求4所述的磁盘阵列重构方法,其特征在于,所述根据数据写入记录 位图判断所述目标对象中是否有数据写入,包括:Disk array reconfiguration method according to claim 4, is characterized in that, described write record bitmap according to data and judge whether there is data write in described target object, comprise:
    判断所述数据写入记录位图中所述目标对象对应的比特位是否为1;及judging whether the bit corresponding to the target object in the data write record bitmap is 1; and
    若是,则判定所述目标对象中有数据写入;If so, then determine that there is data writing in the target object;
    否则,判定所述目标对象中无数据写入。Otherwise, it is determined that no data is written in the target object.
  6. 根据权利要求4所述的磁盘阵列重构方法,其特征在于,还包括:The disk array reconstruction method according to claim 4, further comprising:
    创建所述数据删除记录位图,并将所述数据删除记录位图中的全部比特位初始化为1;其中,所述数据删除记录位图中每个比特位代表一个所述目标对象的数据删除情况;Create the data deletion record bitmap, and initialize all bits in the data deletion record bitmap to 1; wherein, each bit in the data deletion record bitmap represents a data deletion of the target object Condition;
    在LUN删除数据时,若任一所述目标对象中的数据被全部删除,则将该目标对象在所述数据删除记录位图中对应的比特位置为0;及When the LUN deletes data, if all the data in any of the target objects is deleted, the corresponding bit position of the target object in the data deletion record bitmap is 0; and
    相应的,所述根据数据删除记录位图判断所述目标对象中的数据是否被全部删除,包括:Correspondingly, the judging whether all the data in the target object is deleted according to the data deletion record bitmap includes:
    判断所述目标对象在所述数据删除记录位图中对应的比特位是否为0;及judging whether the corresponding bit of the target object in the data deletion record bitmap is 0; and
    若是,则判定所述目标对象中的数据被全部删除。If yes, it is determined that all data in the target object is deleted.
  7. 根据权利要求6所述的磁盘阵列重构方法,其特征在于,所述在LUN写入数据时,则将有数据写入的所述目标对象在所述数据写入记录位图中对应的比特位置为1之后,还包括:The disk array reconstruction method according to claim 6, wherein when the data is written into the LUN, the corresponding bit in the data write record bitmap of the target object with data written After the position is 1, also include:
    对所述数据写入记录位图以及所述数据删除记录位图进行或运算,得到更新后的数据删除记录位图。An OR operation is performed on the data writing record bitmap and the data deletion record bitmap to obtain an updated data deletion record bitmap.
  8. 一种磁盘阵列重构装置,其特征在于,包括:A disk array reconstruction device is characterized in that it comprises:
    磁盘阵列监控模块,用于监测磁盘阵列是否满足重构条件;The disk array monitoring module is used to monitor whether the disk array meets the reconstruction condition;
    分配记录判断模块,用于当所述磁盘阵列监控模块监测到磁盘阵列满足重构条件,则根据数据块分配记录对象判断任一目标对象中的数据块是否均未分配给相应的LUN;其中,所述目标对象为磁盘阵列重构的基本单位,包括一个或多个条带;若均未分配给相应的LUN,则忽略所述目标对象;Allocation record judging module, used for when the disk array monitoring module detects that the disk array satisfies the reconstruction condition, then judge whether the data blocks in any target object are not allocated to the corresponding LUN according to the data block allocation record object; wherein, The target object is the basic unit of disk array reconstruction, including one or more stripes; if none of them are assigned to the corresponding LUN, then ignore the target object;
    否则触发删除记录判断模块,根据数据删除记录位图判断所述目标对象中的数据是否被全部删除;若所述目标对象中的数据被全部删除,则忽略所述目标对象;Otherwise, the deletion record judging module is triggered to judge whether the data in the target object is all deleted according to the data deletion record bitmap; if the data in the target object is all deleted, then ignore the target object;
    否则触发写入记录判断模块,根据数据写入记录位图判断所述目标对象中是否有数据写入,若否,则忽略所述目标对象;Otherwise, trigger the write record judging module, judge whether there is data writing in the target object according to the data write record bitmap, if not, then ignore the target object;
    若所述目标对象中有数据写入,则启动目标对象重构模块,重构所述目标对象。If there is data written in the target object, start the target object reconstruction module to reconstruct the target object.
  9. 一种电子设备,包括存储器及一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行如权利要 求1-7中任一项所述方法的步骤。An electronic device comprising a memory and one or more processors, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the one or more processors, the one or more processors are executed as claimed in claim 1 - the step of any one of the methods described in 7.
  10. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行如权利要求1-7中任一项所述方法的步骤。One or more non-volatile computer-readable storage media storing computer-readable instructions, which, when executed by one or more processors, cause one or more processors to perform the The steps of any one of the methods.
PCT/CN2022/078100 2021-10-08 2022-02-25 Method and apparatus for reconstructing redundant arrays of independent drives, and device and medium WO2023056728A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111168480.9 2021-10-08
CN202111168480.9A CN113625974A (en) 2021-10-08 2021-10-08 Disk array reconstruction method, device, equipment and medium

Publications (1)

Publication Number Publication Date
WO2023056728A1 true WO2023056728A1 (en) 2023-04-13

Family

ID=78390684

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/078100 WO2023056728A1 (en) 2021-10-08 2022-02-25 Method and apparatus for reconstructing redundant arrays of independent drives, and device and medium

Country Status (2)

Country Link
CN (1) CN113625974A (en)
WO (1) WO2023056728A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113625974A (en) * 2021-10-08 2021-11-09 苏州浪潮智能科技有限公司 Disk array reconstruction method, device, equipment and medium
CN117149094B (en) * 2023-10-30 2024-02-09 苏州元脑智能科技有限公司 Method and device for determining data area state, disk array and storage system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101770413A (en) * 2010-01-07 2010-07-07 杭州华三通信技术有限公司 Method and equipment for rebuilding redundant disk array
US20120159071A1 (en) * 2010-12-17 2012-06-21 Satoshi Kamon Storage subsystem and its logical unit processing method
CN102541472A (en) * 2011-12-31 2012-07-04 杭州宏杉科技有限公司 Method and device for reconstructing RAID (Redundant Array of Independent Disks)
CN104142872A (en) * 2014-08-13 2014-11-12 浪潮电子信息产业股份有限公司 Quick reestablishment method for RAID (redundan array of inexpensive disk)
CN104571965A (en) * 2015-01-19 2015-04-29 浪潮集团有限公司 Raid reconstruction optimizing method
US20160117226A1 (en) * 2014-10-22 2016-04-28 Netapp, Inc. Data recovery technique for recovering data from an object store
CN105549908A (en) * 2015-12-14 2016-05-04 深圳市万拓存储技术有限公司 Method for restoring redundancy for RAID (Redundant Array of Independent Disks) disk array
CN110187830A (en) * 2019-04-22 2019-08-30 中国科学院计算技术研究所 A kind of method and system accelerating disk array reconstruction
CN113625974A (en) * 2021-10-08 2021-11-09 苏州浪潮智能科技有限公司 Disk array reconstruction method, device, equipment and medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7231409B1 (en) * 2003-03-21 2007-06-12 Network Appliance, Inc. System and method for reallocating blocks in checkpointing bitmap-based file systems
CN102511031B (en) * 2009-09-24 2015-11-25 国际商业机器公司 The data of bitmap are used to store
WO2015030679A1 (en) * 2013-08-27 2015-03-05 Agency For Science, Technology And Research Raid parity stripe reconstruction
CN107220184B (en) * 2017-05-10 2019-07-09 杭州宏杉科技股份有限公司 A kind of management method and device of LUN storage unit
US11481364B2 (en) * 2019-12-16 2022-10-25 Alibaba Group Holding Limited Row-column formatting for relational databases

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101770413A (en) * 2010-01-07 2010-07-07 杭州华三通信技术有限公司 Method and equipment for rebuilding redundant disk array
US20120159071A1 (en) * 2010-12-17 2012-06-21 Satoshi Kamon Storage subsystem and its logical unit processing method
CN102541472A (en) * 2011-12-31 2012-07-04 杭州宏杉科技有限公司 Method and device for reconstructing RAID (Redundant Array of Independent Disks)
CN104142872A (en) * 2014-08-13 2014-11-12 浪潮电子信息产业股份有限公司 Quick reestablishment method for RAID (redundan array of inexpensive disk)
US20160117226A1 (en) * 2014-10-22 2016-04-28 Netapp, Inc. Data recovery technique for recovering data from an object store
CN104571965A (en) * 2015-01-19 2015-04-29 浪潮集团有限公司 Raid reconstruction optimizing method
CN105549908A (en) * 2015-12-14 2016-05-04 深圳市万拓存储技术有限公司 Method for restoring redundancy for RAID (Redundant Array of Independent Disks) disk array
CN110187830A (en) * 2019-04-22 2019-08-30 中国科学院计算技术研究所 A kind of method and system accelerating disk array reconstruction
CN113625974A (en) * 2021-10-08 2021-11-09 苏州浪潮智能科技有限公司 Disk array reconstruction method, device, equipment and medium

Also Published As

Publication number Publication date
CN113625974A (en) 2021-11-09

Similar Documents

Publication Publication Date Title
CN110531940B (en) Video file processing method and device
US10126946B1 (en) Data protection object store
US10852981B2 (en) System for migrating virtual tape volumes between filesystems
WO2023056728A1 (en) Method and apparatus for reconstructing redundant arrays of independent drives, and device and medium
US9104626B2 (en) Processing a copy command directed to a first storage architecture for data that is stored in a second storage architecture
US8438136B2 (en) Backup catalog recovery from replicated data
US8370593B2 (en) Method and apparatus to manage groups for deduplication
US9558079B2 (en) Flash copy for disaster recovery (DR) testing
US20060136691A1 (en) Method to perform parallel data migration in a clustered storage environment
US20140344222A1 (en) Method and apparatus for replication size estimation and progress monitoring
US20060047926A1 (en) Managing multiple snapshot copies of data
US20120124285A1 (en) Virtual disk drive system and method with cloud-based storage media
JP2005301497A (en) Storage management system, restoration method and its program
JP2013011919A (en) Storage apparatus and snapshot control method of the same
KR20130083356A (en) A method for metadata persistence
US9898370B2 (en) Flash copy for disaster recovery (DR) testing
US8140886B2 (en) Apparatus, system, and method for virtual storage access method volume data set recovery
WO2014094568A1 (en) Data storage planning method and device
JP2005050024A (en) Computer system and program
US20220129346A1 (en) Data processing method and apparatus in storage system, and storage system
US20120047108A1 (en) Point-in-time (pit) based thin reclamation support for systems with a storage usage map api
WO2020134143A1 (en) Stripe reconstruction method in storage system and striping server
WO2023207132A1 (en) Data storage method and apparatus, and device and medium
CN111444114B (en) Method, device and system for processing data in nonvolatile memory
JP2002055783A (en) Inter-disk copy processor and copy processing method and program allowing the same method to be performed by computer and computer readable recording medium with its program recorded

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: 22877755

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE