Methods and electronic devices for expanding the capacity of mirrored volumes

By using dual bitmaps to record the formatting progress and data synchronization status during the mirror volume expansion process, the problem of mirror volumes not being usable immediately after expansion is solved, enabling real-time capacity updates and improved user experience.

CN120723175BActive Publication Date: 2025-10-31INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511220688.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-10-31
Estimated Expiration
2045-08-28

AI Technical Summary

Technical Problem

After a mirrored volume is expanded, the expanded capacity cannot be used immediately. It needs to wait for the newly expanded blocks to be formatted before it can be presented and used by the user, resulting in a poor user experience.

Method used

By receiving a command to quickly expand the mirror volume, the target expansion capacity is determined and a first bitmap and a second bitmap are requested. The first bitmap is used to record the formatting progress, and the second bitmap is used to record the data synchronization status. After formatting is completed, the formatting progress and data synchronization status are displayed, thus realizing real-time updates of the mirror volume capacity.

Benefits of technology

After a mirrored volume is expanded, its capacity is updated and made available immediately, improving the user experience, reducing waiting time, and increasing storage resource utilization and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723175B_ABST
    Figure CN120723175B_ABST
Patent Text Reader

Abstract

This invention discloses a method and electronic device for managing the expansion of a mirrored volume, relating to the field of data storage technology. The method includes: determining the bitmap space required for expanding the mirrored volume; requesting a first bitmap and a second bitmap based on the bitmap space; using the first bitmap to record the formatting progress of the mirrored volume based on the target expansion capacity and using the second bitmap to record the data synchronization status of the mirrored volume; and displaying the formatting progress, data synchronization status, and expanded capacity of the mirrored volume to a terminal after the mirrored volume has been formatted based on the target expansion capacity. This solves the problem that the expanded capacity cannot be used immediately after mirrored volume expansion, requiring the newly expanded blocks to be formatted before being presented and used by the user, resulting in a poor user experience. By using two bitmaps to record the formatting progress and data differences between volume copies, rapid formatting of the mirrored volume can be achieved, making the expanded capacity immediately updated and available.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data storage technology, and in particular to a method and electronic device for expanding and managing mirrored volumes. Background Technology

[0002] Fast expansion of a regular volume refers to releasing the used formatted bitmap after the volume has been formatted to its full capacity, updating the volume state from FORMATING to FRESH, and only then can expansion proceed. During expansion, the bitmap used for formatting is reallocated based on the expanded volume capacity, and the starting point of formatting and the number of grains to be formatted are marked before formatting the newly allocated capacity. A mirrored volume, on the other hand, consists of two copy volumes (Cdisks). When a mirrored volume is created, the bitmap allocated is initially used as the bitmap for formatting the primary copy. Only after the primary copy is formatted will data synchronization between the two volume copies occur, at which point the bitmap becomes a record of the data differences between the two volume copies.

[0003] In existing technologies, only fast expansion is available for non-mirrored volumes. However, in mirrored volume functionality, because the bitmap is used to record data differences between two volume copies and cannot record the unformatted portion after expansion, mirrored volumes can only rely on the underlying module for slow formatting. When the expansion command is executed, the expanded portion of the mirrored volume cannot be used immediately, nor will it be displayed when viewing the volume capacity. It can only rely on the underlying module to slowly format the newly expanded portion. Only after the slow formatting is complete will the usable capacity be updated to the expanded capacity for the user, resulting in a poor user experience. Summary of the Invention

[0004] This invention provides a method and electronic device for managing the expansion of mirrored volumes, in order to at least solve the problem that after a mirrored volume is expanded, the expanded capacity cannot be used immediately, and users must wait for the newly expanded blocks to be formatted before they can be presented and used, resulting in a poor user experience.

[0005] This invention provides a method for managing the expansion of a mirrored volume, comprising the following steps: receiving a mirrored volume fast expansion command; determining the target expansion capacity of the mirrored volume based on the mirrored volume fast expansion command; and determining the target bitmap space required for the mirrored volume expansion based on the target expansion capacity; requesting a first bitmap and a second bitmap according to the target bitmap space; using the first bitmap to record the formatting progress of the mirrored volume based on the target expansion capacity and using the second bitmap to record the data synchronization status of the mirrored volume; and displaying the formatting progress, the data synchronization status, and the expanded capacity of the mirrored volume to a target terminal after the mirrored volume has been formatted based on the target expansion capacity.

