Failure handling method of storage system and electronic device
Patent Information
- Application Number
- CN202611543119.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-30
- Publication Date
- 2026-11-03
AI Technical Summary
When a storage system fails, reverse lookup of the physical block address is time-consuming and resource-intensive, making it difficult to quickly handle the fault and affecting normal business operations.
By using a pre-set reverse mapping array, the target number is calculated through the fault block address. The volume offset value and logical volume number are obtained by indexing the reverse mapping array, the control domain and location of the fault block are determined, and the controller is driven to perform fault handling actions, thus converting it into a constant-time direct access mode.
Accelerate reverse addressing of faulty blocks, reduce resource consumption, improve fault handling efficiency, and reduce the impact on business operations.
Smart Images

Figure CN123033549A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic digital data processing technology, and in particular to fault handling methods and electronic devices for storage systems. Background Technology
[0002] In related technologies, the internal storage structure of a storage system is a forward mapping structure. It maintains the relationship between logical volumes and physical blocks through linked lists, trees, or hash tables. When a fault occurs and the address of a physical block is determined, a reverse lookup requires traversing the entire logical volume to find the corresponding address. As the capacity of the storage system increases and the number of nodes increases, the time and resources required to traverse the logical volume become high. For example, the query takes a long time and increases the proportion of CPU usage, making it difficult to quickly handle faulty blocks and thus affecting normal business operations. Improvements are urgently needed. Summary of the Invention
[0003] This application provides a fault handling method and electronic device for storage systems, which at least solves the problem in related technologies that when a storage system fails, the time required for reverse lookup based on the physical block address is long and the resource consumption is high, making it difficult to quickly carry out fault maintenance, thereby affecting normal business operations.
[0004] This application provides a fault handling method for a storage system, comprising: responding to a fault signal of the storage system, locating the address of a faulty block in a target disk according to the fault signal; determining a target number of the faulty block according to the address of the faulty block and the capacity of each block in the target disk; querying a preset reverse mapping array using the target number as an index to obtain the volume offset value and logical volume number of the faulty block in the reverse mapping array; determining the control domain to which the faulty block belongs according to the logical volume number; and determining the position of the faulty block in the logical volume according to the volume offset value, so as to drive the controller corresponding to the control domain to perform at least one fault handling action based on the position.
[0005] This application also provides a fault handling apparatus for a storage system, comprising: a positioning module, configured to locate the address of a faulty block in a target disk in response to a fault signal of the storage system; a determining module, configured to determine the target number of the faulty block based on the address of the faulty block and the capacity of each block in the target disk; and a processing module, configured to query a preset reverse mapping array using the target number as an index to obtain the volume offset value and logical volume number of the faulty block in the reverse mapping array, determine the control domain to which the faulty block belongs based on the logical volume number, and determine the position of the faulty block in the logical volume based on the volume offset value, so as to drive the controller corresponding to the control domain to perform at least one fault handling action based on the position.
[0006] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the fault handling method of any of the above-described memory systems when executing the computer program.
[0007] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of the fault handling method of any of the above-described storage systems.
[0008] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described fault handling methods for a storage system.
[0009] This application enables the following approach: Upon receiving a fault signal, the target number of the storage block can be calculated from the fault block address. Using this number as an index in the reverse mapping array, the volume offset and logical volume number are retrieved from the table. This allows the determination of the control domain to which the fault block belongs and its location within the logical volume. The corresponding controller is then driven to perform fault handling actions based on this location. By converting the reverse lookup into a constant-time direct access mode, the reverse addressing of the fault block is accelerated, reducing resource consumption. Therefore, this approach addresses the technical problem in related technologies where reverse lookups based on physical block addresses are time-consuming and resource-intensive, hindering rapid fault maintenance and impacting normal business operations. This achieves the technical effect of improving fault handling efficiency and reducing the impact on business operations. Attached Figure Description
[0010] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a flowchart of a fault handling method for a storage system according to an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a reverse mapping array according to an embodiment of this application; Figure 3 This is a flowchart of reverse addressing according to an embodiment of this application; Figure 4 This is a schematic diagram illustrating the principle of reverse addressing according to an embodiment of this application; Figure 5 This is a schematic diagram illustrating the principle of updating a reverse mapping array according to an embodiment of this application; Figure 6This is a schematic diagram of the structure of a fault handling device for a storage system provided according to an embodiment of this application. Detailed Implementation
[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0013] It should be noted that, in the description of this application, 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., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0014] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0015] Understandably, in multi-controller storage systems, logical volumes need to be able to be moved to different controllers for scheduling and migration. Background operations driven by the underlying RAID (Redundant Array of Independent Disks) often involve refactoring, verification, and repair tasks. These tasks start from the physical address and require finding the corresponding logical volume and controller as quickly as possible—a reverse lookup. In related technologies, the storage system only maintains the forward mapping, while the reverse lookup requires traversing the entire logical volume, which is extremely inefficient. Furthermore, all-flash architectures rely more heavily on global RAID write locks, which can easily cause service congestion and latency jitter.
[0016] To address the aforementioned technical problems, the fault handling method of the storage system in this application embodiment can support fast reverse addressing and lock-free updates by pre-setting a reverse mapping array, making it suitable for low-level addressing in high-concurrency scenarios.
[0017] like Figure 1 As shown, an embodiment of this application provides a fault handling method for a storage system, including the following steps: In step S101, in response to a fault signal from the storage system, the address of the faulty block in the target disk is located based on the fault signal.
[0018] Understandably, a storage system consists of multiple disks, each containing multiple logical volumes, and each logical volume containing multiple storage blocks. Physical storage blocks on a disk may experience physical failures due to hardware aging, read / write anomalies, or data migration anomalies. When the storage system detects an abnormal failure in any physical storage block, it generates a fault signal carrying the physical address information of the faulty block. This signal allows for precise location of the underlying faulty physical block, and a pre-built reverse mapping relationship enables cross-level fault location and subsequent fault handling from the physical faulty block to the upper-level logical volume.
[0019] Optionally, in one embodiment of this application, before responding to a fault signal of the storage system, the method further includes: after the storage system is powered on, dividing all disks of the storage system into blocks according to a preset capacity to obtain multiple storage blocks; assigning a number to each storage block and establishing a mapping relationship between the number and the address of the corresponding storage block; and generating a reverse mapping array using the mapping relationship.
[0020] In the reverse mapping array, each position corresponds to a storage block, which stores relevant information about the storage block so that reverse addressing can be achieved based on the address of the storage block.
[0021] like Figure 2 As shown, the embodiments of this application can complete the creation and configuration of the reverse mapping array during the storage system initialization phase, maintain a continuous physical memory layout during operation, and do not perform reallocation, move positions, or change length. The array is constructed in accordance with the principle of physical space linearization, and corresponds one-to-one with the storage block number, with each storage block uniquely corresponding to a position in the array.
[0022] For example, after the storage system is powered on, the number of storage blocks can be calculated based on the size of the disk and the size of the storage blocks. Then, contiguous physical memory can be allocated based on this size to build a reverse mapping array, providing the underlying data foundation for subsequent fast table lookups based on storage block numbers.
[0023] Optionally, in one embodiment of this application, generating a reverse mapping array using mapping relationships includes: concatenating the numbers and mapping relationships of multiple storage blocks to generate an initial reverse mapping array; marking the status bits of multiple storage blocks in the initial reverse mapping array as invalid status bits; creating multiple initial logical volumes and mounting the multiple initial logical volumes to obtain multiple logical volumes, and determining the multiple storage blocks mounted on each logical volume; determining the volume offset values of multiple storage blocks based on the position of each storage block within the corresponding logical volume; updating the initial reverse mapping array by combining the volume offset values and the volume number of the logical volume, and modifying the status bit markings of the multiple storage blocks to valid flag bits to obtain the reverse mapping array.
[0024] like Figure 2As shown, the elements in the reverse mapping array can be stored in a 32-bit storage method, which includes three fields: volume offset, logical volume number, and status bit.
[0025] In actual implementation, the embodiments of this application can determine that the array is invalid during initialization, that is, mark the status bits of multiple storage blocks in the initial reverse mapping array as invalid status bits, and then assign values to the array according to the logical volume mounting status.
[0026] During the mounting process, this embodiment of the application can include multiple selected physical storage blocks into the resource pool of the target initial logical volume, establishing a binding relationship between the logical volume and the selected physical storage blocks. After mounting is completed, the storage blocks bound to the logical volume are sequentially addressed according to the block arrangement order within the logical volume, and the starting block number of the storage block within the logical volume is the offset value within the volume.
[0027] Simultaneously, each logical volume is pre-assigned a unique logical volume number as its identifier. The obtained intra-volume offset value and logical volume number are filled into the corresponding entry of the storage block in the initial reverse mapping array, and the status bit of the entry is changed from an invalid status bit to a valid flag bit.
[0028] The 32-bit bit field encoding structure can be shown in Table 1, which is a schematic table of the reverse mapping array structure.
[0029] Table 1
[0030] In this embodiment, the overall format of the reverse mapping array is simple and easy for the central processing unit to parse quickly. The reverse mapping array structure is contiguous and compact, occupies very little memory, and can be fully loaded into the central processing unit's cache, resulting in higher access efficiency.
[0031] In step S102, the target number of the faulty block is determined based on the address of the faulty block and the capacity of each block in the target disk.
[0032] Furthermore, in this embodiment, the read scheduling module can capture fault signals reported by the storage system and parse the disk logical block address corresponding to the faulty storage block from the fault signals; the disk logical block address represents the physical location of the faulty storage block on the target disk. A target number is calculated based on the storage block's capacity, and this target number is used as an index to directly read the reverse mapping array.
[0033] In step S103, the target number is used as an index to query the preset reverse mapping array to obtain the volume offset value and logical volume number of the fault block in the reverse mapping array. The control domain to which the fault block belongs is determined according to the logical volume number, and the position of the fault block in the logical volume is determined according to the volume offset value, so as to drive the controller corresponding to the control domain to perform at least one fault handling action based on the position.
[0034] In this embodiment, after querying the reverse mapping array to obtain the volume offset value and logical volume number corresponding to the faulty block, the control domain to which the faulty block belongs can be determined by the logical volume number, and then the fault handling task can be sent to the controller corresponding to the control domain. At the same time, the volume offset value is used to determine the position of the faulty block inside the logical volume, and a fault handling task carrying the position information is generated to complete the maintenance of the faulty block.
[0035] The fault handling actions may include at least one of the following: fault block marking and isolation, fault block data reconstruction, fault block information reporting, and fault block back-end business migration.
[0036] Optionally, in one embodiment of this application, after querying the preset reverse mapping array using the target number as an index, the method further includes: determining the status bit of the fault block based on the reverse mapping array and the target number; and generating an error signal if it is determined based on the status bit that the fault block does not meet the preset access conditions.
[0037] In addition, embodiments of this application can also determine the flag bit of the fault block through a reverse mapping array. When the flag bit of the fault block does not meet the access conditions, i.e., it is in an abnormal state, an error signal is output, and no further addressing is performed.
[0038] This application embodiment can verify the access validity by reading the status bits of the faulty block, thereby preventing the addressing operation from continuing to be performed on the inaccessible storage block and causing addressing anomalies, and ensuring the stability and reliability of the addressing link.
[0039] Optionally, in one embodiment of this application, the status bit includes at least one of a normal status bit, a bad block status bit, a warm-up status bit, a migration status bit, and a locked status bit; when the status bit is a bad block status bit, it is determined that the preset access condition is not met; when the status bit is one of a warm-up status bit, a migration status bit, and a locked status bit, it is determined that the faulty block is in a temporary service state and no error signal is generated until the status bit of the faulty block switches to the normal status bit, and the controller corresponding to the control domain is driven to perform at least one fault handling action based on the location using the logical volume number and the volume offset value.
[0040] When the status bit is in one of the following states: warming up, migration, or locked, the faulty block is determined to be in a temporary service state. At this time, no error signal is generated. In this embodiment, the status bit of the faulty block can be continuously monitored until the status bit of the faulty block switches to the normal state bit. Then, using the logical volume number and the volume offset value, the controller corresponding to the control domain is driven to perform at least one fault handling action based on the position of the faulty block in the logical volume.
[0041] The embodiments of this application can avoid misjudging temporary business status as hardware failure and repeatedly triggering fault handling, thereby improving the accuracy of fault judgment and the stability of fault handling process.
[0042] Optionally, in one embodiment of this application, the method further includes: generating an update instruction for the reverse mapping array in response to any logical volume meeting a preset change condition; executing the update instruction to update the mapping data of multiple target storage blocks corresponding to any logical volume in the reverse mapping array.
[0043] When a logical volume undergoes changes such as expansion or migration (i.e., the change conditions are met), this application embodiment can begin updating the reverse mapping array. Based on the changes in the logical volume, this application embodiment can control the target storage blocks involved, selectively filter all target storage blocks belonging to the logical volume, and synchronously update the corresponding mapping relationship in the reverse mapping array to ensure that the binding relationship between the physical storage blocks stored in the array and the logical volume is consistent with the actual operating state of the system.
[0044] The embodiments of this application can avoid the lag and failure of mapping data after the logical volume configuration is changed, prevent the positioning deviation caused by the incorrect mapping information during subsequent fault location, and continuously ensure the real-time performance and accuracy of the data in the reverse mapping array.
[0045] Optionally, in one embodiment of this application, executing an update instruction to update the mapping data of multiple target storage blocks corresponding to any logical volume in the reverse mapping array includes: pausing the background tasks of multiple target storage blocks; and, according to the update instruction, performing physical space ownership changes and data migrations on the multiple target storage blocks to update the logical volume number and intra-volume offset value corresponding to the multiple target storage blocks in the reverse mapping array.
[0046] In this embodiment of the application, before updating the mapping data, the background task corresponding to the target storage block to be changed can be paused to avoid data read / write conflicts and addressing errors caused by the parallel execution of mapping updates and background tasks.
[0047] Subsequently, this embodiment of the application can, according to the update instruction requirements, complete the adjustment of the physical space ownership of the target storage block and the corresponding data migration, and synchronously modify the core mapping fields such as the logical volume number and intra-volume offset value corresponding to this type of storage block in the reverse mapping array, thereby completing the dynamic refresh of the mapping relationship. In this embodiment, only the task involving the target storage block to be changed is paused; the normal business operation of other storage blocks in the system is not affected.
[0048] This application embodiment can avoid data competition and business anomalies during the mapping update process by partially pausing the background tasks of the target storage block, effectively reducing the impact of logical volume changes on the overall storage business.
[0049] Optionally, in one embodiment of this application, after updating the mapping data of multiple target storage blocks corresponding to any logical volume in the reverse mapping array, the method further includes: identifying the progress status of physical space ownership change and data migration; and restarting the background tasks of the multiple target storage blocks that were paused in response to the progress status being completed.
[0050] This application embodiment can monitor the execution progress of storage block physical space ownership changes and data migrations throughout the entire process. Only after confirming that the migration and ownership changes are complete and the reverse mapping array data is updated and effective will the previously paused target storage block background task be restarted. This avoids read / write anomalies, mapping mismatches, and other problems caused by premature task restarts, ensuring the continuity and stability of storage services. Optionally, in one embodiment of this application, restarting paused background tasks of multiple target storage blocks includes: obtaining background tasks corresponding to each of the multiple target storage blocks; identifying the task type of the background task and matching the corresponding priority weight according to the task type; determining the restart order of the multiple background tasks based on the priority weight, so as to restart the multiple background tasks according to the restart order.
[0051] For multiple background tasks that are paused in batches, this embodiment of the application can obtain all paused background tasks, distinguish different task types such as data read / write, disk inspection, data verification, and fault monitoring, and configure corresponding priority weights for different task types. An ordered restart queue is generated based on the priority weights, and background tasks are restarted sequentially according to a predetermined order. High-priority core business tasks are restored first, while low-priority auxiliary tasks are restarted later. This ensures that core storage services are restored first, reduces the impact of logical volume changes and mapping updates on critical business performance, and significantly improves the efficiency of business recovery and operational stability after dynamic changes to the storage system.
[0052] Combination Figures 3 to 5 The working principle of the fault handling method of the storage system of this application is illustrated by an embodiment.
[0053] The embodiments of this application consist of three core parts: physical space numbering, reverse mapping array management, and lock-free state machine update and synchronization.
[0054] Physical space numbering refers to the establishment of the disk partitioning, numbering, and address mapping relationships during storage system startup. Reverse mapping array management involves maintaining a contiguous array in memory, where each location corresponds to a storage block, storing its logical volume information, block number, and ownership domain (control domain) information. Lock-free state machine update and synchronization refers to the secure update of the mapping table when logical volume configuration changes, without using global locks. It only pauses and wakes up background tasks on the target storage block, ensuring the update process does not affect normal business operations.
[0055] The storage system runs in the operating system kernel or firmware environment of the storage controller, without requiring any new hardware. It is implemented through a pure software architecture and is compatible with existing mainstream storage hardware platforms.
[0056] The physical space number part can be as follows: Figure 2 As shown, the embodiments of this application can complete the creation and configuration during the system initialization phase, maintain a continuous physical memory layout during operation, and do not perform reallocation, move positions, or change length. The array is constructed in accordance with the principle of physical space linearization, and corresponds one-to-one with the physical block number, with each storage block uniquely corresponding to a position in the array.
[0057] After the storage system boots up, it calculates the number of storage blocks based on the disk size and the storage block size, and allocates contiguous physical memory using this as the length to construct a reverse mapping array. Elements in the reverse mapping array are stored in 32-bit format, containing three fields: volume offset, logical volume number, and status bit.
[0058] The reverse mapping array management part can be as follows: Figure 3 As shown, this reflects the ownership information of a certain address being converted into a certain logical volume or controller. The entire process does not require traversal, comparison, or locking. The read scheduling module can capture the fault signals reported by the storage system, and after parsing the fault signals to obtain the disk logical block address that represents the physical location of the faulty storage block on the target disk, it calculates the storage block number based on the size of the storage block, and directly reads the reverse mapping array using this number as the index.
[0059] The controller then uses bit operations to detect the array's volume offset, logical volume number, and status bits. Based on the logical volume number, it locates the controller's home domain (control domain) and sends the task to the appropriate controller. If the status bit is recorded as abnormal, an error is output, which does not affect the address space, thus ensuring stable and efficient addressing.
[0060] like Figure 4 As shown, the query process in this embodiment is fixed and has a stable execution time, unaffected by system capacity and the number of volumes, enabling fast addressing. The query process requires no locking, and multiple cores can access it in parallel, significantly improving the processing efficiency of background tasks under high concurrency.
[0061] The lock-free state machine update and synchronization part can be like... Figure 5 As shown, when a logical volume undergoes changes such as expansion or migration, the system begins updating the mapping table. This update does not use global locks and does not block global I / O (Input / Output); it only performs fine-grained synchronization on the affected target storage blocks. The virtualization module determines the target storage block list based on the scope of the change; a pause command is sent to the read scheduling module to stop the background task distribution to the target area; after the hardware task is completed and stabilized, the system atomically updates the corresponding data in the reverse mapping array, modifying the logical volume number and its home domain (control domain) information; after the update is complete, a recovery command is sent, and subsequent I / O and tasks enter the new mapping route. The entire process only affects the target space and does not interfere with other business operations, avoiding the performance jitter caused by global locks and achieving safe and smooth lock-free updates in a multi-controller environment.
[0062] In summary, the embodiments of this application can implement globally unified block partitioning and linear continuous numbering for physical storage space, establishing a fixed correspondence between physical addresses and array indices, providing a foundation for fast reverse addressing; a reverse mapping array with storage block numbers as direct indices is constructed, using contiguous physical memory organization, to achieve fast direct addressing at the first-level computational level from physical addresses to logical volume information. Specifically, the reverse mapping array uses a 32-bit bit-field format to compactly display storage volume identifiers, cell numbers, and status information, allowing multiple pieces of information to be read in a single word, thus improving parsing speed.
[0063] This application embodiment also completes the table update through a three-step process of pausing the task, updating the mapping, and resuming the task, performing fine-grained synchronization only on the target address, replacing the global lock, and realizing non-blocking switching when the logical volume changes.
[0064] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0065] like Figure 6 As shown, embodiments of this application also provide a fault handling apparatus 10 for a storage system, comprising: Specifically, the positioning module 100 is used to locate the address of the faulty block in the target disk in response to a fault signal from the storage system.
[0066] The first determining module 200 is used to determine the target number of the faulty block based on the address of the faulty block and the capacity of each block in the target disk.
[0067] The processing module 300 is used to query a preset reverse mapping array using the target number as an index to obtain the volume offset value and logical volume number of the fault block in the reverse mapping array, determine the control domain to which the fault block belongs based on the logical volume number, and determine the position of the fault block in the logical volume based on the volume offset value, so as to drive the controller corresponding to the control domain to perform at least one fault handling action based on the position.
[0068] Optionally, in one embodiment of this application, the fault handling device 10 of the storage system further includes: The partitioning module is used to divide all disks of the storage system into blocks according to the preset capacity after the storage system is powered on, resulting in multiple storage blocks.
[0069] A module is established to assign a number to each storage block and to establish a mapping relationship between the number and the address of the corresponding storage block.
[0070] The first generation module is used to generate a reverse mapping array using the mapping relationship.
[0071] Optionally, in one embodiment of this application, the first generation module includes: The splicing unit is used to splice the numbers and mapping relationships of multiple storage blocks to generate an initial reverse mapping array.
[0072] The marking unit is used to mark the status bits of multiple storage blocks in the initial reverse mapping array as invalid status bits.
[0073] The creation unit is used to create multiple initial logical volumes, mount multiple initial logical volumes to obtain multiple logical volumes, and determine multiple storage blocks mounted on each logical volume.
[0074] The determination unit is used to determine the intra-volume offset value of multiple storage blocks based on the position of each storage block within the corresponding logical volume.
[0075] The first update unit is used to combine the intra-volume offset value and the volume number of the logical volume to update the initial reverse mapping array, and modify the status bit flags of multiple storage blocks to valid flag bits to obtain the reverse mapping array.
[0076] Optionally, in one embodiment of this application, the fault handling device 10 of the storage system further includes: The second generation module is used to generate an update instruction for the reverse mapping array in response to any logical volume meeting a preset change condition.
[0077] The update module is used to execute update instructions to update the mapping data of multiple target storage blocks corresponding to any logical volume in the reverse mapping array.
[0078] Optionally, in one embodiment of this application, the update module includes: The pause unit is used to pause background tasks for multiple target storage blocks.
[0079] The second update unit is used to perform physical space ownership changes and data migrations on multiple target storage blocks according to update instructions, so as to update the logical volume number and intra-volume offset value corresponding to multiple target storage blocks in the reverse mapping array.
[0080] Optionally, in one embodiment of this application, the fault handling device 10 of the storage system further includes: The identification module is used to identify the status of changes in physical space ownership and data migration.
[0081] The restart module is used to restart background tasks that are paused on multiple target storage blocks in response to a completed state.
[0082] Optionally, in one embodiment of this application, the restart module includes: The acquisition unit is used to acquire the background tasks corresponding to multiple target storage blocks.
[0083] The matching unit is used to identify the task type of the background task and match the corresponding priority weight according to the task type.
[0084] The restart unit is used to determine the restart order of multiple background tasks based on priority weights, so as to restart multiple background tasks according to the restart order.
[0085] Optionally, in one embodiment of this application, the fault handling device 10 of the storage system further includes: The second determining module is used to determine the status bits of the fault block based on the reverse mapping array and the target number.
[0086] The third generation module is used to generate an error signal when it is determined from the status bits that the faulty block does not meet the preset access conditions.
[0087] Optionally, in one embodiment of this application, the status bit includes at least one of a normal status bit, a bad block status bit, a warm-up status bit, a migration status bit, and a locked status bit; when the status bit is a bad block status bit, it is determined that the preset access condition is not met; when the status bit is one of a warm-up status bit, a migration status bit, and a locked status bit, it is determined that the faulty block is in a temporary service state and no error signal is generated until the status bit of the faulty block switches to the normal status bit, and the controller corresponding to the control domain is driven to perform at least one fault handling action based on the location using the logical volume number and the volume offset value.
[0088] For a description of the features in the embodiment corresponding to the fault handling device of the storage system, please refer to the relevant description of the embodiment corresponding to the fault handling method of the storage system, which will not be repeated here.
[0089] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above-described embodiments of the fault handling method for a storage system.
[0090] Embodiments of this application also provide a 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 fault handling method for storage systems when it is run.
[0091] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0092] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the fault handling method for a storage system.
[0093] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described embodiments of the fault handling method for the storage system.
[0094] 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 implementation should not be considered beyond the scope of this application.
[0095] The foregoing has provided a detailed description of a fault handling method and electronic device for a storage system provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A fault handling method for a storage system, characterized in that, Includes the following steps: In response to a fault signal from the storage system, the address of the faulty block in the target disk is located based on the fault signal; The target number of the faulty block is determined based on the address of the faulty block and the capacity of each block in the target disk; Using the target number as an index, a preset reverse mapping array is queried to obtain the volume offset value and logical volume number of the fault block in the reverse mapping array. The control domain to which the fault block belongs is determined according to the logical volume number, and the position of the fault block in the logical volume is determined according to the volume offset value, so as to drive the controller corresponding to the control domain to perform at least one fault handling action based on the position.
2. The method according to claim 1, characterized in that, Before responding to a fault signal from the storage system, it also includes: After the storage system is powered on, all disks of the storage system are divided into blocks according to a preset capacity to obtain multiple storage blocks; Assign a number to each of the storage blocks and establish a mapping relationship between the number and the address of the corresponding storage block; The reverse mapping array is generated using the mapping relationship.
3. The method according to claim 2, characterized in that, The step of generating the reverse mapping array using the mapping relationship includes: The numbers and mapping relationships of multiple storage blocks are concatenated to generate an initial reverse mapping array; Mark the status bits of multiple storage blocks in the initial reverse mapping array as invalid status bits; Multiple initial logical volumes are created, and the multiple initial logical volumes are mounted to obtain multiple logical volumes, and multiple storage blocks are determined for each logical volume. Based on the location of each storage block within the corresponding logical volume, determine the volume offset value of multiple storage blocks; By combining the intra-volume offset value and the volume number of the logical volume, the initial reverse mapping array is updated, and the status bits of multiple storage blocks are modified to valid flag bits to obtain the reverse mapping array.
4. The method according to claim 3, characterized in that, Also includes: In response to any logical volume satisfying a preset change condition, an update instruction for the reverse mapping array is generated; The update instruction is executed to update the mapping data of multiple target storage blocks corresponding to any of the logical volumes in the reverse mapping array.
5. The method according to claim 4, characterized in that, The execution of the update instruction, updating the mapping data of multiple target storage blocks corresponding to any of the logical volumes in the reverse mapping array, includes: Pause background tasks on multiple of the target storage blocks; According to the update instruction, the physical space ownership change and data migration are performed on multiple target storage blocks to update the logical volume number and intra-volume offset value corresponding to multiple target storage blocks in the reverse mapping array.
6. The method according to claim 5, characterized in that, After updating the mapping data of the plurality of target storage blocks corresponding to any of the aforementioned logical volumes within the reverse mapping array, the method further includes: Identify the progress of the physical space ownership change and data migration; In response to the progress status being completed, the background tasks that were paused in the multiple target storage blocks are restarted.
7. The method according to claim 6, characterized in that, The restarting of the background tasks that were paused for the multiple target storage blocks includes: Obtain the background tasks corresponding to each of the target storage blocks; Identify the task type of the background task and match the corresponding priority weight according to the task type; The restart order of the multiple background tasks is determined based on the priority weight, so as to restart the multiple background tasks according to the restart order.
8. The method according to claim 1, characterized in that, After querying the preset reverse mapping array using the target number as an index, the process further includes: Based on the reverse mapping array and the target number, the status bits of the fault block are determined; If, based on the status bit, it is determined that the faulty block does not meet the preset access conditions, an error signal is generated.
9. The method according to claim 8, characterized in that, The status bits include at least one of the following: normal status bit, bad block status bit, warm-up status bit, migration status bit, and locked status bit; If the status bit is the bad block status bit, it is determined that the preset access condition is not met. If the status bit is one of the warm-up status bit, the migration status bit, and the locked status bit, it is determined that the faulty block is in a temporary service state and no error signal is generated until the status bit of the faulty block switches to the normal status bit. Then, the controller corresponding to the control domain is driven to perform at least one fault handling action based on the location using the logical volume number and the volume offset value.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the fault handling method for the storage system as described in any one of claims 1 to 9 when executing the computer program.
