CN109597573B - Management metadata reading method and device - Google Patents

Management metadata reading method and device Download PDF

Info

Publication number
CN109597573B
CN109597573B CN201811424754.4A CN201811424754A CN109597573B CN 109597573 B CN109597573 B CN 109597573B CN 201811424754 A CN201811424754 A CN 201811424754A CN 109597573 B CN109597573 B CN 109597573B
Authority
CN
China
Prior art keywords
backup
address field
main
address
segment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811424754.4A
Other languages
Chinese (zh)
Other versions
CN109597573A (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.)
Macrosan Technologies Co Ltd
Original Assignee
Macrosan Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Macrosan Technologies Co Ltd filed Critical Macrosan Technologies Co Ltd
Priority to CN201811424754.4A priority Critical patent/CN109597573B/en
Publication of CN109597573A publication Critical patent/CN109597573A/en
Application granted granted Critical
Publication of CN109597573B publication Critical patent/CN109597573B/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/062Securing storage systems
    • G06F3/0623Securing storage systems in relation to content
    • 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/065Replication mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD

Landscapes

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

Abstract

The application provides a method and a device for reading management metadata, wherein the method comprises the following steps: when a reading instruction carrying a reading address field and a data type is received, if the data type is management metadata, searching a main address field which has intersection with the reading address field from a backup table; determining a main address field to be read and a backup address field to be read from the searched main address field and the corresponding backup address field according to the read address field; if the data state of the main address field is valid, reading the management metadata from the main address field to be read; if the data state of the main address field is invalid but the data state of the backup address field is valid, reading the management metadata from the backup address field to be read; the primary address segment and the backup address segment are the same in size and are located in different RAIDs. When the RAID where the main address field is located fails, the management metadata can be read from the backup address field corresponding to the main address field, so that the successful reading probability can be improved through the backup space, the whole reading process is not aware of services, and the realization is simple and efficient.

Description