[0006] This invention also provides a mirror volume expansion management system, comprising: a determining module, configured to receive a mirror volume fast expansion command, determine the target expansion capacity of the mirror volume based on the mirror volume fast expansion command, and determine the target bitmap space required for the mirror volume expansion based on the target expansion capacity; a management module, configured to request a first bitmap and a second bitmap according to the target bitmap space, use the first bitmap to record the formatting progress of the mirror volume based on the target expansion capacity, and use the second bitmap to record the data synchronization status of the mirror volume; and a display module, configured to display the formatting progress, the data synchronization status, and the expanded capacity of the mirror volume to a target terminal after the mirror volume has been formatted based on the target expansion capacity.

[0007] The present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the above-described method for expanding the capacity of a mirror volume when executing the computer program.

[0008] The present invention also provides a non-volatile computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described method for expanding the capacity of a mirror volume.

[0009] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for expanding and managing the size of a mirrored volume.

[0010] This invention determines the target expansion capacity of a mirrored volume based on a fast expansion command and identifies the target bitmap space required for the expansion. It then requests a first bitmap and a second bitmap based on the target bitmap space. The first bitmap records the formatting progress of the mirrored volume based on the target expansion capacity, and the second bitmap records the data synchronization status of the mirrored volume. After the mirrored volume is formatted based on the target expansion capacity, the formatting progress, data synchronization status, and expanded capacity are displayed to the terminal. This solves the problem of users not being able to immediately use the expanded capacity after expansion, having to wait for the newly expanded blocks to be formatted before it can be presented and used, resulting in a poor user experience. By using dual bitmaps to record the formatting progress of the unformatted units of the mirrored volume and the data differences between the volume copies, fast formatting of the mirrored volume can be achieved, making the expanded capacity immediately updated and usable, thus improving the user experience of the mirrored volume expansion function. Attached Figure Description

[0011] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 A flowchart illustrating the method for expanding and managing mirrored volumes in related technologies;

[0013] Figure 2 A flowchart illustrating a method for expanding the capacity of a mirror volume according to an embodiment of the present invention;

[0014] Figure 3 This is a flowchart illustrating a method for expanding and managing a mirrored volume according to an embodiment of the present invention.

[0015] Figure 4 This is a schematic diagram of a mirror volume expansion management system according to an embodiment of the present invention;

[0016] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0018] It should be noted that, in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0019] The process of existing mirror volume expansion management methods is as follows: Figure 1 As shown:

[0020] 1. Create a storage pool in cluster A and create a mirrored volume. The size of the mirrored volume is 320GB, and the storage unit size of the mirrored volume is 256KB, so the size of the bitmap is 160KB.

[0021] 2. The primary copy of the mirror volume is formatted. At this time, the bitmap of the mirror volume is used as a formatting bitmap to record the number and location of unformatted grains. The bitmap type is FORMAT. The progress of volume formatting can be viewed through the command line.

[0022] 3. After the primary copy is formatted, it will release the bitmap, and the secondary copy will reuse the bitmap. The mirror volume will synchronize the data between the primary and secondary copies. At this time, the bitmap type will change to the unavailable type STALE, which is used to record the location of data differences between the two volume copies and the number of differences. The synchronization progress between the volume copies can be viewed through the command line.

[0023] 4. After the two volume copies of the mirrored volume are synchronized, the bitmap type will change to the unallocated state UNASSIGNED, indicating that there are no differences between the volume copies;

[0024] 5. Expand the mirror volume by 320GB. The total capacity of the mirror volume after the expansion should be 640GB.

[0025] 6. After executing the command to expand the mirror volume, the mirror volume will request new block extents from the storage pool;

[0026] 7. The bitmap of the mirrored volume will be released first, and then a new 320KB bitmap will be requested. The bitmap type is still UNASSIGNED; this indicates that there is no difference between the two volume copies.

[0027] 8. At this time, the newly expanded capacity of the volume resource Vdisk will not be displayed to the user, and the size of the mirror volume queried by the lsvdisk command will still be 320GB;

[0028] 9. The VR (Virtualization) module initializes the entire Extent of a newly requested block with all zeros written. The progress of the VR module's formatting can be queried via command.

[0029] 10. After the VR module is formatted, the size of the image volume retrieved by the lsvdisk command will be the expanded capacity of 640GB.

[0030] However, with current technology, after expanding the mirrored volume, the expanded capacity can only be used by users after the VR module has completed a slow formatting process of writing all zeros to the expanded extent. If the expanded capacity is large, the waiting time for users will be very long, resulting in a poor user experience.

[0031] To address the above problems, this invention provides a method for managing the expansion of mirror volumes.

