CN112416258A - Storage space allocation method and device - Google Patents

Storage space allocation method and device Download PDF

Info

Publication number
CN112416258A
CN112416258A CN202011407422.2A CN202011407422A CN112416258A CN 112416258 A CN112416258 A CN 112416258A CN 202011407422 A CN202011407422 A CN 202011407422A CN 112416258 A CN112416258 A CN 112416258A
Authority
CN
China
Prior art keywords
lun
deleted
fixed
record
raid
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.)
Pending
Application number
CN202011407422.2A
Other languages
Chinese (zh)
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 CN202011407422.2A priority Critical patent/CN112416258A/en
Publication of CN112416258A publication Critical patent/CN112416258A/en
Pending legal-status Critical Current

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/0604Improving or facilitating administration, e.g. storage management
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/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 storage space allocation method and device. A method of memory space allocation, comprising: creating a deleted LUN distribution table for each RAID in the storage equipment, wherein the deleted LUN distribution table is used for recording fixed-length blocks of a deleted LUN which need to be returned to the RAID, and the fixed-length blocks recorded in the deleted LUN distribution table are not marked as unallocated blocks; when M fixed-length blocks in any RAID need to be allocated to a LUN, if N fixed-length blocks marked as unallocated exist in the current RAID and M is larger than N, the N fixed-length blocks are allocated to the LUN, M-N fixed-length blocks are selected from the fixed-length blocks recorded in the deleted LUN allocation table of the RAID and allocated to the LUN, and records corresponding to the M-N fixed-length blocks are deleted. By the method, the deleted LUN can be preferentially allocated to the fixed-length blocks except the fixed-length blocks which need to be returned, so that the deleted LUN can be recovered as far as possible.

Description