Management metadata reading method and device
Technical Field
The present application relates to the field of data storage technologies, and in particular, to a method and an apparatus for reading management metadata.
Background
With the emergence of big data application, it is very important to the storage and management of mass data. Generally, a storage device generates management metadata of a space mapping table during RAID (Redundant Arrays of Independent Drives) creation and LUN (Logical Unit Number) re-creation on the created RAID, and also generates management metadata such as an operation log, difference data, snapshot data, and the like when the storage device implements a data protection mechanism through dual active, copy, and snapshot services. If the space mapping table in the management metadata is lost, the front-end server cannot read and write data in the storage device, and if the operation log, the difference data, the snapshot data and the like in the management metadata are lost, the data protection mechanism is invalid. Protection and successful reading of the management metadata therefore become a key issue for the storage device to achieve data security and reliability.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for reading management metadata, so as to solve the problem of how to protect and successfully read the management metadata, so as to improve data security and reliability.
According to a first aspect of embodiments of the present application, there is provided a method for managing metadata reading, the method including:
when a reading instruction carrying a reading address field and a data type is received, if the data type is management metadata, searching a main address field which has intersection with the reading address field from a pre-established backup table, wherein the backup table comprises data states of the main address field and data states of the backup address field and the backup address field;
determining a main address field to be read and a backup address field to be read from the searched main address field and the backup address field corresponding to the main address field according to the read address field;
if the data state of the main address field is valid, reading management metadata from the main address field to be read;
if the data state of the main address field is invalid but the data state of the backup address field is valid, reading management metadata from the backup address field to be read;
the main address field and the backup address field corresponding to the main address field have the same size and are located in different RAID.
According to a second aspect of embodiments of the present application, there is provided a management metadata reading apparatus, the apparatus including:
the device comprises a searching unit, a judging unit and a judging unit, wherein the searching unit is used for searching a main address field which has intersection with a read address field from a pre-established backup table if the data type is management metadata when receiving a read instruction carrying the read address field and the data type, and the backup table comprises data states of the main address field and data states of the backup address field and the backup address field;
a determining unit, configured to determine, according to the read address segment, a main address segment to be read and a backup address segment to be read from the searched main address segment and a backup address segment corresponding to the main address segment;
the first reading unit is used for reading the management metadata from the main address field to be read when the data state of the main address field is valid;
the second reading unit is used for reading the management metadata from the backup address field to be read when the data state of the main address field is invalid but the data state of the backup address field is valid;
the main address field and the backup address field corresponding to the main address field have the same size and are located in different RAID.
By applying the embodiment of the application, when a reading instruction carrying a reading address field and a data type is received, if the data type is management metadata, a main address field intersected with the reading address field is searched from a pre-established backup table, then a main address field to be read and a backup address field to be read are determined from the searched main address field and the backup address field corresponding to the main address field according to the reading address field, and during reading, if the data state of the main address field is valid, the management metadata are read from the main address field to be read; and if the data state of the main address field is invalid but the data state of the backup address field is valid, reading the management metadata from the backup address field to be read.
Because the backup table contains a main address field visible to the service and a backup address field invisible to the service, and the main address field and the backup address field are located on different RAIDs, when various services (such as LUN, copy, snapshot, double active, etc.) execute reading management metadata, when the RAID where the main address field is located fails (data state is invalid), the management metadata can be read from the backup address field corresponding to the main address field, so that the successful reading probability can be improved through the backup space, and the whole reading process is unaware of the service, thereby realizing simplicity and high efficiency. In addition, the backup address field with the same size is arranged for the main address field, the management metadata can be protected, the data type of the data to be read can be carried in the read command, whether the management metadata or the user data are read can be quickly judged, all the read commands do not need to search the backup table, and therefore the IO processing efficiency can be improved.
Drawings
FIG. 1 is a flow diagram illustrating an embodiment of a method for managing metadata reads in accordance with one illustrative embodiment;
FIG. 2A is a flow diagram illustrating an embodiment of another method for managing metadata reads according to an illustrative embodiment of the present application;
FIG. 2B is a schematic illustration of a space allocation according to the embodiment shown in FIG. 2A;
FIG. 2C is a schematic view of the application showing a space exclusion according to the embodiment of FIG. 2A;
FIG. 3 is a diagram illustrating a hardware configuration of a storage device according to an exemplary embodiment of the present application;
fig. 4 is a block diagram illustrating an embodiment of a management metadata reading apparatus according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
At present, there is no uniform standard and scheme for managing whether metadata is backed up and backup schemes for various services using RAID storage space, such as LUN, copy, snapshot, double-active, and the like.
Based on this, when a read instruction carrying a read address field and a data type is received, if the data type is management metadata, a main address field intersecting with the read address field is searched from a pre-established backup table, then a main address field to be read and a backup address field to be read are determined from the searched main address field and the backup address field corresponding to the main address field according to the read address field, and during reading, if the data state of the main address field is valid, the management metadata is read from the main address field to be read; and if the data state of the main address field is invalid but the data state of the backup address field is valid, reading the management metadata from the backup address field to be read.
The management Metadata is stored in a main data area and a Backup data area at the same time, and a Backup table is maintained by taking a section as a unit, namely a management Metadata Backup table (MDBP, Metadata Backup Pair), which can contain the data states of a main address section and a main address section, and the data states of a Backup address section and a Backup address section, wherein the main address section is visible to a service, the Backup address section is invisible to the service, the main address section belongs to the main data area, the Backup address section belongs to the Backup data area, and the Backup address sections corresponding to the main address section and the main address section are used for storing the same management Metadata. In order to avoid that the management metadata stored in the main address field is inaccessible due to RAID failure, the backup address fields corresponding to the main address field and the main address field are located on different RAIDs and have the same size, and therefore the backup table may further include a RAID identifier of the RAID where the main address field is located and a RAID identifier of the RAID where the backup address field is located.
It will be understood by those skilled in the art that the primary address segment or the backup address segment may be composed of a start address and an end address, or a start address and a segment size, which is not limited in the present application.
Based on the above description, it can be seen that, since the backup table includes the main address field visible to the service and the backup address field invisible to the service, and the main address field and the backup address field are located on different RAIDs, when various services (such as LUN, copy, snapshot, double active, etc.) execute to read the management metadata, when the RAID where the main address field is located fails (the data state is invalid), the management metadata can be read from the backup address field corresponding to the main address field, so that the successful reading probability can be improved through the backup space, and the whole reading process is unaware of the services, thereby achieving simplicity and high efficiency. In addition, the backup address field with the same size is arranged for the main address field, the management metadata can be protected, the data type of the data to be read can be carried in the read command, whether the management metadata or the user data are read can be quickly judged, all the read commands do not need to search the backup table, and therefore the IO processing efficiency can be improved.
Fig. 1 is a flowchart illustrating an embodiment of a management metadata reading method according to an exemplary embodiment of the present application, where the management metadata reading method may be applied to a storage device, as shown in fig. 1, and the management metadata reading method includes the following steps:
step 101: when a reading instruction carrying a reading address field and a data type is received, if the data type is management metadata, a main address field which has intersection with the reading address field is searched from a pre-established backup table.
In an embodiment, based on the foregoing, the backup table includes a primary address segment visible to the service and a data state of the primary address segment, a RAID identifier of a RAID in which the primary address segment is located, a backup address segment invisible to the service, a data state of the backup address segment, and a RAID identifier of a RAID in which the backup address segment is located. The main address field and the backup address field corresponding to the main address field are used for storing the same management metadata, and in order to avoid that the management metadata stored in the main address field is inaccessible due to RAID faults, the main address field and the backup address field corresponding to the main address field are located on different RAIDs and have the same size. The data state is used to indicate whether the data is valid. For example, a "1" may be used to indicate valid and a "0" may be used to indicate invalid.
For the establishment process of the backup table, reference may be made to the following description of the embodiment shown in fig. 2A, which will not be described in detail herein.
It should be noted that, if the data type carried by the read command is management Metadata, it indicates that management Metadata (MD, Metadata) is read by the read command, and a backup table needs to be searched, and since the main address field is visible to the service, all main address fields contained in the backup table are searched; if the Data type carried by the read command is User Data, which indicates that the read command reads User Data (UD, User Data), the User Data can be read by the prior art scheme. In addition, the main address field intersecting with the read address field means that both the start address and the end address are included in the read address field, or a part between the start address and the end address is included in the read address field. Therefore, when the backup table is searched, a plurality of main address segments with intersection with the read address segments can be found.
Step 102: and determining a main address field to be read and a backup address field to be read from the searched main address field and the backup address field corresponding to the main address field according to the read address field.
In an exemplary scenario, assuming there are 3 records in the backup table, the primary address field and the backup address field of record 1 are: LBA1-LBA5 and LBA100-LBA 104; the primary address field and the backup address field of record 2 are: LBA6-LBA10, and LBA105-LBA 110; the primary address field and the backup address field of record 3 are: LBA11-LBA15 and LBA111-LBA 115. If the read address segments are LBA3-LBA12, the primary address segments LBA1-LBA5 in record 1, LBA6-LBA10 in record 2, and LBA11-LBA15 in record 3 may be found, and according to the read address segments LBA3-LBA12, it may be determined that the primary address segments to be read are: LBA3-LBA5, LBA6-LBA10, LBA11-LBA 12; the backup address segment to be read is: LBA102-LBA104, LBA105-LBA110, LBA111-LBA 112.
Step 103: and if the data state of the main address field is valid, reading the management metadata from the main address field to be read.
Step 104: and if the data state of the main address field is invalid but the data state of the backup address field is valid, reading the management metadata from the backup address field to be read.
In an embodiment, for each pair of main address field to be read and backup address field to be read, if the data state of the main address field is valid, reading from the main address field to be read preferentially, and if the data state of the backup address field to be read is invalid, reading from the backup address field to be read again, no matter reading from the main address field to be read or the backup address field to be read, processing the next pair of main address field to be read and backup address field to be read continues as long as reading succeeds, if reading fails, no processing is performed on the next pair of main address field to be read and backup address field to be read, and a notification that the reading operation result is failed is directly returned.
In the embodiment of the application, when a reading instruction carrying a reading address field is received, a main address field intersecting with the reading address field is searched from a pre-established backup table, then a main address field to be read and a backup address field to be read are determined from the searched main address field and the backup address field corresponding to the main address field according to the reading address field, and when reading is performed, if the data state of the main address field is valid, management metadata are read from the main address field to be read; and if the data state of the main address field is invalid but the data state of the backup address field is valid, reading the management metadata from the backup address field to be read.
Based on the above description, it can be seen that, since the backup table includes the primary address field visible to the service and the backup address field invisible to the service, and the primary address field and the backup address field are located on different RAIDs, when various services (such as LUN, copy, snapshot, double active, etc.) execute to read the management metadata, when the RAID where the primary address field is located fails (the data state is invalid), the management metadata can be read from the backup address field corresponding to the primary address field, so that the successful reading probability can be improved through the backup space, and the whole reading process is unaware to the service. In addition, the backup address field with the same size is arranged for the main address field, the management metadata can be protected, the data type of the data to be read can be carried in the read command, whether the management metadata or the user data are read can be quickly judged, all the read commands do not need to search the backup table, and therefore the IO processing efficiency can be improved.
Fig. 2A is a flowchart of another embodiment of a method for managing metadata reading according to an exemplary embodiment of the present application, and based on the embodiment shown in fig. 1, this embodiment exemplifies how to establish a backup table. As shown in fig. 2A, the backup table involved in the management metadata reading method is created by the following steps:
step 201: when a space allocation instruction carrying a usage identifier as a management metadata identifier is received, a first address field with a size to be allocated carried by the space allocation instruction is allocated from a main data area, and a second address field with the size to be allocated is allocated from a backup data area.
In an embodiment, a space allocation instruction received by a storage device may carry a usage identifier and a size of a space to be allocated this time, that is, a size to be allocated, where the usage identifier is used to indicate a data type of the space allocated this time for storage, if a management metadata identifier (e.g., MD) indicates that the space allocated this time is used to store management metadata, if a user data identifier (e.g., UD) indicates that the space allocated this time is used to store user data, then allocation may be performed according to a prior art scheme. In addition, the main data area and the backup data area are located in different RAIDs, so that the allocated first address field and the second address field can be ensured to be respectively located in different RAIDs.
Step 202: if the second address field comprises multiple segments, dividing a fourth address field with the same size as the second address field of each segment from the first address field aiming at each segment of the second address field, adding the second address field and the fourth address field of each segment into a backup table as a backup address field and a main address field respectively, and adding the invalid data state of the main address field and the invalid data state of the backup address field into the backup table.
In an exemplary scenario, as shown in fig. 2B, it is assumed that the size to be allocated carried by the space allocation instruction is 3GB, the first address segment allocated from the main data area is LBAm-LBAn, the size is 3GB, and the second address segment allocated from the backup data area in RAID-a includes multiple segments: the size of the first section LBAg-LBAh is 1GB, the first section LBAp-LBAq is 1GB, the second section LBAc-LBAq is 1GB, the first section LBAg-LBAh is RAID-B, the third section LBAc-LBAd is 1GB, and the third section LBAc-LBAd is RAID-C. Thus, for the first segment, a fourth address segment LBAm-LBAj with the same size as LBAg-LBAh is divided from LBAm-LBAn, for the second segment, a fourth address segment LBAj-LBAk with the same size as LBAp-LBAq is divided from LBAm-LBAn, and for the third segment, a fourth address segment LBAk-LBAn with the same size as LBAc-LBAd is divided from LBAm-LBAn. Accordingly, the backup table shown in table 1 can be obtained.
Main address segment RAID identification Data state Backup address field RAID identification Data state
LBAm-LBAj RAID-A 0 LBAg-LBAh RAID-B 0
LBAj-LBAk RAID-A 0 LBAp-LBAq RAID-B 0
LBAk-LBAn RAID-A 0 LBAc-LBAd RAID-C 0
TABLE 1
It should be noted that, after the allocation is completed, the first address field allocated this time may be returned to the service.
Step 203: if the first address field comprises a plurality of sections, aiming at each section of the first address field, dividing a third address field with the same size as the first address field from the second address field, respectively taking the first address field and the third address field as a main address field and a backup address field to be added into a backup table, and adding the invalid data state of the backup address field and the invalid data state of the main address field into the backup table.
The partitioning principle for step 203 is similar to that of step 202 described above and will not be described in detail.
It should be noted that after the backup table is established, the management metadata can be written to the allocated space for reading. The specific writing process may be: when a write instruction carrying a write address segment, write data and a data type is received, if the data type is management metadata, searching a main address segment intersected with the write address segment from a backup table, then determining a main address segment to be written and a backup address segment to be written from the searched main address segment and a backup address segment corresponding to the main address segment according to the write address segment, and respectively writing the write data into the main address segment to be written and the backup address segment to be written according to the data state of the main address segment and the data state of the backup address segment.
If the data type carried by the write instruction is management Metadata (MD), the write instruction indicates that the management metadata is written by the write instruction, and all the main address segments contained in the backup table are searched as the main address segments are visible to the service; if the data type carried by the write instruction is User Data (UD), which indicates that the write instruction is to write user data, the write of the user data can be realized by the prior art scheme. The principle of determining the main address field to be written and the backup address field to be written may refer to the principle of determining the main address field to be read and the backup address field to be read in step 102.
In an embodiment, the process of writing the write data into the main address segment to be written and the backup address segment to be written respectively according to the data state of the main address segment and the data state of the backup address segment may be written in three cases: the first is the case that the data state of the main address segment and the data state of the backup address segment are both valid or both invalid, the write data are respectively written into the main address segment to be written and the backup address segment to be written, and the respective data states are updated according to the respective write results; the second is the case that the data state of the main address field is valid but the data state of the backup address field is invalid, the write data is written into the main address field to be written, and the data state of the main address field is kept unchanged; and the third condition is that the data state of the main address segment is invalid but the data state of the backup address segment is valid, the write data is written into the backup address segment to be written, and the data state of the backup address segment is kept unchanged.
Wherein, aiming at the process of updating respective data state according to respective writing result, aiming at the condition that the data state of the main address segment and the data state of the backup address segment are both valid, if the writing result of the main address segment to be written is failure, the data state of the main address segment is updated to be invalid; if the writing result of the backup address segment to be written is failure, updating the data state of the backup address segment to be invalid; aiming at the condition that the data state of the main address segment and the data state of the backup address segment are both invalid, if the writing result of the main address segment to be written is successful, the data state of the main address segment is updated to be valid; and if the writing result of the backup address segment to be written is successful, updating the data state of the backup address segment to be effective.
It should be noted that, for the case that the data state of the main address field and the data state of the backup address field are both valid, if the writing results of the main address field to be written and the backup address field to be written both fail, it indicates that the management metadata of the main address field and the backup address field are both up-to-date, and the respective data states are kept unchanged. And for the condition that the data state of the main address field and the data state of the backup address field are both invalid, if the writing results of the main address field to be written and the backup address field to be written fail, the main address field and the backup address field are indicated that the management metadata are not successfully written, and the respective data states are kept unchanged.
It should be further noted that the allocated space may be removed after the backup table is established. The specific cancellation process may be: when a release space instruction carrying a use identifier as a management metadata identifier is received, searching a main address segment which has intersection with an address segment to be released carried by the release space instruction from a backup table, if the address segment to be released completely contains the searched main address segment, releasing respective corresponding spaces of the main address segment and a backup address segment corresponding to the main address segment, and deleting a record of the main address segment from the backup table; if the address segment to be released does not completely contain the searched main address segment, determining a main address segment to be reserved and a backup address segment to be reserved, which do not have intersection with the address segment to be released, according to the main address segment and the backup address segment corresponding to the main address segment, and determining the main address segment to be released and the backup address segment to be released, which have intersection; and releasing the main address field to be released and the backup address field to be released, and updating the main address field in the backup table and the backup address field corresponding to the main address field by using the main address field to be reserved and the backup address field to be reserved respectively.
In an exemplary scenario, as shown in fig. 2C, it is assumed that records 1-4 are located in the main address segment of the backup table where the main address segment intersects with the address segment to be released, wherein a part of the records 1 and 4 intersects with the address segment to be released, and the records 2 and 3 are completely contained in the address segment to be released, so that for the records 1 and 4, only the space where the intersection part exists is released and deleted, the intersection part does not exist, and for the records 2 and 3, all the records are released and deleted.
So far, the process shown in fig. 2A is completed, and the establishment of the backup table can be realized through the process shown in fig. 2A.
Fig. 3 is a hardware block diagram of a storage device according to an exemplary embodiment of the present application, where the storage device includes: a communication interface 301, a processor 302, a machine-readable storage medium 303, and a bus 304; wherein the communication interface 301, the processor 302, and the machine-readable storage medium 303 communicate with each other via a bus 304. The processor 302 may perform the above-described management metadata reading method by reading and executing machine-executable instructions in the machine-readable storage medium 302 corresponding to control logic for managing the metadata reading method, and the details of the method are described in the above embodiments and will not be described herein again.
The machine-readable storage medium 303 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: volatile memory, non-volatile memory, or similar storage media. In particular, the machine-readable storage medium 303 may be a RAM (random Access Memory), a flash Memory, a storage drive (e.g., a hard drive), any type of storage disk (e.g., an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof.
Fig. 4 is a block diagram of an embodiment of a management metadata reading apparatus according to an exemplary embodiment of the present application, where the management metadata reading apparatus is applied to a storage device, and as shown in fig. 4, the management metadata reading apparatus includes:
the searching unit 410 is configured to, when a read instruction carrying a read address field and a data type is received, if the data type is management metadata, search a main address field intersecting with the read address field from a pre-established backup table, where the backup table includes data states of the main address field and the main address field, and data states of the backup address field and the backup address field;
a determining unit 420, configured to determine, according to the read address segment, a main address segment to be read and a backup address segment to be read from the searched main address segment and the backup address segment corresponding to the main address segment;
a first reading unit 430, configured to read management metadata from a main address field to be read when a data state of the main address field is valid;
a second reading unit 440, configured to read management metadata from the backup address segment to be read when the data state of the primary address segment is invalid but the data state of the backup address segment is valid;
the main address field and the backup address field corresponding to the main address field have the same size and are located in different RAID.
In an alternative implementation, the apparatus further comprises (not shown in fig. 4):
the backup table establishing unit is used for allocating a first address field with a size to be allocated, which is carried by the space allocation command, from the main data area and allocating a second address field with the size to be allocated from the backup data area when the space allocation command carrying the use identifier as the management metadata identifier is received; if the first address field comprises a plurality of sections, dividing a third address field with the same size as the first address field of each section from the second address field aiming at the first address field of each section, respectively taking the first address field and the third address field of each section as a main address field and a backup address field to be added into the backup table, and adding an invalid data state of the main address field and an invalid data state of the backup address field into the backup table; if the second address field comprises multiple sections, dividing a fourth address field with the same size as the second address field of each section from the first address field aiming at the second address field of each section, adding the second address field and the fourth address field of each section into the backup table as a backup address field and a main address field respectively, and adding the invalid data state of the backup address field and the invalid data state of the main address field into the backup table.
In an alternative implementation, the apparatus further comprises (not shown in fig. 4):
the data writing unit is used for searching a main address field which has intersection with a writing address field from the backup table if the data type is management metadata when a writing instruction which carries the writing address field, writing data and the data type is received after the backup table is established; determining a main address segment to be written and a backup address segment to be written from the searched main address segment and the backup address segment corresponding to the main address segment according to the write address segment; and writing the write data into the main address segment to be written and the backup address segment to be written respectively according to the data state of the main address segment and the data state of the backup address segment.
In an optional implementation manner, the write data unit is specifically configured to, during a process of writing the write data into a main address segment to be written and a backup address segment to be written respectively according to a data state of the main address segment and a data state of the backup address segment, write the write data into the main address segment to be written and the backup address segment to be written respectively if the data state of the main address segment and the data state of the backup address segment are both valid or both invalid, and update respective data states according to respective write results; if the data state of the main address segment is valid but the data state of the backup address segment is invalid, writing the write data into the main address segment to be written, and keeping the data state of the main address segment unchanged; and if the data state of the main address segment is invalid but the data state of the backup address segment is valid, writing the write data into the backup address segment to be written, and keeping the data state of the backup address segment unchanged.
In an optional implementation manner, the data writing unit is specifically configured to, in a process of updating respective data states according to respective writing results, update the data state of the main address segment to be invalid if the writing result to be written into the main address segment is a failure, for a case that both the data state of the main address segment and the data state of the backup address segment are valid; if the writing result of the backup address segment to be written is failure, updating the data state of the backup address segment to be invalid; aiming at the condition that the data state of the main address segment and the data state of the backup address segment are both invalid, if the writing result of the main address segment to be written is successful, the data state of the main address segment is updated to be valid; and if the writing result of the backup address segment to be written is successful, updating the data state of the backup address segment to be effective.
In an alternative implementation, the apparatus further comprises (not shown in fig. 4):
the release unit is used for searching a main address segment which has intersection with an address segment to be released carried by the release space instruction from the backup table when receiving the release space instruction carrying the use identifier as the management metadata identifier; if the address segment to be released completely contains the searched main address segment, releasing respective corresponding spaces of the main address segment and a backup address segment corresponding to the main address segment, and deleting the record of the main address segment from the backup table; if the address segment to be released does not completely contain the searched main address segment, determining a main address segment to be reserved and a backup address segment to be reserved, which do not have intersection with the address segment to be released, according to the main address segment and the backup address segment corresponding to the main address segment, and determining the main address segment to be released and the backup address segment to be released, which have intersection; and releasing the main address field to be released and the backup address field to be released, and updating the main address field in the backup table and the backup address field corresponding to the main address field by using the main address field to be reserved and the backup address field to be reserved respectively.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (12)

1. A method of managing metadata reads, the method comprising:
when a reading instruction carrying a reading address field and a data type is received, if the data type is management metadata, searching a main address field which has intersection with the reading address field from a pre-established backup table, wherein the backup table comprises data states of the main address field and data states of the backup address field and the backup address field;
determining a main address field to be read and a backup address field to be read from the searched main address field and the backup address field corresponding to the main address field according to the read address field, wherein the main address field and the backup address field corresponding to the main address field store the same management metadata;
if the data state of the main address field is valid, reading management metadata from the main address field to be read;
if the data state of the main address field is invalid but the data state of the backup address field is valid, reading management metadata from the backup address field to be read;
the main address field and the backup address field corresponding to the main address field have the same size and are located in different RAID.
2. The method of claim 1, wherein the backup table is pre-established by:
when a space allocation instruction carrying a use identifier as a management metadata identifier is received, allocating a first address field with a size to be allocated carried by the space allocation instruction from a main data area, and allocating a second address field with the size to be allocated from a backup data area;
if the first address field comprises a plurality of sections, dividing a third address field with the same size as the first address field of each section from the second address field aiming at the first address field of each section, respectively taking the first address field and the third address field of each section as a main address field and a backup address field to be added into the backup table, and adding an invalid data state of the main address field and an invalid data state of the backup address field into the backup table;
if the second address field comprises multiple sections, dividing a fourth address field with the same size as the second address field of each section from the first address field aiming at the second address field of each section, adding the second address field and the fourth address field of each section into the backup table as a backup address field and a main address field respectively, and adding the invalid data state of the backup address field and the invalid data state of the main address field into the backup table.
3. The method of claim 2, wherein after the backup table is established, the method further comprises:
when a write instruction carrying a write address field, write data and a data type is received, if the data type is management metadata, searching a main address field which has intersection with the write address field from the backup table;
determining a main address segment to be written and a backup address segment to be written from the searched main address segment and the backup address segment corresponding to the main address segment according to the write address segment;
and writing the write data into the main address segment to be written and the backup address segment to be written respectively according to the data state of the main address segment and the data state of the backup address segment.
4. The method of claim 3, wherein writing the write data into the primary address segment to be written and the backup address segment to be written, respectively, according to the data state of the primary address segment and the data state of the backup address segment, comprises:
if the data state of the main address segment and the data state of the backup address segment are both valid or invalid, respectively writing the write data into the main address segment to be written and the backup address segment to be written, and updating the respective data states according to the respective writing results;
if the data state of the main address segment is valid but the data state of the backup address segment is invalid, writing the write data into the main address segment to be written, and keeping the data state of the main address segment unchanged;
and if the data state of the main address segment is invalid but the data state of the backup address segment is valid, writing the write data into the backup address segment to be written, and keeping the data state of the backup address segment unchanged.
5. The method of claim 4, wherein updating the respective data states based on the respective write results comprises:
aiming at the condition that the data state of the main address segment and the data state of the backup address segment are both effective, if the writing result of the main address segment to be written is failure, the data state of the main address segment is updated to be invalid; if the writing result of the backup address segment to be written is failure, updating the data state of the backup address segment to be invalid;
aiming at the condition that the data state of the main address segment and the data state of the backup address segment are both invalid, if the writing result of the main address segment to be written is successful, the data state of the main address segment is updated to be valid; and if the writing result of the backup address segment to be written is successful, updating the data state of the backup address segment to be effective.
6. The method according to any one of claims 1-5, further comprising:
when a release space instruction carrying a use identifier as a management metadata identifier is received, searching a main address segment which has intersection with an address segment to be released carried by the release space instruction from the backup table;
if the address segment to be released completely contains the searched main address segment, releasing respective corresponding spaces of the main address segment and a backup address segment corresponding to the main address segment, and deleting the record of the main address segment from the backup table;
if the address segment to be released does not completely contain the searched main address segment, determining a main address segment to be reserved and a backup address segment to be reserved, which do not have intersection with the address segment to be released, according to the main address segment and the backup address segment corresponding to the main address segment, and determining the main address segment to be released and the backup address segment to be released, which have intersection; and releasing the main address field to be released and the backup address field to be released, and updating the main address field in the backup table and the backup address field corresponding to the main address field by using the main address field to be reserved and the backup address field to be reserved respectively.
7. An apparatus for managing metadata reading, the apparatus comprising:
the device comprises a searching unit, a judging unit and a judging unit, wherein the searching unit is used for searching a main address field which has intersection with a read address field from a pre-established backup table if the data type is management metadata when receiving a read instruction carrying the read address field and the data type, and the backup table comprises data states of the main address field and data states of the backup address field and the backup address field;
a determining unit, configured to determine, according to the read address segment, a main address segment to be read and a backup address segment to be read from the searched main address segment and the backup address segment corresponding to the main address segment, where the main address segment and the backup address segment corresponding to the main address segment store the same management metadata;
the first reading unit is used for reading the management metadata from the main address field to be read when the data state of the main address field is valid;
the second reading unit is used for reading the management metadata from the backup address field to be read when the data state of the main address field is invalid but the data state of the backup address field is valid;
the main address field and the backup address field corresponding to the main address field have the same size and are located in different RAID.
8. The apparatus of claim 7, further comprising:
the backup table establishing unit is used for allocating a first address field with a size to be allocated, which is carried by the space allocation command, from the main data area and allocating a second address field with the size to be allocated from the backup data area when the space allocation command carrying the use identifier as the management metadata identifier is received; if the first address field comprises a plurality of sections, dividing a third address field with the same size as the first address field of each section from the second address field aiming at the first address field of each section, respectively taking the first address field and the third address field of each section as a main address field and a backup address field to be added into the backup table, and adding an invalid data state of the main address field and an invalid data state of the backup address field into the backup table; if the second address field comprises multiple sections, dividing a fourth address field with the same size as the second address field of each section from the first address field aiming at the second address field of each section, adding the second address field and the fourth address field of each section into the backup table as a backup address field and a main address field respectively, and adding the invalid data state of the backup address field and the invalid data state of the main address field into the backup table.
9. The apparatus of claim 8, further comprising:
the data writing unit is used for searching a main address field which has intersection with a writing address field from the backup table if the data type is management metadata when a writing instruction which carries the writing address field, writing data and the data type is received after the backup table is established; determining a main address segment to be written and a backup address segment to be written from the searched main address segment and the backup address segment corresponding to the main address segment according to the write address segment; and writing the write data into the main address segment to be written and the backup address segment to be written respectively according to the data state of the main address segment and the data state of the backup address segment.
10. The apparatus according to claim 9, wherein the write data unit is specifically configured to, during writing the write data into a main address segment to be written and a backup address segment to be written respectively according to a data state of the main address segment and a data state of the backup address segment, write the write data into the main address segment to be written and the backup address segment to be written respectively if the data state of the main address segment and the data state of the backup address segment are both valid or both invalid, and update respective data states according to respective writing results; if the data state of the main address segment is valid but the data state of the backup address segment is invalid, writing the write data into the main address segment to be written, and keeping the data state of the main address segment unchanged; and if the data state of the main address segment is invalid but the data state of the backup address segment is valid, writing the write data into the backup address segment to be written, and keeping the data state of the backup address segment unchanged.
11. The apparatus of claim 10, wherein the write data unit is specifically configured to, in the process of updating the respective data states according to the respective writing results, for a case that the data state of the primary address segment and the data state of the backup address segment are both valid, if the writing result to be written into the primary address segment is a failure, update the data state of the primary address segment to be invalid; if the writing result of the backup address segment to be written is failure, updating the data state of the backup address segment to be invalid; aiming at the condition that the data state of the main address segment and the data state of the backup address segment are both invalid, if the writing result of the main address segment to be written is successful, the data state of the main address segment is updated to be valid; and if the writing result of the backup address segment to be written is successful, updating the data state of the backup address segment to be effective.
12. The apparatus according to any one of claims 7-11, further comprising:
the release unit is used for searching a main address segment which has intersection with an address segment to be released carried by the release space instruction from the backup table when receiving the release space instruction carrying the use identifier as the management metadata identifier; if the address segment to be released completely contains the searched main address segment, releasing respective corresponding spaces of the main address segment and a backup address segment corresponding to the main address segment, and deleting the record of the main address segment from the backup table; if the address segment to be released does not completely contain the searched main address segment, determining a main address segment to be reserved and a backup address segment to be reserved, which do not have intersection with the address segment to be released, according to the main address segment and the backup address segment corresponding to the main address segment, and determining the main address segment to be released and the backup address segment to be released, which have intersection; and releasing the main address field to be released and the backup address field to be released, and updating the main address field in the backup table and the backup address field corresponding to the main address field by using the main address field to be reserved and the backup address field to be reserved respectively.
CN201811424754.4A 2018-11-27 2018-11-27 Management metadata reading method and device Active CN109597573B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811424754.4A CN109597573B (en) 2018-11-27 2018-11-27 Management metadata reading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811424754.4A CN109597573B (en) 2018-11-27 2018-11-27 Management metadata reading method and device

Publications (2)

Publication Number Publication Date
CN109597573A CN109597573A (en) 2019-04-09
CN109597573B true CN109597573B (en) 2022-03-25

Family

ID=65958986

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811424754.4A Active CN109597573B (en) 2018-11-27 2018-11-27 Management metadata reading method and device

Country Status (1)

Country Link
CN (1) CN109597573B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101814044A (en) * 2010-04-19 2010-08-25 中兴通讯股份有限公司 Method and device for processing metadata
CN103559139A (en) * 2013-10-23 2014-02-05 华为技术有限公司 Data storage method and device
US8850091B1 (en) * 2007-08-30 2014-09-30 Virident Systems, Inc. Methods for early write termination with non-volatile memory
CN107423233A (en) * 2017-07-19 2017-12-01 杭州宏杉科技股份有限公司 A kind of writeable snapshot implementing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101979392B1 (en) * 2012-05-17 2019-05-16 삼성전자주식회사 Nonvolatile memory device and program method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8850091B1 (en) * 2007-08-30 2014-09-30 Virident Systems, Inc. Methods for early write termination with non-volatile memory
CN101814044A (en) * 2010-04-19 2010-08-25 中兴通讯股份有限公司 Method and device for processing metadata
CN103559139A (en) * 2013-10-23 2014-02-05 华为技术有限公司 Data storage method and device
CN107423233A (en) * 2017-07-19 2017-12-01 杭州宏杉科技股份有限公司 A kind of writeable snapshot implementing method and device

Also Published As

Publication number Publication date
CN109597573A (en) 2019-04-09

Similar Documents

Publication Publication Date Title
US7895394B2 (en) Storage system
US10977124B2 (en) Distributed storage system, data storage method, and software program
US10365983B1 (en) Repairing raid systems at per-stripe granularity
US8239648B2 (en) Reclamation of thin provisioned disk storage
US9563636B2 (en) Allowing writes to complete without obtaining a write lock to a file
CN107656834B (en) System and method for recovering host access based on transaction log and storage medium
US8856467B2 (en) Management of metadata in a storage subsystem
CN106104502B (en) System, method and medium for storage system affairs
US10572335B2 (en) Metadata recovery method and apparatus
US11449402B2 (en) Handling of offline storage disk
JP2022500759A (en) Methods and equipment used when sanitizing a network of non-volatile memory express devices
JP2014137711A (en) Storage device, backup program and backup method
US11640244B2 (en) Intelligent block deallocation verification
CN109582235B (en) Management metadata storage method and device
US9547450B2 (en) Method and apparatus to change tiers
CN107545022B (en) Disk management method and device
CN109597573B (en) Management metadata reading method and device
CN109508140B (en) Storage resource management method and device, electronic equipment and system
CN112825098A (en) Data protection method and device, computing equipment and storage medium
CN111913664B (en) Data writing method and device
CN105573862B (en) Method and equipment for recovering file system
CN111444114B (en) Method, device and system for processing data in nonvolatile memory
US20080028163A1 (en) Method and apparatus for repurposing compute resources to implement, or not implement, storage access protocols
CN109597712B (en) Space allocation method and device
CN109582499B (en) Management metadata repairing method and device

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