[0032] The terms used in this invention are defined as follows:

[0033] In the context of data backup, a cluster refers to a large computer service system composed of one or more storage devices connected by a high-speed communication network. This system provides storage services to users as a whole.

[0034] In storage data backup functions, IOGROUP refers to an input / output group. An IOGROUP consists of multiple nodes, and a cluster can have one or more IOGROUPs.

[0035] In the context of storage data backup, MR Mirrored refers to the volume mirroring management module.

[0036] vdisk (virtual disk) is used as a disk mapping for host use.

[0037] A cdisk copy disk exists as an entity of a vdisk. A vdisk can have one or more cdisks.

[0038] A mirrored volume refers to a vdisk having two copies of the same volume. These two copies can belong to different storage pools, or they can belong to the same storage pool.

[0039] In storage data backup functionality, a Domain refers to a unit that can operate independently in a multi-controller environment. A Domain can contain Owner nodes and Backup nodes; each IOGROUP consists of 4 Domains; when there are two IOGROUPs in the cluster, the Domain ID of IOGROUP 0 is 0 to 3, while the Domain ID of IOGROUP 1 is 4 to 7.

[0040] As the main processing node for transactions and I / O in a Domain, the Owner node initiates the mirror volume copy synchronization process for the Grain belonging to that Domain when performing mirror volume copy synchronization operations.

[0041] Backup nodes are used as backup nodes in a Domain. When the bitmap information of the Domain changes, it needs to be synchronized from the Owner node to the Backup node. This ensures that even if the Owner node fails, the Backup node can use the bitmap information synchronized from the Owner node to switch its role to the Owner node and immediately take over the business processing.

[0042] In the context of storing data backup mirror volumes, staleBitmap refers to a bitmap that records the data differences between two copies of a mirror volume.

[0043] In storage data backup functionality, Grain refers to the smallest manageable unit consisting of multiple LBAs (Logical Block Addresses).

[0044] FORMATING status: In storage data backup, this indicates that the volume copy is being formatted; FRESH status: In storage data backup, this indicates that the data in the volume copy is up-to-date and available; STALE status: In storage data backup, this indicates that the data in the volume copy is outdated and unavailable.

[0045] An extent (logical disk) is divided into multiple extents according to a certain size and provided to the volume module. The VR (Virtualization) layer performs virtualization management of the physical space of the disk, dividing it into multiple extents for use in creating vdisk.

[0046] Specifically, such as Figure 2 As shown, the method for managing the expansion of this mirror volume includes the following steps:

[0047] Step S201: Receive a mirror volume fast expansion command, determine the target expansion capacity of the mirror volume based on the mirror volume fast expansion command, and determine the target bitmap space required for the mirror volume expansion based on the target expansion capacity.

[0048] The mirror volume quick expansion command is an instruction issued by the user through a specific command or tool to quickly increase the storage capacity of a mirror volume.

[0049] Optionally, in some embodiments, determining the target bitmap space required for the expansion of the mirror volume based on the target expansion capacity includes: determining the current capacity of the mirror volume; if the current capacity is less than the target expansion capacity, then determining the target bitmap space based on the difference between the current capacity and the target expansion capacity.

[0050] Specifically, in the Csm (Cluster Storage Manager) and storage agent sides of the cluster, the present invention adds a counting array to the Cdisk data structure to record the number of unformatted grains in each domain after expansion.

[0051] On the Csm side of the cluster, add a data structure to the Cdisk data structure to record the volume formatting progress;

[0052] When executing the mirror volume expansion command, record the original capacity of the mirror volume old_grain_size and the target expansion capacity new_grain_size;

[0053] Based on the expanded capacity, calculate the bitmap size required after the mirror volume is expanded. For example, if the capacity before the expansion is 320GB, the required bitmap size is 160KB. If the target expansion capacity is 640GB, the required bitmap size after the expansion is 360KB. The specific bitmap size is obtained by using the relevant calculation methods of capacity and bitmap space in the existing technology.

[0054] For example, a storage administrator sends a command to the cluster via the storage management interface or command-line tool to quickly expand the size of the mirrored volume, requesting that the capacity of the mirrored volume be expanded from the current 500GB to 1000GB.

[0055] After receiving the expansion command, the cluster's mirror volume management module parses the command content and determines that the target expansion capacity of the mirror volume is 1000GB.

[0056] The mirror volume management module queries the metadata information of the mirror volume and obtains that the current capacity of the mirror volume is 500GB.

