CN113805799A - Method, device and equipment for managing latest write records of RAID (redundant array of independent disk) array and readable medium - Google Patents

Method, device and equipment for managing latest write records of RAID (redundant array of independent disk) array and readable medium Download PDF

Info

Publication number
CN113805799A
CN113805799A CN202110905106.6A CN202110905106A CN113805799A CN 113805799 A CN113805799 A CN 113805799A CN 202110905106 A CN202110905106 A CN 202110905106A CN 113805799 A CN113805799 A CN 113805799A
Authority
CN
China
Prior art keywords
region
value
integer array
area
array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110905106.6A
Other languages
Chinese (zh)
Other versions
CN113805799B (en
Inventor
苏涛
王君宝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202110905106.6A priority Critical patent/CN113805799B/en
Publication of CN113805799A publication Critical patent/CN113805799A/en
Application granted granted Critical
Publication of CN113805799B publication Critical patent/CN113805799B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • G06F3/0622Securing storage systems in relation to access
    • 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/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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

The invention provides a method, a device, equipment and a readable medium for managing metadata of a latest write record of a RAID array, wherein the method comprises the following steps: establishing an integer array with a threshold value, dividing the integer array into three areas, and initializing the integer array; in response to the completion of the initialization of the integer array, modifying the value of the first area in the integer array into a preset value; storing the stripe number of the last write IO into a third area of the integer array based on the value of the first area, and adding 1 to the value of the first area; in response to receiving an instruction to obtain a last write IO stripe number, the last write IO stripe number is stored from the third region into the second region based on a value of the first region, and a corresponding position in the third region is assigned to 0 and a value of the first region is decremented by 1. By using the scheme of the invention, the speed of detecting the disk which is recently written and inspected can be effectively improved, the safety and fault-tolerant capability of RAID stored data can be effectively improved, and the performance and stability of the RAID can be ensured.

Description

Method, device and equipment for managing latest write records of RAID (redundant array of independent disk) array and readable medium
Technical Field
The field relates to the field of computers, and more particularly to a method, apparatus, device and readable medium for metadata management of recently written records of a RAID array.
Background
RAID (redundant array of independent disks) is an array of independent redundant disks consisting of a large number of disks, and the stability of disk operation is an important prerequisite for ensuring data security. In order to find out the silence problem caused by magnetic weakening or medium damage of a disk in time, a RAID usually starts a latest write polling task to detect the position of a latest write IO, which requires that the RAID needs to record the stripe number of the latest write IO.
In order to record the IO written recently, the RAID encapsulates the stripe number and the processing time of the IO written into a data structure object, and then stores the encapsulated structure body into a circular queue with a size of 1024. When the routing inspection task acquires a routing inspection position, 1024 structures in the queue need to be traversed first, processing time recorded by each structure is compared, and IO with the latest processing time but not yet being routed is found out. When the metadata management method for the latest write record searches for IO strip numbers, because the whole queue needs to be traversed and each structure body needs to be compared one by one, the time consumption is too long, and the loss of performance is large.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a readable medium for managing metadata of a last write record of a RAID array, where by using the technical solution of the present invention, a speed of detecting a disk of a last write patrol can be effectively increased, security and fault tolerance of RAID storage data can be effectively improved, and performance and stability of the RAID can be ensured.
In view of the above object, an aspect of the embodiments of the present invention provides a method for metadata management of recently written records of a RAID array, comprising the steps of:
establishing an integer array with a threshold value, dividing the integer array into three areas, and initializing the integer array;
in response to the completion of the initialization of the integer array, modifying the value of the first area in the integer array into a preset value;
storing the stripe number of the last write IO into a third area of the integer array based on the value of the first area, and adding 1 to the value of the first area;
in response to receiving an instruction to obtain a last write IO stripe number, the last write IO stripe number is stored from the third region into the second region based on a value of the first region, and a corresponding position in the third region is assigned to 0 and a value of the first region is decremented by 1.
According to one embodiment of the present invention, initializing the integer array after creating the integer array of the threshold size and dividing the integer array into three regions comprises:
creating an integer array with the size of 1024;
dividing the 0 th bit in the integer array into a first area for recording the storage position of the last write IO stripe number;
dividing the 1 st to 16 th bits in the integer array into a second area for storing the serial number of the strip which is inspecting the IO;
bits 17-1023 of the integer array are divided into storage areas for storing the stripe number of the most recently written IO.
According to one embodiment of the present invention, modifying the value of the first area in the integer array to a preset value in response to the completion of the initialization of the integer array comprises:
all the positions in the integer array are set to be 0;
the value of the first zone is modified to 16.
According to an embodiment of the present invention, storing the stripe number of the last write IO in a third region of the integer array based on the value of the first region, and adding 1 to the value of the first region comprises:
reading a current value of the first region;
storing the serial number of the last write IO to the position of adding 1 to the current value in the third area;
the current value of the first field is incremented by 1.
According to an embodiment of the present invention, further comprising:
judging whether the current value of the first area is 1023;
in response to the current value of the first region being 1023, the value of the first region is reassigned to 16.
According to an embodiment of the present invention, in response to receiving an instruction to obtain a last write IO stripe number, storing the last write IO stripe number from the third region into the second region based on a value of the first region, and assigning a corresponding position in the third region to be 0 and subtracting the value of the first region by 1 includes:
reading a current value of the first region;
reading the IO strip number stored in the third area based on the current value of the first area, and adding the read IO strip number to the position with the median value of 0 in the second area for storage;
the read IO stripe number is removed from the third region, and the value of the first region is decremented by 1.
According to an embodiment of the present invention, reading the IO stripe number stored in the third region based on the current value of the first region, and adding the read IO stripe number to the position with a value of 0 in the second region for saving includes:
searching a position with a value of 0 from the last bit to the first bit in the second area;
the read IO stripe number is added to the found location with the first value of 0.
In another aspect of the embodiments of the present invention, there is also provided an apparatus for metadata management of recently written records of a RAID array, the apparatus including:
the dividing module is configured to create an integer array with a threshold value, divide the integer array into three regions and initialize the integer array;
the initialization module is configured to respond to the completion of initialization of the integer array and modify the value of a first area in the integer array into a preset value;
a storage module configured to store a stripe number of a last write IO into a third region of the integer array based on the value of the first region, and add 1 to the value of the first region;
and the obtaining module is configured to store the last write IO stripe number from the third region into the second region based on the value of the first region in response to receiving the instruction for obtaining the last write IO stripe number, assign a corresponding position in the third region to be 0, and subtract 1 from the value of the first region.
In another aspect of an embodiment of the present invention, there is also provided a computer apparatus including:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of any of the methods described above.
In another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps of any one of the above-mentioned methods.
The invention has the following beneficial technical effects: the method for managing the metadata of the latest write record of the RAID array comprises the steps of establishing an integer array with a threshold value, dividing the integer array into three areas and initializing the integer array; in response to the completion of the initialization of the integer array, modifying the value of the first area in the integer array into a preset value; storing the stripe number of the last write IO into a third area of the integer array based on the value of the first area, and adding 1 to the value of the first area; in response to receiving the instruction for obtaining the last write IO stripe number, the last write IO stripe number is stored in the second area from the third area based on the value of the first area, the corresponding position in the third area is assigned to be 0, and the value of the first area is reduced by 1.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a method of metadata management for recently written records of a RAID array in accordance with one embodiment of the present invention;
FIG. 2 is a schematic diagram of an apparatus for metadata management of recently written records of a RAID array in accordance with one embodiment of the present invention;
FIG. 3 is a schematic diagram of a computer device according to one embodiment of the present invention;
fig. 4 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
In view of the above objects, a first aspect of embodiments of the present invention proposes an embodiment of a method for write IO (input output) based on RAID striping. Fig. 1 shows a schematic flow diagram of the method.
As shown in fig. 1, the method may include the steps of:
s1 creates an integer array of a threshold size and initializes the integer array after dividing the integer array into three regions.
When the RAID is initialized, simultaneously establishing an integer array with the size of 1024, and regionalizing the integer array, wherein the array [0] is divided into a first area, namely a vernier area, which is used for recording the storage position of the last write IO strip number in a storage area; the array [1-16] is divided into a second area, namely a buffer area, and is used for storing the serial number of the strip which is patrolling IO; array [17-1023] is partitioned into a third region, the storage region, which holds the stripe number of the most recently written IO.
S2, responding to the completion of the initialization of the integer array, and modifying the value of the first area in the integer array to a preset value.
The integer array initialization initializes all the element values in the array to 0, so that all the elements in the buffer area and the storage area representing the write IO stripe number are initialized to 0, and then the stored value in the cursor area is modified to 16, so that when the write IO stripe number needs to be recorded, the value is added by one to be the calculated position to be 17, which is just the initial position of the storage area.
S3 stores the stripe number of the last write IO into a third region of the integer array based on the value of the first region and increments the value of the first region by 1.
And acquiring the value of the first region, namely reading the storage position of the last write IO strip number in the storage region from the vernier region, then adding 1 to the read storage position to obtain the position of the current storage IO strip number, then storing the IO strip number at the position of the storage region, after the storage is finished, updating the current write IO storage position to the vernier region, namely adding 1 to the acquired value of the first region, and if the calculated current storage position is 1023, modifying the vernier region record value to 16 in order to ensure that the IO strip number is stored at the initial position (with the index of 17) of the storage region of the next meeting.
S4, in response to receiving the instruction to obtain the last write IO stripe number, stores the last write IO stripe number from the third region into the second region based on the value of the first region, assigns a corresponding position in the third region to 0, and subtracts 1 from the value of the first region.
The method comprises the steps of obtaining a value of a first area, namely reading a storage position of a last write IO strip number in a storage area from a cursor area, reading a stored IO strip number from the position of the storage area, wherein the strip number is a write IO record needing to be executed by recent write patrol, adding the obtained strip number into a buffer area, finding a position with a storage value of 0 in the buffer area for storage, and storing the position with the storage value from back to front, namely, from the 17 th bit to the 1 st bit in a reverse order for searching and storing, wherein the storage mode is to quickly find the IO strip number when the write IO strip number is deleted, then removing the obtained strip number from the storage area, and simultaneously subtracting 1 from a value stored in the cursor area to indicate that the IO strip number is taken from the storage area for execution. After the latest write patrol task detects that the consistency of the stripes is completed, the write IO stripe numbers recorded in the metadata need to be deleted, when the write IO stripe numbers are obtained, the values are stored in the buffer area, the buffer area is traversed according to the sequence from back to front, the IO stripe numbers needing to be deleted are found, and because the IO stripe numbers are stored in a back-to-front mode, the traversal mode can accelerate the query speed, the position where the write IO stripe numbers are found is assigned to be 0, and the IO stripe numbers are shown to be removed from the metadata.
By the technical scheme, the speed of detecting the disk which is recently written and inspected can be effectively increased, the safety and fault-tolerant capability of RAID stored data are effectively improved, and the performance and stability of the RAID are ensured.
In a preferred embodiment of the present invention, initializing the integer array after creating the threshold size integer array and dividing the integer array into three regions comprises:
creating an integer array with the size of 1024;
dividing the 0 th bit in the integer array into a first area for recording the storage position of the last write IO stripe number;
dividing the 1 st to 16 th bits in the integer array into a second area for storing the serial number of the strip which is inspecting the IO;
bits 17-1023 of the integer array are divided into storage areas for storing the stripe number of the most recently written IO.
In a preferred embodiment of the present invention, modifying the value of the first area in the integer array to a preset value in response to the integer array initialization completing comprises:
all the positions in the integer array are set to be 0;
the value of the first zone is modified to 16. All elements are initialized to 0, so that all elements in the buffer area and the storage area which represent the write IO stripe number are initialized to 0, and the value stored in the cursor area is modified to be 16, so that when the write IO stripe number needs to be recorded, the calculated position of the value plus one is 17, which is just the initial position of the storage area.
In a preferred embodiment of the present invention, storing the stripe number of the last write IO in a third region of the integer array based on the value of the first region, and adding 1 to the value of the first region comprises:
reading a current value of the first region;
storing the serial number of the last write IO to the position of adding 1 to the current value in the third area;
the current value of the first field is incremented by 1.
In a preferred embodiment of the present invention, the method further comprises:
judging whether the current value of the first area is 1023;
in response to the current value of the first region being 1023, the value of the first region is reassigned to 16. If the current storage position is 1023, in order to ensure that the IO strip number is stored at the starting position (with the index of 17) of the storage area of the next time, the cursor area record value is modified to be 16.
In a preferred embodiment of the present invention, in response to receiving an instruction to obtain a last write IO stripe number, storing the last write IO stripe number from the third region into the second region based on the value of the first region, and assigning a corresponding position in the third region to be 0 and subtracting the value of the first region by 1 includes:
reading a current value of the first region;
reading the IO strip number stored in the third area based on the current value of the first area, and adding the read IO strip number to the position with the median value of 0 in the second area for storage;
the read IO stripe number is removed from the third region, and the value of the first region is decremented by 1.
In a preferred embodiment of the present invention, reading the IO stripe number stored in the third region based on the current value of the first region, and adding the read IO stripe number to the position with a value of 0 in the second region for saving includes:
searching a position with a value of 0 from the last bit to the first bit in the second area;
the read IO stripe number is added to the found location with the first value of 0.
By the technical scheme, the speed of detecting the disk which is recently written and inspected can be effectively increased, the safety and fault-tolerant capability of RAID stored data are effectively improved, and the performance and stability of the RAID are ensured.
It should be noted that, as will be understood by those skilled in the art, all or part of the processes in the methods of the above embodiments may be implemented by instructing relevant hardware through a computer program, and the above programs may be stored in a computer-readable storage medium, and when executed, the programs may include the processes of the embodiments of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the above-described functions defined in the method disclosed in the embodiments of the present invention.
In view of the above object, according to a second aspect of the embodiments of the present invention, there is provided an apparatus for managing metadata of recently written records in a RAID array, as shown in fig. 2, the apparatus 200 includes:
the dividing module is configured to create an integer array with a threshold value, divide the integer array into three regions and initialize the integer array;
the initialization module is configured to respond to the completion of initialization of the integer array and modify the value of a first area in the integer array into a preset value;
the storage module is configured to store the stripe number of the last write IO into a third area of the integer array based on the value of the first area, and add 1 to the value of the first area;
and the obtaining module is configured to store the last write IO stripe number from the third region into the second region based on the value of the first region in response to receiving the instruction for obtaining the last write IO stripe number, assign a corresponding position in the third region to be 0, and subtract 1 from the value of the first region.
In a preferred embodiment of the present invention, the dividing module is further configured to:
creating an integer array with the size of 1024;
dividing the 0 th bit in the integer array into a first area for recording the storage position of the last write IO stripe number;
dividing the 1 st to 16 th bits in the integer array into a second area for storing the serial number of the strip which is inspecting the IO;
bits 17-1023 of the integer array are divided into storage areas for storing the stripe number of the most recently written IO.
In a preferred embodiment of the present invention, the initialization module is further configured to:
all the positions in the integer array are set to be 0;
the value of the first zone is modified to 16.
In a preferred embodiment of the present invention, the storage module is further configured to:
reading a current value of the first region;
storing the serial number of the last write IO to the position of adding 1 to the current value in the third area;
the current value of the first field is incremented by 1.
In a preferred embodiment of the present invention, the apparatus further includes a determining module, and the determining module is configured to:
judging whether the current value of the first area is 1023;
in response to the current value of the first region being 1023, the value of the first region is reassigned to 16.
In a preferred embodiment of the present invention, the obtaining module is further configured to:
reading a current value of the first region;
reading the IO strip number stored in the third area based on the current value of the first area, and adding the read IO strip number to the position with the median value of 0 in the second area for storage;
the read IO stripe number is removed from the third region, and the value of the first region is decremented by 1.
In a preferred embodiment of the present invention, the obtaining module is further configured to:
searching a position with a value of 0 from the last bit to the first bit in the second area;
the read IO stripe number is added to the found location with the first value of 0.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 3, an embodiment of the present invention includes the following means: at least one processor S21; and a memory S22, the memory S22 storing computer instructions S23 executable on the processor, the instructions when executed by the processor implementing the method of:
establishing an integer array with a threshold value, dividing the integer array into three areas, and initializing the integer array;
in response to the completion of the initialization of the integer array, modifying the value of the first area in the integer array into a preset value;
storing the stripe number of the last write IO into a third area of the integer array based on the value of the first area, and adding 1 to the value of the first area;
in response to receiving an instruction to obtain a last write IO stripe number, the last write IO stripe number is stored from the third region into the second region based on a value of the first region, and a corresponding position in the third region is assigned to 0 and a value of the first region is decremented by 1.
In a preferred embodiment of the present invention, initializing the integer array after creating the threshold size integer array and dividing the integer array into three regions comprises:
creating an integer array with the size of 1024;
dividing the 0 th bit in the integer array into a first area for recording the storage position of the last write IO stripe number;
dividing the 1 st to 16 th bits in the integer array into a second area for storing the serial number of the strip which is inspecting the IO;
bits 17-1023 of the integer array are divided into storage areas for storing the stripe number of the most recently written IO.
In a preferred embodiment of the present invention, modifying the value of the first area in the integer array to a preset value in response to the integer array initialization completing comprises:
all the positions in the integer array are set to be 0;
the value of the first zone is modified to 16.
In a preferred embodiment of the present invention, storing the stripe number of the last write IO in a third region of the integer array based on the value of the first region, and adding 1 to the value of the first region comprises:
reading a current value of the first region;
storing the serial number of the last write IO to the position of adding 1 to the current value in the third area;
the current value of the first field is incremented by 1.
In a preferred embodiment of the present invention, the method further comprises:
judging whether the current value of the first area is 1023;
in response to the current value of the first region being 1023, the value of the first region is reassigned to 16.
In a preferred embodiment of the present invention, in response to receiving an instruction to obtain a last write IO stripe number, storing the last write IO stripe number from the third region into the second region based on the value of the first region, and assigning a corresponding position in the third region to be 0 and subtracting the value of the first region by 1 includes:
reading a current value of the first region;
reading the IO strip number stored in the third area based on the current value of the first area, and adding the read IO strip number to the position with the median value of 0 in the second area for storage;
the read IO stripe number is removed from the third region, and the value of the first region is decremented by 1.
In a preferred embodiment of the present invention, reading the IO stripe number stored in the third region based on the current value of the first region, and adding the read IO stripe number to the position with a value of 0 in the second region for saving includes:
searching a position with a value of 0 from the last bit to the first bit in the second area;
the read IO stripe number is added to the found location with the first value of 0.
In view of the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. FIG. 4 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 4, the computer readable storage medium S31 stores a computer program S32 that when executed by a processor performs the method of:
establishing an integer array with a threshold value, dividing the integer array into three areas, and initializing the integer array;
in response to the completion of the initialization of the integer array, modifying the value of the first area in the integer array into a preset value;
storing the stripe number of the last write IO into a third area of the integer array based on the value of the first area, and adding 1 to the value of the first area;
in response to receiving an instruction to obtain a last write IO stripe number, the last write IO stripe number is stored from the third region into the second region based on a value of the first region, and a corresponding position in the third region is assigned to 0 and a value of the first region is decremented by 1.
In a preferred embodiment of the present invention, initializing the integer array after creating the threshold size integer array and dividing the integer array into three regions comprises:
creating an integer array with the size of 1024;
dividing the 0 th bit in the integer array into a first area for recording the storage position of the last write IO stripe number;
dividing the 1 st to 16 th bits in the integer array into a second area for storing the serial number of the strip which is inspecting the IO;
bits 17-1023 of the integer array are divided into storage areas for storing the stripe number of the most recently written IO.
In a preferred embodiment of the present invention, modifying the value of the first area in the integer array to a preset value in response to the integer array initialization completing comprises:
all the positions in the integer array are set to be 0;
the value of the first zone is modified to 16.
In a preferred embodiment of the present invention, storing the stripe number of the last write IO in a third region of the integer array based on the value of the first region, and adding 1 to the value of the first region comprises:
reading a current value of the first region;
storing the serial number of the last write IO to the position of adding 1 to the current value in the third area;
the current value of the first field is incremented by 1.
In a preferred embodiment of the present invention, the method further comprises:
judging whether the current value of the first area is 1023;
in response to the current value of the first region being 1023, the value of the first region is reassigned to 16.
In a preferred embodiment of the present invention, in response to receiving an instruction to obtain a last write IO stripe number, storing the last write IO stripe number from the third region into the second region based on the value of the first region, and assigning a corresponding position in the third region to be 0 and subtracting the value of the first region by 1 includes:
reading a current value of the first region;
reading the IO strip number stored in the third area based on the current value of the first area, and adding the read IO strip number to the position with the median value of 0 in the second area for storage;
the read IO stripe number is removed from the third region, and the value of the first region is decremented by 1.
In a preferred embodiment of the present invention, reading the IO stripe number stored in the third region based on the current value of the first region, and adding the read IO stripe number to the position with a value of 0 in the second region for saving includes:
searching a position with a value of 0 from the last bit to the first bit in the second area;
the read IO stripe number is added to the found location with the first value of 0.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method for metadata management of recently written records of a RAID array, comprising the steps of:
establishing an integer array with a threshold value, dividing the integer array into three areas, and initializing the integer array;
in response to the completion of the initialization of the integer array, modifying the value of a first area in the integer array to a preset value;
storing a stripe number of a last write IO into a third region of the integer array based on the value of the first region, and adding 1 to the value of the first region;
and in response to receiving an instruction for acquiring the last write IO stripe number, storing the last write IO stripe number from the third region into the second region based on the value of the first region, assigning a corresponding position in the third region to be 0, and subtracting 1 from the value of the first region.
2. The method of claim 1, wherein initializing the integer array after creating the threshold size integer array and dividing the integer array into three regions comprises:
creating an integer array with the size of 1024;
dividing the 0 th bit in the integer array into a first area for recording the storage position of the last write IO stripe number;
dividing the 1 st to 16 th bits in the integer array into a second area for storing the serial number of the strip which is inspecting the IO;
bits 17-1023 of the integer array are divided into storage areas for storing the stripe number of the most recently written IO.
3. The method of claim 2, wherein modifying the value of the first region in the integer array to a preset value in response to the integer array initialization completing comprises:
all the positions in the integer array are set to be 0;
the value of the first zone is modified to 16.
4. The method of claim 3, wherein storing a stripe number of a last write IO into a third region of the integer array based on a value of the first region, and wherein adding 1 to the value of the first region comprises:
reading a current value of the first region;
storing the serial number of the last write IO to the position of adding 1 to the current value in the third area;
adding 1 to the current value of the first field.
5. The method of claim 4, further comprising:
judging whether the current value of the first area is 1023;
in response to the current value of the first region being 1023, the value of the first region is reassigned to 16.
6. The method of claim 1, wherein in response to receiving an instruction to obtain a last write IO stripe number, storing the last write IO stripe number from the third region into the second region based on the value of the first region, and assigning a corresponding location in the third region to be 0 and subtracting the value of the first region by 1 comprises:
reading a current value of the first region;
reading the IO strip number stored in the third region based on the current value of the first region, and adding the read IO strip number to the position with the median value of 0 in the second region for storage;
and removing the read IO strip number from the third area, and subtracting 1 from the value of the first area.
7. The method of claim 6, wherein reading the IO stripe number stored in the third region based on the current value of the first region, and adding the read IO stripe number to the position with the value of 0 in the second region for saving comprises:
searching a position with a value of 0 from the last bit to the first bit in the second area;
the read IO stripe number is added to the found location with the first value of 0.
8. An apparatus for metadata management of recently written records of a RAID array, the apparatus comprising:
the device comprises a dividing module, a judging module and a judging module, wherein the dividing module is configured to create an integer array with a threshold value, divide the integer array into three regions and initialize the integer array;
the initialization module is configured to respond to the completion of initialization of the integer array and modify the value of a first area in the integer array into a preset value;
a storage module configured to store a stripe number of a last write IO into a third region of the integer array based on a value of the first region and add 1 to the value of the first region;
an obtaining module configured to, in response to receiving an instruction to obtain a last write IO stripe number, store the last write IO stripe number from the third region to the second region based on the value of the first region, assign a corresponding position in the third region to 0, and subtract 1 from the value of the first region.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202110905106.6A 2021-08-08 2021-08-08 Method, device, equipment and readable medium for RAID array latest write record management Active CN113805799B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110905106.6A CN113805799B (en) 2021-08-08 2021-08-08 Method, device, equipment and readable medium for RAID array latest write record management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110905106.6A CN113805799B (en) 2021-08-08 2021-08-08 Method, device, equipment and readable medium for RAID array latest write record management

Publications (2)

Publication Number Publication Date
CN113805799A true CN113805799A (en) 2021-12-17
CN113805799B CN113805799B (en) 2023-08-11

Family

ID=78942822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110905106.6A Active CN113805799B (en) 2021-08-08 2021-08-08 Method, device, equipment and readable medium for RAID array latest write record management

Country Status (1)

Country Link
CN (1) CN113805799B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104679442A (en) * 2013-12-02 2015-06-03 中兴通讯股份有限公司 Method and device for improving performance of disk array
US20200133536A1 (en) * 2018-10-31 2020-04-30 EMC IP Holding Company LLC Method, apparatus for managing the redundant array of independent disks (raid) and related computer readable medium
CN112148221A (en) * 2020-09-18 2020-12-29 北京浪潮数据技术有限公司 Method, device, equipment and storage medium for routing inspection of redundant array of disks
CN112466382A (en) * 2020-10-17 2021-03-09 苏州浪潮智能科技有限公司 RAID array inspection method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104679442A (en) * 2013-12-02 2015-06-03 中兴通讯股份有限公司 Method and device for improving performance of disk array
US20200133536A1 (en) * 2018-10-31 2020-04-30 EMC IP Holding Company LLC Method, apparatus for managing the redundant array of independent disks (raid) and related computer readable medium
CN112148221A (en) * 2020-09-18 2020-12-29 北京浪潮数据技术有限公司 Method, device, equipment and storage medium for routing inspection of redundant array of disks
CN112466382A (en) * 2020-10-17 2021-03-09 苏州浪潮智能科技有限公司 RAID array inspection method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
孙志卓;张全新;李元章;谭毓安;刘靖宇;马忠梅;: "连续数据存储中面向RAID5的写操作优化设计", 计算机研究与发展, no. 08 *

Also Published As

Publication number Publication date
CN113805799B (en) 2023-08-11

Similar Documents

Publication Publication Date Title
CN108647151B (en) Full flash system metadata disk-dropping method, device, equipment and storage medium
US9767035B2 (en) Pass-through tape access in a disk storage environment
CN110096227B (en) Data storage method, data processing device, electronic equipment and computer readable medium
CN110727404A (en) Data deduplication method and device based on storage end and storage medium
CN113282249B (en) Data processing method, system, device and medium
US20180210784A1 (en) Metadata Recovery Method and Apparatus
WO2016082559A1 (en) Data writing method and storage device
CN113608695A (en) Data processing method, system, device and medium
US10042570B2 (en) Tape backup and restore in a disk storage environment with intelligent data placement
CN107798063B (en) Snapshot processing method and snapshot processing device
CN102959548A (en) Data storage method, search method and device
CN114138181B (en) Method, device, equipment and readable medium for binding pool placement group owner selection
CN113608672A (en) Data synchronization method, device, equipment and readable medium
CN113805799A (en) Method, device and equipment for managing latest write records of RAID (redundant array of independent disk) array and readable medium
CN114281242B (en) Memory load balancing method, device and equipment
CN113805800B (en) RAID stripe-based IO writing method, device, equipment and readable medium
CN111209304B (en) Data processing method, device and system
CN114661243A (en) Method, device, equipment and medium suitable for adjusting visible capacity of SSD
CN113867622B (en) Method, device and equipment for improving snapshot read-write speed and readable medium
CN112130770B (en) Maintenance data storage method, system, equipment and medium
CN113806125B (en) Method, device, equipment and readable medium for processing unloaded volume exception
CN113467716B (en) Method, device, equipment and readable medium for data storage
CN111984551B (en) Cache consistency processing method, device, equipment and readable medium
CN115390758A (en) Method, device, equipment and medium for improving volume migration efficiency of RAID card
CN114676147A (en) Object storage information statistical method, device, equipment and readable medium

Legal Events

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