Storage space allocation method and device
Technical Field
The present application relates to the field of storage technologies, and in particular, to a method and an apparatus for allocating storage space.
Background
Redundant Array of Independent Disks (RAID) technology is often used to protect data in a disk redundantly. RAID is made up of a plurality of disks, and the storage space thereof has a data redundancy protection feature, but the capacity is extremely large, and therefore, a plurality of LUNs (Logical Unit numbers) are generally created on RAID, RAID space is allocated to the plurality of LUNs, and then the LUNs are provided for client server access.
However, in the using process of the LUN, situations of deleting the LUN by mistake are inevitable, for example, the LUN is deleted by mistake by carelessness in manual operation, the LUN is deleted by Bug in the operation and maintenance script or tool, and the like, and at this time, the user data needs to be retrieved by recovering the deleted LUN by mistake. According to the current technical scheme, the layout information of the deleted LUN can be found through the configuration file exported in advance, and the wrongly deleted LUN can be recovered. However, because the RAID space returned when the LUN is deleted by mistake is likely to be already used by other LUNs, failure to restore the LUNs and loss of user data occur.
Disclosure of Invention
The application provides a storage space allocation method and a storage space allocation device, so that deleted LUNs can be restored to the greatest extent by preferentially allocating storage spaces except storage spaces to be returned to a RAID.
The technical scheme provided by the application comprises the following steps:
in a first aspect, the present application provides a storage space allocation method, including:
dividing the storage space of a disk array RAID in the storage equipment into a plurality of fixed-length blocks according to the specified length;
creating a deleted LUN allocation table for each RAID in the storage device, wherein the deleted LUN allocation table is used for recording fixed-length blocks of a deleted LUN which need to be returned to the RAID, and the fixed-length blocks recorded in the deleted LUN allocation table are not marked as unallocated;
when M fixed-length blocks in any RAID need to be allocated to the LUN, if N fixed-length blocks marked as unallocated exist in the current RAID and M is larger than N, the N fixed-length blocks are allocated to the LUN, M-N fixed-length blocks are selected from the fixed-length blocks recorded in the deleted LUN allocation table of the RAID and allocated to the LUN, and records corresponding to the M-N fixed-length blocks are deleted.
In a second aspect, the present application provides a storage space allocation apparatus, including:
the dividing unit is used for dividing the storage space of the RAID in the storage equipment into a plurality of fixed-length blocks according to the specified length;
an allocation table creating unit, configured to create a deleted LUN allocation table for each RAID in the storage device, where the deleted LUN allocation table is used to record a fixed-length block that a deleted LUN needs to be returned to the RAID, and for the fixed-length block recorded in the deleted LUN allocation table, the fixed-length block is not marked as unallocated;
and the allocating unit is used for allocating the N fixed-length blocks to the LUN if the N fixed-length blocks marked as unallocated exist in the current RAID and M is larger than N when the M fixed-length blocks in any RAID need to be allocated to the LUN, selecting M-N fixed-length blocks from the fixed-length blocks recorded in the deleted LUN allocation table of the RAID to be allocated to the LUN, and deleting records corresponding to the M-N fixed-length blocks.
According to the scheme provided by the application, the deleted LUN allocation table can be created in the storage device to record the fixed-length blocks to be returned of the deleted LUN, and the fixed-length blocks recorded in the deleted LUN allocation table are not marked as unallocated blocks, so that when the fixed-length blocks need to be allocated to the LUN, the fixed-length blocks except the fixed-length blocks to be returned of the deleted LUN can be preferentially allocated, the fixed-length blocks to be returned of the deleted LUN are guaranteed not to be allocated as much as possible, and the deleted LUN can be recovered.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flowchart of a method for allocating memory space according to the present application;
FIGS. 2A-2C are flow diagrams illustrating the interaction between a LUN management module and a RAID according to an embodiment of the present invention;
FIG. 3 is a block diagram of a storage space allocation apparatus according to the present application;
fig. 4 is a structural diagram of another storage space allocation apparatus according to an embodiment of the present application;
fig. 5 is a hardware structure diagram of a storage device to which the storage space allocation method of the present application is applied.
Detailed Description
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification 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 should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
With the popularization of informatization, more and more data is stored in electronic storage media. Electronic storage media have the advantages of large capacity, low cost, fast access, and their reliability also determines the reliability of data. Currently, most electronic storage media are magnetic disks, including HDD disks (mechanical disks) or SSD disks. RAID technology is typically used to redundantly protect data in the disks. Common RAIDs include RAID0, RAID1, RAID5, RAID6, RAID10, and the like, each using a different data organization.
The RAID is composed of a plurality of disks, and the capacity is very large, and in some embodiments, a plurality of LUNs may be created on the RAID according to actual needs, and a storage space of the RAID is allocated to each created LUN, and then the LUNs are provided for the client server to access. The space of the LUN can be flexibly expanded and contracted according to the actual service requirement.
During the use of the storage device, the situation of deleting the LUN by mistake is inevitably encountered, and in this case, the deleted LUN by mistake needs to be recovered and the user data needs to be retrieved. At present, the layout information of the LUN deleted by mistake is usually found according to a configuration file or the like exported in advance, and the storage space of the LUN is described in the layout information, so that the LUN deleted by mistake is recovered according to the layout information. However, when restoring a LUN deleted by mistake, it is likely that the storage space returned when the LUN is deleted is already used by other LUNs, thereby causing problems such as failure in restoring the LUNs, loss of user data, and the like.
In order to solve the above problem, the present application provides a storage space allocation method, which preferentially allocates storage spaces other than storage spaces to which deleted LUNs need to be returned, so that the storage spaces returned by the LUNs that have been deleted recently are not allocated to other LUNs in a short time, thereby ensuring that the LUNs that are closest to being deleted can be returned as much as possible.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in detail below with reference to the accompanying drawings and specific embodiments.
Referring to fig. 1, fig. 1 is a flowchart of a storage space allocation method provided in the present application. The process illustrated in FIG. 1 may be applied to a storage device as one embodiment. As shown in fig. 1, the process may include the following steps:
step S101, a deleted LUN allocation table is created for each RAID in the storage device, where the deleted LUN allocation table is used to record a fixed-length block to which a deleted LUN needs to be returned to the RAID, and the fixed-length block recorded in the deleted LUN allocation table is not marked as unallocated.
Before executing step S101, the storage space of each RAID in the storage device may be divided into a plurality of fixed-length blocks according to a specified length.
As an embodiment, each record in the deleted LUN allocation table created in this step S101 for any RAID may include: the identity of the deleted LUN and the number of fixed length blocks that the LUN needs to be returned to the RAID. The Identifier of the LUN may be a Universal Unique Identifier (UUID) of the LUN. To facilitate understanding of the present embodiment, Table 1 illustrates an example deleted LUN assignment table:
UUID fixed length block numbering
2 101-200
3 301-600
TABLE 1
In one example, each fixed-length block in the RAID corresponds to an allocation attribute, and the allocation attribute is used to indicate whether the fixed-length block has been allocated to the LUN. In one embodiment, the RAID may record the allocation attributes of the fixed length blocks using a bitmap. Specifically, any bit in the bitmap corresponds to a fixed length block, and if the current value of any bit is 0, the fixed length block corresponding to the bit is not allocated; if the current value of any bit is 1, it indicates that the fixed length block corresponding to the bit is allocated.
As an embodiment, for a fixed-length block allocated to a LUN, RAID sets the current value of its corresponding bit to 1 to mark that the fixed-length block is allocated; for the fixed-length block returned by the deleted LUN, according to the existing scheme, the current value of the bit corresponding to the deleted LUN should be changed from 1 to 0, and according to the above step S101 of the present application, for the fixed-length block returned by the deleted LUN, the RAID records the fixed-length block into the deleted LUN allocation table, and keeps the current value of the bit corresponding to the fixed-length block to be 1, that is, does not mark the fixed-length block as unallocated.
Step S102, when M fixed-length blocks in any RAID need to be allocated to the LUN, if N fixed-length blocks marked as unallocated exist in the current RAID and M is larger than N, the N fixed-length blocks are allocated to the LUN, M-N fixed-length blocks are selected from the fixed-length blocks recorded in the deleted LUN allocation table of the RAID and allocated to the LUN, and records corresponding to the M-N fixed-length blocks are deleted.
It is easy to understand that M and N in this step S102 are both integers not less than 0, and the selected M-N fixed-length blocks may correspond to at least one deleted LUN.
As an embodiment, since the M-N fixed-length blocks are selected from the fixed-length blocks recorded in the deleted LUN allocation table, and are still currently marked as allocated instead of unallocated, after the M-N fixed-length blocks are allocated to the LUNs, the marks of the M-N fixed-length blocks do not need to be changed.
As an embodiment, there are various implementations of the step S102 of selecting M-N fixed-length blocks from the fixed-length blocks recorded in the deleted LUN allocation table of the RAID. For example, M-N fixed-length blocks with an earlier recording time in the deleted LUN allocation table may be selected, specifically, the fixed-length blocks may be preferentially selected from the records corresponding to the deleted LUN with the earliest recording time in the deleted LUN allocation table, and when the number of the fixed-length blocks in the record corresponding to the deleted LUN is less than M-N, the fixed-length blocks may be continuously selected from another record whose recording time is only equal to that of the deleted LUN, and so on until M-N fixed-length blocks are selected.
In one example, assigning some or all of the fixed-length blocks of the deleted LUN to be returned to other LUNs may result in a subsequent potential failure to restore the deleted LUN. As an embodiment, after allocating M-N fixed-length blocks of RAID to a LUN, if all fixed-length blocks of a first LUN are not selected from deleted LUNs corresponding to the M-N fixed-length blocks, all remaining fixed-length blocks of the first LUN recorded in the deleted LUN allocation table may be marked as unallocated, and a record corresponding to the first LUN in the deleted LUN allocation table may be deleted. By the embodiment, for deleted LUNs which are difficult to guarantee to be restored, all fixed-length blocks which need to be returned can be marked as unallocated, and records corresponding to the LUNs are removed from a deleted LUN allocation table, so that the table entry resource occupation can be effectively saved. To facilitate understanding of the present embodiment, a simple example is as follows:
taking the deleted LUN-2 as an example of recording the fixed-length block with the number of 101-.
As an embodiment, for other RAIDs except the RAID allocated with the fixed-length block of the first LUN, if the deleted LUN allocation table also has the record corresponding to the first LUN, the fixed-length blocks of the first LUN recorded in the deleted record tables of the other RAIDs may be all marked as not allocated, and the record corresponding to the first LUN may be all deleted from the deleted LUN allocation tables of the other RAIDs.
Thus, the flow shown in fig. 1 is completed.
Through the process shown in fig. 1, the deleted LUN allocation table can be created in the storage device to record the fixed-length blocks that the deleted LUN needs to return, and the fixed-length blocks recorded in the deleted LUN allocation table are not marked as unallocated, so that when the fixed-length blocks need to be allocated to the LUN, the fixed-length blocks other than the fixed-length blocks that the deleted LUN needs to return can be preferentially allocated, so that the fixed-length blocks that the deleted LUN needs to return are ensured not to be allocated as much as possible, and the deleted LUN can be recovered.
As an embodiment, when any deleted LUN needs to be restored, for example, when a restoration instruction for any deleted LUN is received, if the LUN has a corresponding record in the deleted LUN allocation table of the RAID, the LUN may be restored, and the record corresponding to the LUN is deleted from the deleted LUN allocation table of each RAID.
In one example, a deleted LUN record table may also be created in the storage device for recording the deletion time of the deleted LUN. For an embodiment, the deleted LUN record table may include an identification of the deleted LUN and a deletion time, and specifically, the identification of the deleted LUN may be a UUID of the LUN. For ease of understanding, Table 2 below illustrates an example deleted LUN record table:
UUID delete time
2 12:54:00
3 16:32:11
TABLE 2
In one example, the storage device may maintain a deleted LUN record table and a corresponding record of the deleted LUN allocation table described above, i.e., keep the deleted LUNs corresponding to the records present in both consistent. As an embodiment, when a record corresponding to any deleted LUN is added or deleted in the deleted LUN allocation table, a record corresponding to the LUN may be correspondingly added or deleted in the deleted LUN allocation table of each RAID of the long block to which the LUN needs to be restored; similarly, when a record corresponding to any deleted LUN is added or deleted in the deleted LUN allocation table of any RAID, a record corresponding to the LUN may be added or deleted in the deleted LUN allocation table. If, according to the above embodiment, for deleted LUNs that are difficult to guarantee to be restored, the records corresponding to the LUNs are all removed from the deleted LUN allocation tables of each RAID, it can be guaranteed that the deleted LUNs having corresponding records in the deleted LUN allocation tables can be restored certainly by this embodiment. Specific implementations of the present embodiment are described below by way of example:
in one embodiment, when the deletion time of any LUN in the deleted LUN record table meets a preset condition, the fixed-length block of the LUN to be returned is marked as unallocated, the record of the LUN corresponding to the deleted LUN record table is deleted, and the record of the LUN corresponding to the deleted LUN allocation table of the RAID that needs to return the fixed-length block is deleted. In this embodiment, the fixed-length block to which the LUN needs to be returned is marked as unallocated, and specifically, the fixed-length block to which the LUN needs to be returned can be determined by each RAID of the LUN that needs to be returned according to the deleted LUN allocation table, and the fixed-length block is marked as unallocated. As an embodiment, the RAID of the LUN to be restored with the fixed-length block may be determined according to a mapping table of the deleted LUN, where the mapping table of the deleted LUN may record layout information of the LUN, where the layout information includes which fixed-length blocks of which RAIDs the LUN is specifically composed of.
As an embodiment, the mapping table of the LUN may be reserved when the LUN is deleted, so that the LUN may be subsequently restored according to the mapping table of the LUN. In this embodiment, the mapping table of the LUN may be deleted when the record corresponding to the LUN is removed from the deleted LUN allocation table or the deleted LUN record table, and it should be noted that here, the record corresponding to the LUN is removed from the deleted LUN allocation table or the deleted LUN record table, and the case of restoring the LUN is not included.
How to determine that the deletion time of any LUN in the deleted LUN record table satisfies the preset condition is described below by way of two embodiments:
for one embodiment, when it is determined that the LUN has been deleted according to the deletion time of any LUN, the deletion time of the LUN may be determined to meet the preset condition. For one embodiment, each deletion time in the deleted LUN record table may be checked for satisfying a preset condition according to a preset time period. With the present embodiment, only records in the deleted LUN record table whose deleted time is less than the first threshold can be restricted. If the LUN is deleted by mistake, it is more likely to be found and restored in a shorter time, and by the embodiment, the record corresponding to the LUN with longer deleted time and less likelihood of being restored can be deleted from the deleted LUN record table.
As another embodiment, when the total number of records in the deleted LUN record table reaches the second threshold and a new record needs to be added to the deleted LUN record table, if the deletion time of any LUN is the earliest time in the deleted LUN record table, it may be determined that the deletion time of the LUN satisfies the preset condition. With the present embodiment, the total number of records in the deleted LUN record table can be limited not to exceed the second threshold.
Based on the above two embodiments, other implementations reasonably foreseen by those skilled in the art shall also be considered to belong to the protection scope of the present application. The two embodiments described above can also be used in combination, for example: taking the first threshold as 24 hours and the second threshold as 8 as an example, the deleted LUN list may be configured to store no more than 8 deleted LUN records for up to 24 hours.
Regarding keeping the deleted LUN recorded in the deleted LUN record table and the deleted LUN assignment table consistent, as another embodiment, when a LUN is deleted, specifically, for example, when a deletion instruction is received for any LUN, the deletion time of the LUN may be recorded in the deleted LUN record table, and for each RAID in at least one RAID whose fixed-length block needs to be returned to the LUN, the fixed-length block that needs to be returned to the RAID is recorded in the deleted LUN assignment table of the RAID. Wherein, at least one RAID of the LUN needing to return the fixed length block can be determined according to the mapping table of the LUN.
By the above embodiment, for the deleted LUN having the deletion time recorded in the deleted LUN record table, since all fixed-length blocks of the deleted LUN are not allocated to other LUNs, the deleted LUN can be quickly restored when a restoration instruction for the LUN is subsequently received.
According to one embodiment, when a restoring instruction for any LUN is received and the LUN has a deletion time recorded in the deleted LUN record table, the LUN is restored, and a record corresponding to the LUN in the deleted LUN record table is deleted, and a record corresponding to the LUN in the deleted LUN allocation table of the RAID that needs to restore the fixed-length block is deleted.
In one example, the deleted LUN record table described above may be maintained by a LUN management module in the storage device, and the deleted LUN allocation table may be maintained by a corresponding RAID. The LUN management module may further record a mapping table of each LUN in the storage device.
For the convenience of understanding the present embodiment, the following describes the interactive process of the LUN management module and RAID by way of example in conjunction with fig. 2A-2C. Referring to fig. 2A-2C, fig. 2A-2C are a flowchart illustrating an interaction between a LUN management module and a RAID according to an embodiment of the present application, where the flowchart includes:
when deleting a LUN, the flow can be as shown in FIG. 2A:
step S201, the LUN management module issues a LUN delete command to the RAID, and checks whether the total number of records in the currently deleted LUN record table reaches a second threshold, if yes, step S202 is executed, and if no, step S203 is executed.
For an embodiment, for a newly deleted LUN, the LUN management module may determine, according to the recorded mapping table of the LUN, that the LUN needs to return at least one RAID of the long block, and send a LUN delete command to the at least one RAID, respectively. Wherein, the delete LUN command may contain the UUID of the newly deleted LUN.
In step S202, the record with the earliest deletion time included in the deleted LUN record table is deleted, and the deletion time of the LUN newly deleted is recorded in the deleted LUN record table.
In step S202, the number of deleted records from the deleted LUN record table is equal to the number of newly deleted LUNs, for example, if two LUNs are newly deleted, two records may be deleted from the deleted LUN record table.
As an embodiment, if the records in the deleted LUN record table are arranged in order from early to late deletion time, the LUN management module deletes the record with the earliest deletion time, which may specifically include: and deleting the record positioned at the forefront in the deleted LUN record table. For example, if the number of records to be deleted is 2, the first record and the second record in the deleted LUN record table may be deleted. In this embodiment, recording the deletion time of the newly deleted LUN into the deleted LUN record table includes: and recording the deletion time of the newly deleted LUN to the end of the deleted LUN record table.
In this step S202, the flow of deleting the record with the earliest deletion time may refer to fig. 2B described later.
In step S203, the deletion time of the LUN newly deleted is directly recorded in the deleted LUN record table.
In step S204, when receiving the LUN delete command, the RAID records the fixed-length block to which the LUN indicated to be deleted needs to be returned in the deleted LUN allocation table.
Thus, the flow shown in fig. 2A is completed.
When one or more records in the deleted LUN record table need to be deleted, the flow can refer to FIG. 2B:
step S301, the LUN management module determines at least one RAID of the LUN needing to return the fixed length block according to the mapping table of the LUN corresponding to the record to be deleted, sends a notification of clearing LUN information to the at least one RAID, and deletes the mapping table of the LUN corresponding to the record to be deleted and the record to be deleted; the notification of the LUN clearing information includes the UUID of the LUN.
In this step S301, if the record to be deleted corresponds to at least two LUNs, the notification may include UUIDs of the at least two LUNs.
Step S302, when receiving the LUN clearing information notification, the RAID marks the fixed-length block corresponding to the LUN in the LUN deleted allocation table as unassigned according to the UUID of the LUN included in the LUN clearing information notification, and deletes the record corresponding to the LUN from the LUN deleted record table.
Thus, the flow shown in fig. 2B is completed.
When any RAID needs to allocate M fixed-length blocks to a LUN, the process can be as shown in fig. 2C:
step S401, the RAID sequentially selects the fixed length blocks currently marked as unallocated, and if all the fixed length blocks currently marked as unallocated are selected, the total number of the selected fixed length blocks is N, and N is smaller than M, then M-N fixed length blocks are selected from the deleted LUN allocation table, and the selected M fixed length blocks are allocated to the LUN.
Step S402, if at least one deleted LUN corresponding to the selected M-N fixed-length blocks has the fixed-length blocks corresponding to any LUN not selected completely, the RAID marks the fixed-length blocks of which the LUN is not selected as unallocated, deletes the record corresponding to the at least one LUN, and sends a deletion record notification indicating to delete the record corresponding to the at least one LUN to the LUN management module.
In step S403, after receiving the notification of deleting a record, the LUN management module deletes the record corresponding to the at least one LUN indicated to be deleted by the notification of deleting a record from the deleted LUN record table.
In this step S403, how the LUN management module deletes the record corresponding to at least one LUN may refer to the flow illustrated in fig. 2B.
This completes the description of the flow shown in fig. 2A to 2C.
Through the interactive process between the LUN management module and the RAID shown in fig. 2A-2C, the deleted LUN record table and the deleted LUN allocation table can be updated synchronously, and it is ensured that LUNs having corresponding records in the deleted LUN record table maintained by the LUN management module can be recovered.
The method provided by the present application is described above, and the device provided by the present application is described below:
referring to fig. 3, fig. 3 is a structural diagram of a storage space allocation apparatus provided in the present application. As shown in fig. 3, the apparatus includes: a dividing unit 501, an allocation table creating unit 502, and an allocating unit 503.
In an example, the dividing unit 501 is configured to divide a storage space of a disk array RAID in a storage device into a plurality of fixed length blocks according to a specified length;
the above-mentioned distribution table creating unit 502 is configured to create a deleted LUN distribution table for each RAID in the above-mentioned storage device, where the deleted LUN distribution table is used to record a fixed-length block that the deleted LUN needs to be returned to the above-mentioned RAID, and for the fixed-length block recorded in the deleted LUN distribution table, the fixed-length block is not marked as unallocated;
the allocating unit 503 is configured to, when M fixed-length blocks in any RAID need to be allocated to a LUN, allocate, if N fixed-length blocks marked as unallocated in the current RAID coexist and M is greater than N, the N fixed-length blocks to the LUN, select M-N fixed-length blocks from the fixed-length blocks recorded in the deleted LUN allocation table of the RAID to allocate to the LUN, and delete records corresponding to the M-N fixed-length blocks.
Referring to fig. 4, fig. 4 is a structural diagram of another storage space allocation apparatus according to an embodiment of the present application. As shown in fig. 4, the storage space allocation apparatus provided in the present application further includes:
a record table creating unit 504 configured to create a deleted LUN record table, where the deleted LUN record table is used to record deletion time of a deleted LUN;
and a table management unit 505, configured to mark all fixed-length blocks of the first LUN to be restored as unallocated blocks when the deletion time of the first LUN in the deleted LUN record table meets a preset condition, delete a record corresponding to the first LUN in the deleted LUN record table, and delete a record corresponding to the first LUN in a deleted LUN allocation table of the RAID that needs to restore the fixed-length blocks.
As an embodiment, the table management unit 505 is specifically configured to:
when the deleted time of the first LUN reaches a first threshold value according to the deleted time of the first LUN, judging that the deleted time of the first LUN meets a preset condition; alternatively, the first and second electrodes may be,
when the total number of records in the deleted LUN record table reaches a second threshold and a new record needs to be added to the deleted LUN record table, if the deletion time of the first LUN is the earliest time in the deleted LUN record table, it is determined that the deletion time of the first LUN satisfies a preset condition.
As an embodiment, the table management unit 505 is further configured to:
when a fixed-length block exists in the fixed-length block to be restored of the second LUN recorded with deletion time in the deleted LUN record table, marking the non-allocated fixed-length block in the fixed-length block to be restored of the second LUN as non-allocated, deleting the record corresponding to the second LUN in the deleted LUN record table, and deleting the record corresponding to the second LUN in the deleted LUN allocation table of the RAID of the fixed-length block to be restored.
As an embodiment, the table management unit 505 is further configured to:
when a deletion instruction for any LUN is received, determining at least one RAID of the LUN needing to return the fixed-length block according to a mapping table of the LUN, recording the fixed-length block of the LUN needing to be returned to the RAID in a deleted LUN distribution table of each RAID in the at least one RAID, and recording the deletion time of the LUN into a deleted LUN recording table.
As an embodiment, the allocation table creating unit 502 is further configured to:
and when a recovery instruction for the third LUN is received, if the third LUN has a corresponding record in the deleted record table of the RAID, deleting the record.
The description of the apparatus provided in the present application is now complete. The implementation process of the functions and actions of the modules in the apparatus is specifically described in the implementation process of the corresponding steps in the method, and is not described herein again.
Referring to fig. 5, fig. 5 is a hardware structure diagram of a storage device to which the storage space allocation method of the present application is applied, where the hardware structure includes: a processor and a machine-readable storage medium.
Wherein the machine-readable storage medium is configured to store machine-executable instructions;
a processor configured to read and execute machine-executable instructions stored by the machine-readable storage medium to implement the storage space allocation method shown in fig. 1.
For one embodiment, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth. For example, the machine-readable storage medium may be: volatile machine-readable storage media, non-volatile machine-readable storage media, or similar storage media. In particular, the machine-readable storage medium may be a RAM (random Access Memory), a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., a compact disk, a DVD, etc.), or similar storage medium, or a combination thereof.
So far, the description of the apparatus shown in fig. 5 is completed.
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 the 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.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for allocating storage space, the method comprising:
dividing the storage space of a disk array RAID in the storage equipment into a plurality of fixed-length blocks according to the specified length;
creating a deleted LUN distribution table for each RAID in the storage equipment, wherein the deleted LUN distribution table is used for recording fixed-length blocks of a deleted LUN which need to be returned to the RAID, and the fixed-length blocks recorded in the deleted LUN distribution table are not marked as unallocated blocks;
when M fixed-length blocks in any RAID need to be allocated to a LUN, if N fixed-length blocks marked as unallocated exist in the current RAID and M is larger than N, the N fixed-length blocks are allocated to the LUN, M-N fixed-length blocks are selected from the fixed-length blocks recorded in the deleted LUN allocation table of the RAID and allocated to the LUN, and records corresponding to the M-N fixed-length blocks are deleted.
2. The method of claim 1, further comprising:
creating a deleted LUN record list, wherein the deleted LUN record list is used for recording the deletion time of the deleted LUN;
when the deletion time of the first LUN in the deleted LUN record table meets a preset condition, marking all fixed-length blocks of the first LUN to be returned as unallocated blocks, deleting the corresponding record of the first LUN in the deleted LUN record table, and deleting the corresponding record of the first LUN in the deleted LUN distribution table of the RAID of the fixed-length blocks to be returned.
3. The method of claim 2, further comprising:
when any LUN is deleted, a mapping table of the LUN is reserved; the mapping table is used for recording fixed length blocks forming the LUN and the RAID to which the fixed length blocks belong;
and deleting the mapping table of the LUN when deleting the corresponding record of any LUN in the deleted LUN record table or the deleted LUN distribution table and not restoring the LUN.
4. The method according to claim 2, wherein the deletion time of the first LUN is determined by:
when the deleted time of the first LUN reaches a first threshold value according to the deleted time of the first LUN, judging that the deleted time of the first LUN meets a preset condition; alternatively, the first and second electrodes may be,
when the total number of records in the deleted LUN record table reaches a second threshold and a new record needs to be added to the deleted LUN record table, if the deletion time of the first LUN is the earliest time in the deleted LUN record table, it is determined that the deletion time of the first LUN meets a preset condition.
5. The method of claim 2, further comprising:
when a fixed-length block exists in the fixed-length block to be restored of the second LUN recorded with deletion time in the deleted LUN record table, marking the non-allocated fixed-length block in the fixed-length block to be restored of the second LUN as non-allocated, deleting a record corresponding to the second LUN in the deleted LUN record table, and deleting a record corresponding to the second LUN in the deleted LUN allocation table of the RAID of the fixed-length block to be restored.
6. The method of claim 2, further comprising:
when a deleting instruction for any LUN is received, determining at least one RAID of the LUN needing to return the fixed-length blocks according to a mapping table of the LUN, recording the fixed-length blocks of the LUN needing to be returned to the RAID in a deleted LUN distribution table of each RAID in the at least one RAID, and recording the deleting time of the LUN into a deleted LUN recording table.
7. The method of claim 1, further comprising:
and when a recovery instruction for the third LUN is received, if the third LUN has a corresponding record in the deleted LUN allocation table of the RAID, recovering the third LUN, and deleting the record.
8. A storage space allocation apparatus, the apparatus comprising:
the dividing unit is used for dividing the available storage space of the RAID in the storage device into a plurality of fixed-length blocks according to the specified length;
an allocation table creating unit, configured to create a deleted LUN allocation table for each RAID in the storage device, where the deleted LUN allocation table is used to record a fixed-length block to which a deleted LUN needs to be returned to the RAID, and for the fixed-length block recorded in the deleted LUN allocation table, the fixed-length block is not marked as unallocated;
and the allocating unit is used for allocating the N fixed-length blocks to the LUN if the N fixed-length blocks marked as unallocated exist in the current RAID and M is larger than N when the M fixed-length blocks in any RAID need to be allocated to the LUN, selecting M-N fixed-length blocks from the fixed-length blocks recorded in the deleted LUN allocation table of the RAID to be allocated to the LUN, and deleting records corresponding to the M-N fixed-length blocks.
9. The apparatus of claim 8, further comprising:
a record table creating unit configured to create a deleted LUN record table, where the deleted LUN record table is used to record deletion time of a deleted LUN;
and the table management unit is used for marking all fixed-length blocks of the first LUN to be restored as unallocated blocks when the deletion time of the first LUN in the deleted LUN record table meets a preset condition, deleting the corresponding record of the first LUN in the deleted LUN record table, and deleting the corresponding record of the first LUN in the deleted LUN distribution table of the RAID of the fixed-length blocks to be restored.
10. The apparatus of claim 9, wherein the table management unit is specifically configured to:
when the deleted time of the first LUN reaches a first threshold value according to the deleted time of the first LUN, judging that the deleted time of the first LUN meets a preset condition; alternatively, the first and second electrodes may be,
when the total number of records in the deleted LUN record table reaches a second threshold and a new record needs to be added to the deleted LUN record table, if the deletion time of the first LUN is the earliest time in the deleted LUN record table, it is determined that the deletion time of the first LUN meets a preset condition.
CN202011407422.2A 2020-12-03 2020-12-03 Storage space allocation method and device Pending CN112416258A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011407422.2A CN112416258A (en) 2020-12-03 2020-12-03 Storage space allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011407422.2A CN112416258A (en) 2020-12-03 2020-12-03 Storage space allocation method and device