[0057] Comparing the current capacity of 500GB with the target expansion capacity of 1000GB, it is found that the current capacity is less than the target expansion capacity, i.e., 500GB < 1000GB, indicating that an expansion operation is needed.

[0058] The target bitmap space is further determined based on the difference between the current capacity and the target expansion capacity.

[0059] By using the above technical solution, the target bitmap space is determined by accurately calculating the difference between the current capacity and the target expansion capacity. This ensures that resources are allocated only to the bitmap space that is actually needed. No additional bitmap space adjustment operations are required during the expansion process, which can significantly shorten the cycle of mirror volume expansion.

[0060] Step S202: Request a first bitmap and a second bitmap according to the target bitmap space. Use the first bitmap to record the formatting progress of the mirror volume based on the target expansion capacity and use the second bitmap to record the data synchronization status of the mirror volume.

[0061] Optionally, in some embodiments, using a first bitmap to record the formatting progress of the mirror volume based on the target expansion capacity and using a second bitmap to record the data synchronization status of the mirror volume includes: using a first bitmap to record the formatting progress of the primary copy of the mirror volume based on the target expansion capacity, and using a second bitmap to record the data synchronization status between the primary copy and the secondary copy of the mirror volume.

[0062] It should be understood that when requesting a bitmap for expanding a mirror volume based on the target expansion capacity, two bitmaps need to be requested. The first bitmap is the formatting bitmap, which is in the FORMATTING state and is used to record the unformatted storage units formatting_grain. The formatting bitmap records the starting point of the formatting with old_grain_size as the starting position. The second bitmap is the volume copy synchronization bitmap, which is in the STALE state and is used to record the stale_grain of the data difference between the primary and secondary copies of the two mirror volumes.

[0063] The above technical solution allocates a first bitmap and a second bitmap based on the target bitmap space, which are used to record the formatting progress and data synchronization status, respectively. The first bitmap clearly shows which storage units in the primary copy of the mirror volume have been formatted and which are still being processed, thus avoiding duplicate or missed formatting. The second bitmap accurately records the data synchronization status between the primary and secondary copies, ensuring data consistency and integrity.

[0064] Optionally, in some embodiments, the formatting progress of the primary copy of the mirror volume being formatted based on the target expansion capacity is recorded using the first bit diagram, including: determining the unformatted storage units of the primary copy of the mirror volume based on the target expansion capacity; formatting the unformatted storage units; and recording and updating the number of unformatted storage units and the formatting progress in the primary copy using the first bit diagram.

[0065] The newly expanded portion of the mirror volume is marked as unformatted in the first image. The original capacity has already been formatted because the volume copy synchronization is underway, so it does not need to be formatted again. Only the newly expanded portion needs to be formatted.

[0066] In the mirrored volume selection, use the FRESH volume copy that is in an available state as the primary copy and change the status of the primary volume copy to FORMATING. Use the other volume copy as the secondary copy and change the status of the secondary copy to STALE.

[0067] When formatting, the mirror volume management module formats the unformatted storage units of the primary copy, using the first-bit graph to record and update the number of unformatted storage units and the formatting progress in the primary copy.

[0068] The above technical solution utilizes the first bitmap to record and update the number of unformatted storage units and the formatting progress in the master copy, enabling the system to monitor the formatting progress in real time. As the formatting operation proceeds, the number of unformatted storage units gradually decreases, and the corresponding marker bits in the bitmap are updated, thus intuitively reflecting the formatting progress.

[0069] Optionally, in some embodiments, when formatting an unformatted storage cell, the method further includes: performing a write all-zero operation on the unformatted storage cell and updating the state of the unformatted storage cell in the first figure to a formatted state.

[0070] It's understandable that unformatted storage units might contain random data left over from previous use. This data has no practical meaning and could interfere with subsequent data storage and management. By writing all zeros, the storage unit can be initialized to a uniform and clean state, laying the foundation for subsequent normal data write and read operations.

[0071] This invention performs a write all-zero operation on the unformatted storage cell and uses the first bit diagram to update the state of the unformatted storage cell to a formatted state, indicating that the unformatted storage cell has been formatted.

[0072] By employing the above technical solution, performing a write-all-zero operation on unformatted storage cells provides a unified and clean foundation for subsequent data storage. In a storage system, unformatted storage cells may contain residual random data, which could interfere with the correct writing and reading of new data. By writing all zeros, all unformatted storage cells are initialized to the same, deterministic state. After the write-all-zero operation is completed, the bitmap state is updated promptly, allowing the system to clearly understand which storage cells have been formatted and which have not yet been processed.

[0073] Optionally, in some embodiments, after updating the state of the unformatted storage unit in the first bitmap to a formatted state, the method includes: synchronizing the formatted state of the unformatted storage unit of the primary copy of the mirror volume to the secondary copy, and updating the data synchronization state of the second bitmap.

[0074] Understandably, after updating the state of the unformatted storage units in the first bitmap to a formatted state, data synchronization between volume copies is performed. This involves synchronizing the formatted state of the unformatted storage units in the primary copy of the mirrored volume to the secondary copy, and then using the second bitmap to update the data synchronization state between the primary and secondary copies.

[0075] By using the above technical solution, after updating the unformatted storage unit status of the primary copy in the first diagram to a formatted status, the formatted status of the formatted storage unit is synchronized to the secondary copy. This ensures that the primary and secondary copies maintain a high degree of consistency in data storage status, avoiding data access errors caused by inconsistent status.

[0076] Optionally, in some embodiments, when formatting the unformatted storage unit, the method further includes: detecting whether there is a copy failure when formatting the primary copy of the mirror volume based on the target expansion capacity; if there is a copy failure when formatting the primary copy of the mirror volume based on the target expansion capacity, then switching the primary copy to a secondary copy that is in an available state as the new primary copy, so as to use the new primary copy to format based on the target expansion capacity.

[0077] Specifically, the image management module records the formatting progress of the primary copy of the image volume in real time when formatting based on the target expansion capacity. If the actual progress lags behind the expected progress for a long time without a reasonable explanation (such as temporary system resource overload), a copying failure may exist. For example, if it is expected that 50% of the formatting will be completed within 10 minutes, but only 30% is completed after 20 minutes, and the system load is not high, this may indicate a failure.

[0078] When a potential failure is detected in the primary copy, the system will further evaluate the availability of the secondary copy. If the secondary copy is available, a primary-secondary copy switch can be considered, and the new primary copy can be formatted based on the target expansion capacity.

[0079] With the above technical solution, detecting copy failures is crucial when the primary copy of the mirrored volume is formatted based on the target expansion capacity. Once a primary copy failure is detected, the available secondary copy is immediately switched to become the new primary copy, and the formatting operation continues using the new primary copy. This mechanism ensures that a usable data copy is always available for system access and use, preventing data from becoming unreadable due to primary copy failure.

[0080] Optionally, in some embodiments, after the primary copy of the mirror volume is formatted based on the target expansion capacity, the method further includes: releasing the first bit map and changing the state of the primary copy of the mirror volume to an available state.

[0081] Understandably, after the primary copy of the mirrored volume is formatted based on the target expansion capacity, the first bitmap changes from a formatted state to an unallocated state and is released. The primary copy of the mirrored volume is then converted to an available state, while the second bitmap is retained to continue recording the data differences between the two volume copies.

[0082] Using the above technical solution, the first graph occupies a certain amount of memory space while recording the formatting progress of the mirror volume's primary copy. Once the primary copy completes formatting based on the target expansion capacity, the first graph is released promptly, quickly reclaiming the occupied memory resources. Once formatting is complete, the primary copy's state is promptly changed to an available state, allowing applications to immediately access and use the expanded primary copy storage space, reducing business interruption time.

[0083] Optionally, in some embodiments, when the mirror volume is formatted based on the target expansion capacity, the process includes: receiving a user's instruction to view the formatting progress; and based on the instruction to view the formatting progress, sending the formatting progress of the mirror volume and the data synchronization status of the mirror volume to the target terminal.

[0084] Specifically, users can enter specific commands in the system's command-line terminal to trigger an instruction to view the formatting progress. Upon receiving the command, the system first verifies its validity. For example, it checks whether the command format is correct and whether the user has the necessary permissions to execute it. If the command is invalid, the system returns a corresponding error message to the user, prompting them to re-enter the correct command.

[0085] The system sends the formatting progress and data synchronization status of the mirror volume to the target terminal based on the received instructions, so that the capacity of the mirror volume can be updated in real time.

[0086] Through the above technical solution, users can actively send commands to view the formatting progress and obtain real-time information, clearly understanding the progress of mirror volume formatting and data synchronization.

[0087] Step S203: After the mirror volume is formatted based on the target expansion capacity, the formatting progress of the mirror volume, the data synchronization status of the mirror volume, and the expanded capacity of the mirror volume are displayed to the target terminal.

[0088] After the mirrored volume expansion command is executed, the newly expanded volume capacity can be displayed to the user. For example, if the volume capacity is expanded from 320GB to 640GB, the volume capacity will immediately display 640GB after the command is executed, without having to perform an extended slow format through the VR module before displaying it.