Publications (1)

Publication Number Publication Date
CN112416258A true CN112416258A (en) 2021-02-26

Family

ID=74829192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011407422.2A Pending CN112416258A (en) 2020-12-03 2020-12-03 Storage space allocation method and device

Country Status (1)

Country Link
CN (1) CN112416258A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104246716A (en) * 2012-12-19 2014-12-24 华为技术有限公司 Method and device for processing storage space object
CN106599115A (en) * 2016-11-30 2017-04-26 广东欧珀移动通信有限公司 Data protection method and device and terminal
CN107122131A (en) * 2017-04-18 2017-09-01 杭州宏杉科技股份有限公司 The method and device of automatic simplify configuration
US20200065192A1 (en) * 2018-08-27 2020-02-27 International Business Machines Corporation Data set allocation technique to preserve deleted data sets

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104246716A (en) * 2012-12-19 2014-12-24 华为技术有限公司 Method and device for processing storage space object
CN106599115A (en) * 2016-11-30 2017-04-26 广东欧珀移动通信有限公司 Data protection method and device and terminal
CN107122131A (en) * 2017-04-18 2017-09-01 杭州宏杉科技股份有限公司 The method and device of automatic simplify configuration
US20200065192A1 (en) * 2018-08-27 2020-02-27 International Business Machines Corporation Data set allocation technique to preserve deleted data sets