[0089] To enable those skilled in the art to further understand the image volume expansion management method of the embodiments of this application, the following detailed description is provided in conjunction with specific embodiments, as follows: Figure 3 As shown.

[0090] 1. On both the Csm and Agent sides of the cluster, add a counting array to the Cdisk data structure to record the number of unformatted grains to be formatted, and record the number of unformatted grains in each domain after expansion;

[0091] 2. On the Csm side of the cluster, add a data structure to the Cdisk data structure to record the volume formatting progress;

[0092] 3. When executing the mirror volume expansion command, record the original capacity of the mirror volume old_grain_size and the expanded capacity new_grain_size;

[0093] 4. Based on the expanded capacity, calculate the bitmap size required after the mirror volume is expanded. For example, if the capacity before the expansion is 320GB, the required bitmap size is 160KB. If the capacity after the expansion is 640GB, the required bitmap size is 360KB.

[0094] 5. When requesting bitmaps for expanding a mirrored volume, two bitmaps need to be requested. One is a formatting bitmap, which is used to record the formatting_grain that has not been formatted. The formatting bitmap records the starting point of formatting with old_grain_size as the starting position. The other is a volume copy synchronization bitmap, which is used to record the stale_grain that shows the data differences between the two volume copies.

[0095] 6. The newly expanded portion of the mirror volume is marked as unformatted in the formatting bitmap. The original capacity has already been formatted because the volume copy synchronization is underway, and will not be formatted again.

[0096] 7. After the mirror volume expansion command is executed, the newly expanded volume capacity can be displayed to the user. For example, if the volume capacity is expanded from 320GB to 640GB, the volume capacity will immediately display 640GB after the command is executed, without having to perform an extended slow format through the VR module before displaying it.

[0097] 8. Select one of the currently available, FRESH volume copies in the mirrored volume as the primary copy, and change the status of the primary volume copy to FORMATING. Select the other volume copy as the secondary copy, and change the status of the secondary copy to STALE.

[0098] 9. When the primary copy is formatted, the mirror volume management module will format the unformatted storage units of the primary copy and update the number of unformatted storage units and the formatting progress. Users can query the formatting progress of the volume through commands.

[0099] 10. If the host I / O is sent to an unformatted storage unit (Grain) at this time, the storage unit (Grain) will first be formatted by writing all zeros I / O, updating the formatted state of the storage unit in the formatted bitmap to an available state, and then data synchronization between volume copies will be performed.

[0100] 11. After the primary copy of the volume is formatted, the formatting bitmap state is changed from the formatted state FORMATING to the unallocated state UNASSIGN, and the bitmap is released. The primary copy of the volume is then changed to the available state FRESH. The second bitmap used for synchronization between volume copies is retained, and the data differences between the two volume copies continue to be recorded.

[0101] In summary, the technical effects brought about by the embodiments of the present invention are as follows:

[0102] (1) Resource management

[0103] To avoid wasting storage space: the target bitmap space is determined based on the difference between the current capacity and the target expansion capacity. Only the actual bitmap storage resources are allocated, which prevents storage resources from being idle and wasted due to rough estimation and allocation of too much bitmap space, thereby improving the utilization rate of storage resources.

[0104] (2) Capacity expansion operations

[0105] Reduce expansion time: Since the target bitmap space is precisely determined, the expansion process does not require additional bitmap space adjustment operations, avoiding the time wasted due to repeated bitmap adjustments, and significantly shortening the mirror volume expansion cycle. By using dual bitmaps to record the formatting progress of the unformatted units of the mirror volume and the data differences between the mirror volume copy, the mirror volume can be formatted quickly, so that the capacity of the mirror volume is updated and available immediately after expansion, improving the user experience of the mirror volume expansion function.

[0106] (3) System stability

[0107] When the primary copy of the mirrored volume is formatted based on the target expansion capacity, if a failure of the primary copy is detected, the available secondary copy is immediately switched to become the new primary copy, and the formatting operation continues using the new primary copy. This ensures that a usable data copy is always available for system access and use, preventing situations where data becomes unreadable due to primary copy failure.

[0108] (4) User experience

[0109] Provides a transparent operating experience: Users can clearly understand the formatting progress of unformatted storage units in the mirrored volume, improving user satisfaction with the storage system.

[0110] According to the image volume expansion management method proposed in this embodiment, the target expansion capacity of the image volume is determined based on the image volume fast expansion command, and the target bitmap space required for the image volume expansion is also determined. A first bitmap and a second bitmap are requested according to the target bitmap space. The first bitmap is used to record the formatting progress of the image volume based on the target expansion capacity, and the second bitmap is used to record the data synchronization status of the image volume. After the image volume is formatted based on the target expansion capacity, the formatting progress, data synchronization status, and expanded capacity of the image volume are displayed to the terminal. This solves the problem that the expanded capacity cannot be used immediately after image volume expansion, requiring waiting for the newly expanded blocks to be formatted before being presented and used by the user, resulting in a poor user experience. By recording the formatting progress of the unformatted units of the image volume and the data differences between the volume copies of the image volume using two bitmaps, fast formatting of the image volume can be achieved, making the expanded capacity immediately updated and available, thus improving the user experience of the image volume expansion function.

[0111] Next, the image volume expansion management system proposed according to an embodiment of the present invention is described with reference to the accompanying drawings.

[0112] Figure 4 This is a schematic diagram of the mirror volume expansion management system according to an embodiment of the present invention.

[0113] like Figure 4 As shown, the mirror volume expansion management system 10 includes: a determination module 100, a management module 200, and a display module 300.

[0114] The module 100 is used to receive a quick expansion command for the mirror volume, determine the target expansion capacity of the mirror volume based on the quick expansion command, and determine the target bitmap space required for the expansion of the mirror volume based on the target expansion capacity; the management module 200 is used to request a first bitmap and a second bitmap according to the target bitmap space, use the first bitmap to record the formatting progress of the mirror volume based on the target expansion capacity, and use the second bitmap to record the data synchronization status of the mirror volume; the display module 300 is used to display the formatting progress, data synchronization status, and expanded capacity of the mirror volume to the target terminal after the mirror volume is formatted based on the target expansion capacity.

[0115] Optionally, in some embodiments, the management module 200 is further configured to: use a first bitmap to record the formatting progress of the primary copy of the mirror volume being formatted based on the target expansion capacity, and use a second bitmap to record the data synchronization status between the primary copy and the secondary copy of the mirror volume.

[0116] Optionally, in some embodiments, the management module 200 is further configured to: determine the unformatted storage units of the primary copy of the mirror volume based on the target expansion capacity; format the unformatted storage units, and use the first bit map to record and update the number of unformatted storage units and the formatting progress in the primary copy.

[0117] Optionally, in some embodiments, after the primary copy of the mirror volume is formatted based on the target expansion capacity, the display module 300 is further configured to: release the first bit image and convert the state of the primary copy of the mirror volume to an available state.

[0118] Optionally, in some embodiments, when formatting an unformatted storage unit, the management module 200 is further configured to: detect whether there is a copy failure when formatting the primary copy of the mirror volume based on the target expansion capacity; if there is a copy failure when formatting the primary copy of the mirror volume based on the target expansion capacity, then switch the primary copy to a secondary copy that is in an available state as the new primary copy, so as to use the new primary copy to format based on the target expansion capacity.

[0119] Optionally, in some embodiments, when formatting an unformatted storage cell, the management module 200 is further configured to: perform a write all-zero operation on the unformatted storage cell and update the state of the unformatted storage cell in the first diagram to a formatted state.

[0120] Optionally, in some embodiments, after updating the state of the unformatted storage unit in the first bitmap to a formatted state, the management module 200 is further configured to: synchronize the formatted state of the unformatted storage unit of the primary copy of the mirror volume to the secondary copy, and update the data synchronization state of the second bitmap.

[0121] Optionally, in some embodiments, when the mirror volume is formatted based on the target expansion capacity, the management module 200 is further configured to: receive a user's instruction to view the formatting progress; and based on the instruction to view the formatting progress, send the formatting progress of the mirror volume and the data synchronization status of the mirror volume to the target terminal.

[0122] Optionally, in some embodiments, the determining module 100 is further configured to: determine the current capacity of the mirror volume; if the current capacity is less than the target expansion capacity, determine the target bitmap space based on the difference between the current capacity and the target expansion capacity.

[0123] It should be noted that the description of the features in the embodiment corresponding to the image volume expansion management system can be found in the relevant description of the embodiment corresponding to the above image volume expansion management method, and will not be repeated here.

[0124] Figure 5This is a schematic diagram of an electronic device provided in an embodiment of the present invention. The electronic device may include:

[0125] The memory 501, the processor 502, and the computer program stored on the memory 501 and capable of running on the processor 502.

[0126] When the processor 502 executes the program, it implements the image volume expansion management method provided in the above embodiments.