Similar Documents

Publication Publication Date Title
US10073640B1 (en) Large scale implementation of a plurality of open channel solid state drives
US8832371B2 (en) Storage system with multiple flash memory packages and data control method therefor
JP5608251B2 (en) How to determine explicit free data storage space in a data storage subsystem
CN107092442B (en) Storage system resource allocation method and device
US10542089B2 (en) Large scale implementation of a plurality of open channel solid state drives
CN108021513B (en) Data storage method and device
JP2020035300A (en) Information processing apparatus and control method
US8650381B2 (en) Storage system using real data storage area dynamic allocation method
JP6459644B2 (en) Storage control device, control system, and control program
US20100057990A1 (en) Storage System Logical Storage Area Allocating Method and Computer System
US11321229B2 (en) System controller and system garbage collection method
EP3798852B1 (en) System controller and system garbage recovery method
US9400723B2 (en) Storage system and data management method
CN109753224B (en) Storage structure and storage structure configuration method
US9547450B2 (en) Method and apparatus to change tiers
WO2013088474A2 (en) Storage subsystem and method for recovering data in storage subsystem
CN112416258A (en) Storage space allocation method and device
WO2018142622A1 (en) Computer
CN112463063A (en) Storage space allocation method and device
US20150378933A1 (en) Storage management apparatus, computer-readable recording medium having stored therein storage management program, and control method
US9620165B2 (en) Banded allocation of device address ranges in distributed parity schemes
CN113050892B (en) Method and device for protecting deduplication data
US11544005B2 (en) Storage system and processing method
CN113568584A (en) Method and device for protecting deduplication data
WO2018116392A1 (en) Information processing system and information processing method

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210226

RJ01 Rejection of invention patent application after publication