[0127] Furthermore, electronic devices also include:

[0128] Communication interface 503 is used for communication between memory 501 and processor 502.

[0129] The memory 501 is used to store computer programs that can run on the processor 502.

[0130] Memory 501 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0131] If the memory 501, processor 502, and communication interface 503 are implemented independently, then the communication interface 503, memory 501, and processor 502 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0132] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 503 are integrated on a single chip, then the memory 501, processor 502, and communication interface 503 can communicate with each other through an internal interface.

[0133] Processor 502 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

[0134] Embodiments of the present invention also provide a non-volatile computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described embodiments of the image volume expansion management method when running.

[0135] In one exemplary embodiment, the aforementioned non-volatile computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0136] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for expanding and managing the image volume.

[0137] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0138] The above provides a detailed description of the image volume expansion management method and electronic device provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only intended to help understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims

1. A method for managing the expansion of a mirrored volume, characterized in that, include: Receive a mirror volume fast expansion command, determine the target expansion capacity of the mirror volume based on the mirror volume fast expansion command, and determine the target bitmap space required for the mirror volume expansion based on the target expansion capacity; Request a first bitmap and a second bitmap according to the target bitmap space, use the first bitmap to record the formatting progress of the mirror volume based on the target expansion capacity, and use the second bitmap to record the data synchronization status of the mirror volume; After the mirror volume is formatted based on the target expansion capacity, the formatting progress of the mirror volume, the data synchronization status of the mirror volume, and the expanded capacity of the mirror volume are displayed to the target terminal.

2. The method for expanding and managing mirrored volumes according to claim 1, characterized in that, The step of using the first bitmap to record the formatting progress of the mirror volume based on the target expansion capacity and using the second bitmap to record the data synchronization status of the mirror volume includes: The first bitmap is used to record the formatting progress of the primary copy of the mirror volume based on the target expansion capacity, and the second bitmap is used to record the data synchronization status between the primary copy and the secondary copy of the mirror volume.

3. The method for expanding and managing mirrored volumes according to claim 2, characterized in that, The formatting progress of the primary copy of the mirror volume being formatted based on the target expansion capacity using the first bitmap includes: Based on the target expansion capacity, determine the unformatted storage units of the primary copy of the mirror volume; The unformatted storage units are formatted, and the number of unformatted storage units and the formatting progress in the master copy are recorded and updated using the first bitmap.

4. The method for expanding and managing mirrored volumes according to claim 3, characterized in that, After the primary copy of the mirror volume is formatted based on the target expansion capacity, the following is also included: Release the first bitmap and change the state of the primary copy of the mirror volume to an available state.

5. The method for expanding and managing mirrored volumes according to claim 3, characterized in that, Formatting the unformatted storage unit includes: Detect whether there is a copy failure when the primary copy of the mirror volume is formatted based on the target expansion capacity; If the primary copy of the mirror volume experiences a copy failure during formatting based on the target expansion capacity, the primary copy is switched to a secondary copy that is in an available state as the new primary copy, so that the new primary copy can be used for formatting based on the target expansion capacity.

6. The method for expanding and managing mirrored volumes according to claim 5, characterized in that, The formatting process for the unformatted storage unit also includes: A write operation of all zeros is performed on the unformatted storage cell, and the state of the unformatted storage cell in the first bitmap is updated to a formatted state.

7. The method for expanding and managing mirrored volumes according to claim 6, characterized in that, After updating the state of the unformatted storage cell in the first bitmap to a formatted state, the process includes: The formatted state of the unformatted storage units of the primary copy of the mirror volume is synchronized to the secondary copy, and the data synchronization state of the second bitmap is updated.

8. The method for expanding and managing mirrored volumes according to claim 1, characterized in that, When the mirror volume is formatted based on the target expanded capacity, the following is included: Receive user commands to view formatting progress; Based on the command to view the formatting progress, the formatting progress of the mirror volume and the data synchronization status of the mirror volume are sent to the target terminal.

9. The method for expanding and managing mirrored volumes according to claim 1, characterized in that, The step of determining the target bitmap space required for mirror volume expansion based on the target expansion capacity includes: Determine the current capacity of the mirror volume; If the current capacity is less than the target expansion capacity, the target bitmap space is determined based on the difference between the current capacity and the target expansion capacity.

10. An electronic device, characterized in that, The device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the method for expanding the size of a mirror volume as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Real-time snapshot capacity expansion method and system

    CN111930562A

  • Double-live volume expansion method and related device

    CN111949223A