Storage controller and storage array
By setting up a cache storage disk and a battery backup unit in the storage controller, the problem of cache data loss in the storage array during abnormal power failure is solved, data persistence and reliability are achieved, and the reliability of the storage controller is improved.
Patent Information
- Application Number
- PCT/CN2025/085215
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-29
- Filing Date
- 2025-03-27
- Publication Date
- 2025-10-02
AI Technical Summary
When a storage array experiences an unexpected power outage or system failure, data in the cache is easily lost, causing abnormalities in the data stored on the data hard disks and affecting the reliability of the storage array.
A first cache storage disk, a second cache storage disk and a battery backup unit are set in the storage controller. The battery backup unit is used to power the central processing unit, cache, system hard disk and cache storage disk in the event of an abnormal power outage. The central processing unit writes the data in the cache to the cache storage disk to achieve data persistence.
In the event of an abnormal power outage, the persistence and integrity of cached data are ensured to avoid data loss, improve the reliability of the storage controller, simplify the processing flow and improve processing efficiency.
Smart Images

Figure CN2025085215_02102025_PF_FP_ABST
Abstract
Description
Storage controller and storage array
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to a Chinese patent application filed with the Patent Office of China on March 29, 2024, with application number 202410372953.4 and application name “Storage Controller and Storage Array,” the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present application relates to the technical field of storage devices, and in particular to a storage controller and a storage array. Background Art
[0004] Storage arrays typically interact with hosts and internal data disks through storage controllers. Storage controllers include a cache to store popular data and frequently used operations, thereby reducing disk access times.
[0005] However, in the event of an unexpected power outage or system failure, the data in the cache will be lost, causing anomalies in the data stored in the data hard disks of the storage array, such as data loss, and affecting the reliability of the storage array. Summary of the Invention
[0006] In view of this, the present application provides a storage controller and a storage array to solve the problem of poor reliability of the storage array.
[0007] In a first aspect, the present application provides a storage controller comprising: a central processing unit, a cache, a system hard disk, a first cache storage disk, a second cache storage disk, and a battery backup unit;
[0008] The CPU is connected to the cache and is used to read and write data in the cache;
[0009] The system hard disk is connected to the central processing unit and is used to provide the central processing unit with the operating system required for work;
[0010] The first cache storage disk and the second cache storage disk are both connected to the central processing unit; the central processing unit is further configured to: write the data in the cache to the first cache storage disk and the second cache storage disk in the event of an abnormal power failure of the storage controller;
[0011] The battery backup unit is used to supply power to the central processing unit, cache, system hard disk, first cache storage disk and second cache storage disk in case of abnormal power failure of the storage controller.
[0012] In some embodiments, the storage controller further includes: a first IO controller and a second IO controller;
[0013] The first IO controller is used to connect to the front-end host;
[0014] The second IO controller is used to connect to the back-end data hard disk.
[0015] In some embodiments, the central processing unit is specifically configured to:
[0016] Acquire a write request sent by the host based on the first IO controller, and store corresponding data to be written into the cache;
[0017] Based on the second IO controller, the data in the cache is persisted to the back-end data hard disk.
[0018] In some embodiments, persisting the data in the cache to the back-end data hard disk includes:
[0019] Periodically persist the data in the cache to the backend data hard disk;
[0020] When the remaining space in the cache is insufficient, at least part of the data first stored in the cache is actively persisted to the back-end data hard disk.
[0021] In some embodiments, the central processing unit is specifically configured to:
[0022] In the event of abnormal power failure of the storage controller, the data in the cache is synchronously written to the first cache storage disk and the second cache storage disk in a parallel manner.
[0023] In some embodiments, the storage controller further comprises: a RAID card; the central processing unit is connected to the first cache storage disk and the second cache storage disk via the RAID card;
[0024] The RAID card is used to synchronously write the data transmitted by the central processing unit to the first cache storage disk and the second cache storage disk.
[0025] In some implementations, the RAID card is specifically configured to:
[0026] dividing data transmitted by the central processing unit into at least one data packet;
[0027] For any data packet, the data packet is stored in the first cache storage disk, and the data packet is copied to the second cache storage disk.
[0028] In some embodiments, the storage controller further comprises: a switch device; the switch device is connected to the root complex of the central processing unit and is connected to the first cache storage disk and the second cache storage disk;
[0029] The switching device is used for synchronously writing the data transmitted by the central processing unit into the first cache storage disk and the second cache storage disk.
[0030] In some embodiments, the switching device is specifically configured to:
[0031] The first interface connected to the first cache storage disk and the second interface connected to the second cache storage disk are both used as valid interfaces;
[0032] In the event of abnormal power failure of the storage controller, the data transmitted by the central processor is broadcast to all valid interfaces.
[0033] In some embodiments, the central processing unit is further configured to:
[0034] When the storage controller is powered on, it is determined whether the last shutdown of the storage controller was an abnormal power failure;
[0035] In the case that the storage controller is shut down last time due to abnormal power failure, recovery data is obtained from at least one of the first cache storage disk and the second cache storage disk, and the recovery data is restored to the cache.
[0036] In some embodiments, obtaining the recovery data from at least one of the first cache storage disk and the second cache storage disk includes:
[0037] When both the first cache disk and the second cache disk are normal, different parts of data are read from the first cache disk and the second cache disk in parallel, and the data read from the first cache disk and the second cache disk are combined into recovery data.
[0038] In some implementations, the system hard disk is further used for performing any one of operating system booting, fault recovery and updating, storage configuration, and management.
[0039] In some embodiments, the central processing unit is configured to temporarily store data at high speed based on the cache during data interaction between the host and the data hard disk.
[0040] In some embodiments, the first cache storage disk and the second cache storage disk store the data in the cache in a data mirroring manner.
[0041] In some embodiments, the storage controller is configured to determine whether the last shutdown was an abnormal power off based on the acquired system log and / or abnormal power off flag.
[0042] In a second aspect, the present application provides a storage array, comprising: the storage controller and data hard disk according to the first aspect or any corresponding embodiment thereof;
[0043] The storage controller is connected to the data hard disk and is used to perform read and write operations on the data hard disk.
[0044] In some implementations, there are multiple storage controllers, and the multiple storage controllers are interconnected.
[0045] In some embodiments, the first storage controller is configured to write data from the host to a local first cache and generate first verification data for the data stored in the first cache; and copy the data stored in the first cache and the first verification data to the second storage controller; the first storage controller and the second storage controller are two storage controllers in a storage array;
[0046] The second storage controller is used to store the data stored in the first cache to a local second cache, and generate second verification data for the data stored in the second cache; when the second verification data is consistent with the first verification data, feedback a message to the first storage controller.
[0047] In some embodiments, multiple storage controllers are each configured to connect to multiple network adapters of a host.
[0048] In a third aspect, the present application provides a server, which includes the storage array described above.
[0049] The present application provides a storage controller, which is provided with a first cache storage disk, a second cache storage disk and a battery backup unit. In the event of an abnormal power outage, the battery backup unit can provide backup power, and the central processing unit writes the data in the cache to the first cache storage disk and the second cache storage disk to achieve persistence of the data in the cache, facilitating subsequent data recovery. The storage controller uses an internally controlled cache storage disk to protect the data in the cache without connecting or interacting with an external data hard disk, which is simple to implement and has high processing efficiency. The cache storage disk only works in the event of an abnormal power outage and is not affected by other IO of the central processing unit. The data between the first cache storage disk and the second cache storage disk is mirrored, and when one system fails, the other can also provide recovery data, which can ensure the reliability of the storage controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the specific implementation methods of this application or the technical solutions in related technologies, the following is a brief introduction to the drawings required for use in the specific implementation methods or related technical descriptions. Obviously, the drawings described below are some implementation methods of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0051] FIG1 is a schematic diagram of an interaction between a host and a storage array according to an embodiment of the present application;
[0052] FIG2 is a schematic structural diagram of a storage controller according to an embodiment of the present application;
[0053] FIG3 is a schematic diagram of a process for implementing cache persistence by a storage controller according to an embodiment of the present application;
[0054] FIG4 is another schematic diagram of the structure of a storage controller according to an embodiment of the present application;
[0055] FIG5 is a schematic diagram showing an implementation principle of a storage controller writing data in parallel according to an embodiment of the present application;
[0056] FIG6 is a schematic diagram showing another implementation principle of a storage controller writing data in parallel according to an embodiment of the present application;
[0057] FIG7 is a schematic structural diagram of a storage array according to an embodiment of the present application. DETAILED DESCRIPTION
[0058] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0059] In the description of this application, it should be noted that the terms "first," "second," and "third" are used for descriptive purposes only and should not be understood to indicate or imply relative importance. Unless otherwise expressly specified or limited, the terms "installed," "connected," and "connected" should be understood broadly. For example, they can refer to fixed connections, removable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to internal connections between two components. Those skilled in the art will understand the specific meanings of the above terms in this application based on the specific circumstances.
[0060] In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0061] Figure 1 illustrates the interaction between a storage array and a host. As shown in Figure 1, the storage array includes a storage controller and a hard disk located at the back end. The hard disk is primarily used to store data and is therefore referred to as a data hard disk. The storage array communicates with the host through the host's network adapter, which can be a host bus adapter (HBA) or network interface controller (NIC). Figure 1 illustrates the storage array connected to the host's HBA as an example.
[0062] As shown in Figure 1, after the storage controller of the storage array receives a write request sent by the host, the CPU (central processing unit) of the storage controller can write the corresponding data into the cache to improve data access speed and system performance; then, the CPU can write the data temporarily stored in the cache to the back-end data disk, thereby storing the data on the host side to the back-end data hard disk.
[0063] However, if the storage controller unexpectedly loses power or experiences a system failure, the data in its cache will be lost, potentially causing data loss and other abnormalities in the data hard disks of the storage array. For example, when writing a data packet requested by the host to the data hard disk, if ten data packets (packets 0 to 9) are cached in the cache first, and the storage controller subsequently successfully writes packets 0 to 5 to the data hard disk, but then experiences an abnormal power outage, the data stored in the cache (packets 6 to 9) will be lost due to the power outage, meaning that packets 6 to 9 are not written to the data hard disk.
[0064] When data is written to the cache, the storage array typically immediately confirms the write operation is successful, even if the data has not yet been written to the persistent data disk. Therefore, in the above situation, packets 6 to 9 are lost on the storage array side.
[0065] The storage controller provided in this embodiment, by providing two cache storage disks and using a battery backup unit for power supply, can save the data in the cache in the event of an abnormal power outage, thereby achieving cache persistence, thereby ensuring that after the write operation is successful, data loss and other problems are effectively avoided, so that data can be truly and securely written to a persistent data hard disk to ensure data consistency and reliability.
[0066] In this embodiment, a storage controller is provided, which is a controller for a storage array and can be applied in the scenario shown in Figure 1 to implement interaction between a host and a data hard disk. Specifically, Figure 2 shows a schematic diagram of a specific application scenario of the storage controller. As shown in Figure 2, the storage controller 200 is disposed between the host 100 and the data hard disk 300. It will be understood that the storage controller 200 and the data hard disk 300 can form a storage array, such as a RAID (Redundant Arrays of Independent Disks) array.
[0067] As shown in FIG. 2 , the storage controller 200 includes a central processing unit 201 , a cache 202 , a system hard disk 203 , a first cache storage disk 204 , a second cache storage disk 205 , and a battery backup unit 206 .
[0068] The central processing unit 201 is a main control component, which may specifically be a CPU, and is used to process control and business logic, such as controlling and implementing data storage.
[0069] Cache 202 is used for high-speed temporary data storage, such as frequently accessed data or data sent by the host. Cache 202 is connected to the CPU 201. Under the control of the CPU 201, data can be written to cache 202 and read from cache 202 by the CPU 201 as needed, thereby improving performance. Cache 202 is a high-speed random access device placed before the low-speed data hard disk 300. Typically, memory, such as DRAM (Dynamic Random Access Memory), can be used as cache 202.
[0070] The cache 202 has the following functions in the storage array:
[0071] (1) Improved read performance: The storage array stores the most frequently used data blocks in the cache 202. When an application requests this data, it can be directly obtained from the cache 202, thus avoiding frequent disk (e.g., data hard disk 300, etc.) read operations, thereby improving read performance.
[0072] (2) Improved write performance: Cache 202 can temporarily store data to be written, and then merge it into larger blocks before writing it to the disk (e.g., data hard disk 300). This approach can reduce the number of write operations, improve write performance, and reduce the load on the disk.
[0073] (3) Smoothing access peaks: Under high load conditions, the cache 202 of the storage array can temporarily store requests from multiple hosts 100, thereby smoothing access peaks and avoiding degradation of system performance.
[0074] (4) Reducing disk access: The cache 202 can reduce access to the physical disk (eg, the data hard disk 300), thereby extending the life of the disk and reducing energy consumption and failure rate.
[0075] The system hard disk 203 is connected to the central processing unit 201 and is used to provide the operating system required for the central processing unit 201. The system hard disk 203 can also be used for any one of operating system booting, fault recovery and updating, storage configuration and management.
[0076] Specifically, the system hard disk 203 is used to store the operating system and related controller software; these software are responsible for managing and controlling various functions and operations of the storage array. The functions of the system hard disk 203 also include operating system booting, fault recovery and updating, storage configuration and management, etc.
[0077] It is understandable that after the storage controller 200 is powered on, the operating system in the system hard disk 203 is started, so that the central processor 201 can read the cache 202 as needed to achieve data interaction between the host 100 and the backend data hard disk 300.
[0078] As described above, during data exchange between the host 100 and the backend data hard disk 300, the central processing unit 201 temporarily stores data at high speed in the cache 202 to improve data read efficiency. However, if the storage controller 200 experiences an abnormal power outage (e.g., a sudden power outage, system failure, etc.), the data in the cache 202 will be lost. To protect the data in the cache 202 from loss during an abnormal power outage, the cache 202 in the storage array must incorporate a persistence mechanism. This persistence mechanism serves two main purposes.
[0079] 1. Data persistence: The cache 202 of a storage array is typically used to accelerate read and write operations. However, because cache 202 is volatile, data in cache 202 may be lost if a power outage occurs before the data is written to a disk (e.g., data hard disk 300). The persistence mechanism of cache 202 ensures data persistence by writing the data in cache 202 to a persistent storage medium (e.g., a disk or flash memory) in the event of a power outage.
[0080] 2. Data Integrity: The cache persistence mechanism can also be used to maintain data integrity. When data is written to cache 202, the storage array typically immediately confirms the success of the write operation, even if the data has not yet been written to the persistent storage (e.g., data hard disk 300). The cache persistence mechanism ensures that after the write operation is confirmed successful, the data is actually and securely written to the persistent storage medium, thereby ensuring data consistency and reliability.
[0081] Currently, a common way to implement a persistence mechanism is to provide a separate power supply for the cache (set up an additional separate power supply) to ensure that even in the event of an abnormal power outage, the data in the cache 202 can be persisted for a period of time. However, this persistence mechanism can only be maintained for a period of time, and after the separate power supply is lost, the data in the cache 202 will still be lost.
[0082] Furthermore, when the storage controller 200 experiences an abnormal power outage, the data in the cache 202 can be persisted to the data hard disk 300, enabling a data flush from the cache 202. However, to ensure the reliability of the cache 202 in the event of a storage array power failure, a separate power supply is also required to power the storage controller 200 to complete the data flush from the cache 202. Furthermore, since the separate power supply must also power the data hard disk 300 when the data in the cache 202 needs to be saved, this mode significantly shortens the duration that the separate power supply can provide power.
[0083] Alternatively, the persistence location of the cache 202 can also be set on the system disk of the storage controller 200, that is, the controller software and operating system hard disk, for example, the system hard disk 203 of the storage controller 200; the advantage of doing so is that the protection of the data in the cache 202 can be better managed and maintained, while reducing the complexity of external connections. However, this solution has the following disadvantages: the main purpose of the system disk (for example, the system hard disk 203) is to store the operating system and storage array system software, as well as configuration management information, so the system disk does not have high requirements for IO (input and output) performance, and the persistence of the cache 202 is limited by the power of a separate power supply. The faster the system disk writes and the shorter the persistence time of the cache 202, the better. In addition, there are a large number of IO requests during the operation of the system disk itself, which will also affect the persistence process of the cache 202.
[0084] In this embodiment, as shown in FIG. 2 , the storage controller 200 further includes a first cache storage disk 204 , a second cache storage disk 205 and a battery backup unit 206 , and uses multiple cache storage disks to implement persistence of the cache 202 .
[0085] Specifically, as shown in Figure 2, the first cache storage disk 204 and the second cache storage disk 205 are both connected to the central processing unit 201; the central processing unit 201 is also used to: in the event of an abnormal power outage of the storage controller 200, write the data in the cache 202 to the first cache storage disk 204 and the second cache storage disk 205.
[0086] The battery backup unit 206 is used to supply power to the CPU 201, the cache 202, the system hard disk 203, the first cache storage disk 204 and the second cache storage disk 205 in the event of abnormal power failure of the storage controller.
[0087] In this embodiment, a cache disk is added to the controller chassis, that is, a cache disk is added to the storage controller 200. To prevent failure of the cache disk itself, two cache disks are used: a first cache disk 204 and a second cache disk 205. Both the first cache disk 204 and the second cache disk 205 are hard disks capable of persistently storing data. Furthermore, in one example, the first cache disk 204 and the second cache disk 205 store data in the cache 202 in a manner similar to data mirroring, thereby achieving data persistence in the cache 202.
[0088] In addition, the storage controller 200 is also provided with a battery backup unit (BBU) 206, which is mainly used as a backup power supply for the storage controller 200 to provide temporary power supply for components required to achieve cache persistence in the event of a sudden power outage or power failure, so as to prevent data loss or damage and ensure data integrity and reliability.
[0089] Specifically, when the storage controller 200 is operating, the CPU 201, cache 202, and system hard disk 203 operate normally, without requiring power from the battery backup unit 206, and without requiring data to be stored in the first cache storage disk 204 or the second cache storage disk 205. Furthermore, if the storage controller 200 is powered off normally, it will be fully powered off after processing the data in the cache 202, eliminating the risk of data loss.
[0090] In the event of an abnormal power outage to the storage controller 200, the battery backup unit 206 begins operating and provides power to the CPU 201, cache 202, and system hard disk 203, ensuring that the CPU 201 can process data in the cache 202 under the control of the operating system on the system hard disk 203. Furthermore, the battery backup unit 206 provides power to the first cache storage disk 204 and the second cache storage disk 205, enabling data to be written to them.
[0091] If the storage controller 200 experiences an abnormal power outage, the battery backup unit 206 allows the CPU 201 to read data from the cache 202. Since the storage array is powered down, the storage controller 200 cannot write data to the data hard disk 300. However, since the battery backup unit 206 is currently supplying power to the first and second cache storage disks 204, 205, the CPU 201 can write data from the cache 202 to the first and second cache storage disks 204, 205, thus ensuring data persistence in the cache 202. Generally, the first and second cache storage disks 204, 205 store data in the cache 202 in a manner similar to data mirroring to prevent data loss in the cache 202 due to an abnormal power outage. When the storage controller 200 subsequently powers back on, data recovery can be performed based on the data stored on the first and second cache storage disks 204, 205.
[0092] In some implementations, the process of the central processor 201 implementing data recovery includes the following steps A1 to A2.
[0093] Step A1: When the storage controller 200 is powered on and started, it is determined whether the last shutdown of the storage controller 200 was an abnormal power failure.
[0094] Step A2 : when the storage controller is last shut down due to abnormal power failure, obtain recovery data from at least one of the first cache storage disk 204 and the second cache storage disk 205 , and restore the recovery data to the cache 202 .
[0095] In this embodiment, each time the storage controller 200 is powered on and started, it can be determined whether the last shutdown of the storage controller 200 was an abnormal power failure.
[0096] In actual applications, the storage controller 200 can be used to determine whether the last shutdown was an abnormal power outage based on the obtained system log and / or abnormal power-off flag, and relevant information that can be used to indicate the power-off or non-power-off status of the storage controller can be pre-set in the system log and / or abnormal power-off flag.
[0097] For example, the storage controller 200 can determine whether the last shutdown was an abnormal power outage based on the system log (or by setting an abnormal power outage flag, etc.). If the last shutdown was a normal power outage, no data recovery is required, and a normal startup is sufficient. Conversely, if the last shutdown was a normal power outage, the storage controller 200 needs to perform data recovery.
[0098] Specifically, CPU 201 obtains recovery data from at least one of first cache storage disk 204 and second cache storage disk 205. For example, if first cache storage disk 204 is currently faulty but second cache storage disk 205 is not faulty, recovery data is obtained from second cache storage disk 205. It can be understood that this recovery data is the complete data stored on first and second cache storage disks 204, 205, as well as the data temporarily stored in cache 202 during the last abnormal power outage. After CPU 201 reads this recovery data, it writes it to cache 202. In other words, it uses the backup data on the cache storage disks (first cache storage disk 204 and / or second cache storage disk 205) to restore the data in cache 202 and rebuild cache 202. Once cache 202 is rebuilt, storage controller 200 is restored to the state before the last unexpected power outage. At this point, the storage array enters a service state and can provide external services.
[0099] FIG3 shows a schematic diagram of a process of implementing cache persistence by the storage controller 200 . As shown in FIG3 , the process specifically includes the following steps S301 to S306 .
[0100] Step S301 : When the storage controller 200 is abnormally powered off, the central processing unit 201 reads data in the cache 202 .
[0101] In step S302, the CPU 201 writes the data in the cache 202 into the cache storage disk. The cache storage disk specifically includes a first cache storage disk 204 and a second cache storage disk 205. That is, the data in the cache 202 needs to be written into the two cache storage disks in a mirrored manner.
[0102] Step S303: After the cache disk is stored, a message is fed back to the central processing unit 201.
[0103] After the CPU 201 determines that the cache storage disk is fully stored, it can notify the battery backup unit 206 to power off, and no longer needs to supply power to the CPU 201, cache 202, system hard disk 203, first cache storage disk 204 and second cache storage disk 205.
[0104] Step S304 , when powered on, the central processing unit 201 determines whether the last shutdown of the storage controller 200 was an abnormal power failure.
[0105] Step S305 : If the last shutdown was a normal power off, the CPU 201 needs to read the recovery data from at least one of the first cache storage disk 204 and the second cache storage disk 205 .
[0106] In step S306 , the CPU 201 writes the restored data into the cache 202 .
[0107] This embodiment provides a storage controller, which is provided with a first cache storage disk 204, a second cache storage disk 205, and a battery backup unit 206. In the event of an abnormal power outage, the battery backup unit 206 can provide backup power, and the central processing unit 201 writes the data in the cache 202 to the first cache storage disk 204 and the second cache storage disk 205, thereby achieving persistence of the data in the cache 202 and facilitating subsequent data recovery. The storage controller uses an internally controlled cache storage disk to protect the data in the cache 202 without connecting or interacting with the external data hard disk 300, which is simple to implement and has high processing efficiency. The cache storage disk only works in the event of an abnormal power outage and is not affected by other IO operations of the central processing unit 201. The data is mirrored between the first cache storage disk 204 and the second cache storage disk 205. When one system fails, the other can also provide recovery data, which can ensure the reliability of the storage controller.
[0108] In some embodiments, as shown in FIG4 , the storage controller 200 further includes a first IO controller 207 and a second IO controller 208. The first IO controller 207 is used to connect to the front-end host 100, and the second IO controller 208 is used to connect to the back-end data hard disk 300.
[0109] In this embodiment, the first IO controller 207 is a front-end controller, which can communicate with the front-end host 100, for example, receiving a data write request issued by the host 100, or sending the data required by the host 100 (data read by the storage controller 200 from the data hard disk 300) to the host 100.
[0110] The second IO controller 208 is a backend controller, which is used to communicate with the data hard disk 300 in the hard disk frame to read and write the data hard disk 300, for example, write the data sent by the host 100 to the data hard disk 300.
[0111] Specifically, the central processor 201 is specifically used to: obtain the write request sent by the host 100 based on the first IO controller 207, and store the corresponding data to be written to the cache 202; based on the second IO controller 208, persist the data in the cache 202 to the back-end data hard disk 300.
[0112] In this embodiment, when the host 100 sends a write request to the storage array, the storage controller 200, based on the first IO controller 207, can obtain the write request. The write request includes the data to be written to the data hard disk 300, i.e., the data to be written. At this time, the central processing unit 201 first stores the data to be written in the cache 202, which can quickly respond to the host 100 request and improve performance. Afterwards, the central processing unit 201, based on the second IO controller 208, can persist the data in the cache 202 to the back-end data hard disk 300, thereby implementing data writing.
[0113] It can be understood that when the storage controller 200 unexpectedly loses power, the storage array uses the battery backup unit 206 to only supply power to the key components of the storage controller 200. The key components here must be able to ensure that the flushing action of the cache 202 is completed. The components that need to be powered include: the central processing unit 201, the cache 202, the system hard disk 203, the first cache storage disk 204, and the second cache storage disk 205. At this time, there is no need to supply power to the first IO controller 207 and the second IO controller 208, that is, the battery backup unit 206 does not need to supply power to the first IO controller 207 and the second IO controller 208.
[0114] In some embodiments, the above process of "persisting the data in the cache 202 to the back-end data hard disk 300" specifically includes: periodically persisting the data in the cache 202 to the back-end data hard disk 300; when there is insufficient remaining space in the cache 202, actively persisting at least part of the data first stored in the cache 202 to the back-end data hard disk 300.
[0115] In this embodiment, the data in the cache 202 can be periodically persisted to the data hard disk 300 at the back end of the storage array. For example, the storage array periodically (for example, every 5 seconds) persists the data in the cache 202 to the data hard disk 300 at the back end of the storage array.
[0116] Furthermore, when the cache 202 is insufficient, that is, when the remaining space in the cache 202 is insufficient, part of the content in the cache 202 can be proactively eliminated, that is, the cache 202 can also be proactively persisted to the storage array backend data hard disk 300. Specifically, at least part of the data first stored in the cache 202 can be eliminated, that is, the oldest data can be eliminated. After the old data is eliminated, the phenomenon of insufficient cache 202 can be alleviated.
[0117] In some embodiments, the CPU 201 may write data to the first cache storage disk 204 and the second cache storage disk 205 in a serial manner. For example, the CPU 201 first stores the data in the cache 202 in the first cache storage disk 204, and then writes the data in the cache 202 to the second cache storage disk 205. This serial writing method is inefficient, and the battery backup unit 206 has a limited power supply life, which can easily lead to data inconsistencies between the first cache storage disk 204 and the second cache storage disk 205.
[0118] In this embodiment, the central processing unit 201 is specifically configured to, in the event of an abnormal power outage in the storage controller, synchronously write data in the cache 202 to the first cache storage disk 204 and the second cache storage disk 205 in parallel. This parallel writing method allows the time required to write data from the cache 202 to both cache storage disks to be substantially consistent with the time required to write data to a single cache storage disk, thereby improving write efficiency and reducing the power supply duration of the battery backup unit 206.
[0119] In some embodiments, to enable parallel data writing, a RAID card can be added to the storage controller. As shown in Figure 5, the storage controller also includes a RAID card 209. The central processing unit 201 is connected to the first cache disk 204 and the second cache disk 205 via the RAID card 209. The RAID card 209 is used to synchronously write data transmitted by the central processing unit 201 to the first cache disk 204 and the second cache disk 205.
[0120] In this embodiment, the first cache storage disk 204 and the second cache storage disk 205 are used as disks in the disk array, and the RAID card 209 is used to manage the two, so that data can be written to the first cache storage disk 204 and the second cache storage disk 205 synchronously, that is, the data in the cache 202 can be written synchronously in the event of an abnormal power outage.
[0121] The process of implementing synchronous writing by the RAID card 209 specifically includes the following steps B1 to B2.
[0122] Step B1: Divide the data transmitted by the central processing unit 201 into at least one data packet.
[0123] Step B2: for any data packet, store the data packet in the first cache storage disk 204 and copy the data packet to the second cache storage disk 205 .
[0124] In this embodiment, upon an abnormal power outage, the CPU 201 reads the data in the cache 202 and transmits it to the RAID card 209. The RAID card 209 then divides the data into at least one data packet, typically multiple data packets. For each data packet, the RAID card 209 writes it to the first cache storage disk 204. Furthermore, the RAID card 209 copies the data packet and writes the copied data to the second cache storage disk 205, thereby achieving data mirroring between the first cache storage disk 204 and the second cache storage disk 205.
[0125] When performing data recovery, CPU 201 can read data from only one of the cache storage disks; alternatively, CPU 201 can read data from both first and second cache storage disks 204 and 205 in parallel to increase read speed. Specifically, step A2, "obtaining recovered data from at least one of first and second cache storage disks 204 and 205," can include the following step A21.
[0126] In step A21, when both the first cache storage disk 204 and the second cache storage disk 205 are normal, different parts of data are read from the first cache storage disk 204 and the second cache storage disk 205 in parallel, and the data read from the first cache storage disk 204 and the second cache storage disk 205 are combined into recovery data.
[0127] In this embodiment, when performing data recovery, the CPU 201 can read a portion of data from the first cache storage disk 204 and at the same time read another portion of data from the second cache storage disk 205, and then combine the two portions of data to obtain the required recovery data.
[0128] For example, in step B1 above, the RAID card 209 divides the data transmitted by the CPU 201 (also the data in the cache 202) into four data packets: packet A, packet B, packet C, and packet D. After storage, these four data packets are stored on both the first cache disk 204 and the second cache disk 205. After the storage controller 200 is powered on, the CPU 201 can read a portion of the data, such as packets A and C, from the first cache disk 204, and simultaneously read another portion of the data, such as packets B and D, from the second cache disk 205. By combining these two portions of data, a complete recovery data can be obtained, which includes the four data packets mentioned above.
[0129] In this embodiment, by providing a hardware RAID card 209 for the storage controller 200, data can be conveniently and synchronously stored on the first cache storage disk 204 and the second cache storage disk 205, thereby enabling parallel writing of data to the cache 202. Although this solution can meet the requirements, it requires the addition of an additional RAID card 209, which is relatively costly.
[0130] Alternatively, in some embodiments, since the storage controller 200 itself includes a switch, such as a PCIe switch, which is an essential component in the storage controller 200, this embodiment uses the switch to achieve parallel writing without the need to introduce additional hardware (such as a RAID card 209).
[0131] FIG6 illustrates another schematic diagram of a storage controller 200 implementing parallel data writes. As shown in FIG6 , the storage controller 200 further includes a switch 210 . The switch 210 is connected to the root complex 2011 of the CPU 201 and to the first cache disk 204 and the second cache disk 205 . The switch 210 is configured to synchronously write data transmitted by the CPU 201 to the first cache disk 204 and the second cache disk 205 .
[0132] In this embodiment, the central processor 201 of the storage controller 200 is provided with an interface with the PCle topology, namely, a root complex (RC) 2011. The root complex 2011 is generally integrated inside the central processor 201. FIG6 shows a logical architecture diagram.
[0133] In addition, the storage controller 200 is also provided with a switching device 210, which is generally implemented in the form of a PCIe switching chip. By connecting the first cache storage disk 204 and the second cache storage disk 205 to the corresponding interfaces of the switching device 210, data transmission between the central processing unit 201 and the first cache storage disk 204 and the second cache storage disk 205 can be realized; and, by configuring the switching device 210, the purpose of writing data in the cache 202 to the first cache storage disk 204 and the second cache storage disk 205 at the same time can be achieved, thereby realizing parallel writing.
[0134] In some implementations, the process of implementing parallel data writing by the switching device 210 specifically includes the following steps C1 to C2.
[0135] In step C1 , the first interface connected to the first cache storage disk 204 and the second interface connected to the second cache storage disk 205 are both used as valid interfaces.
[0136] Step C2: when the storage controller is abnormally powered off, broadcast the data transmitted by the central processing unit 201 to all valid interfaces.
[0137] In this embodiment, the switching device 210 is capable of writing data to the first cache storage disk 204 and the second cache storage disk 205 in parallel. The first cache storage disk 204 and the second cache storage disk 205 are regarded as a valid group, and then the members in the valid group can be broadcast to achieve parallel data writing without affecting other components of the switching device 210 vector.
[0138] Specifically, in this embodiment, the switching device 210 is connected to the first cache storage disk 204 via a first interface (e.g., a PCIe interface), and is connected to the second cache storage disk 205 via a second interface. It can be understood that the first interface and the second interface are two different interfaces in the switching device 210. The switching device 210 treats both the first interface and the second interface as valid interfaces. For example, the switching device 210 sets an valid group and adds the first interface and the second interface to the valid group, thereby forming an valid group including the first interface and the second interface. By maintaining the valid group, it is possible to determine which interfaces to broadcast to when writing data in parallel.
[0139] In the event of an abnormal power outage to the storage controller 200, the switch 210 can obtain the data transmitted by the CPU 201, which is the data in the cache 202. The switch 210 can then broadcast the data transmitted by the CPU 201 to all valid interfaces (including the first and second interfaces) in the active group, thereby writing the data in parallel to the first and second cache storage disks 204 and 205. This method not only improves transmission efficiency but also eliminates the need to broadcast data to unnecessary components, thereby reducing bandwidth loss.
[0140] An embodiment of the present invention may also provide a server including the storage array described above.
[0141] The storage controller provided in this embodiment adds two cache storage disks and a power backup unit to the original structure to achieve persistence of cache 202. Furthermore, to shorten the time it takes to flush data from cache 202 to the cache storage disks, the switching device 210 originally provided in the storage controller can write data to the two cache storage disks in parallel without adding any additional hardware. The switching device 210 uses the first interface connected to the first cache storage disk 204 and the second interface connected to the second cache storage disk 205 as valid interfaces. When data needs to be written to the cache storage disks, parallel data writing can be achieved by broadcasting to all valid interfaces. This implementation is simple and does not affect the data transmission process of other interfaces of the switching device 210. This storage controller solves some of the drawbacks of the original cache 202 persistence mechanism, directly improving the reliability of the key component of cache 202, thereby improving the reliability of the storage controller 200.
[0142] The present application also provides a storage array, comprising: a storage controller 200 and a data hard disk 300 as provided in any of the above embodiments; the storage controller 200 is connected to the data hard disk 300 and is configured to perform read and write operations on the data hard disk 300. The structure of the storage array can be seen in FIG. 2 and other figures (the storage array does not include the host 100), and will not be further described here.
[0143] In some embodiments, as shown in FIG. 7 , there are multiple storage controllers 200 , and the multiple storage controllers 200 are interconnected.
[0144] In this embodiment, multiple interconnected storage controllers 200 can be used to collaboratively implement data exchange between the host 100 and the data hard disk 300. Furthermore, if some of the storage controllers 200 fail (e.g., due to an abnormal power outage), the remaining storage controllers 200 can still operate normally. Generally, to save costs, a storage array is configured with only two storage controllers 200, as shown in FIG7 .
[0145] In some embodiments, multiple storage controllers 200 are configured to connect to multiple network adapters of the host 100. Specifically, the network adapters may be HBAs (Host Bus Adapters), NICs (Network Interface Controllers), and the like. As shown in FIG7 , the storage array includes two storage controllers 200, and the host 100 includes two HBAs, namely, HBA1 and HBA2. Both storage controllers 200 are connected to HBA1 and HBA2; for example, both storage controllers 200 are connected to HBA1 and HBA2 of the host 100 via their respective first IO controllers.
[0146] The storage array is connected to the host 100 through multiple network adapters of the host 100, which can improve the reliability of the network adapter on the host 100 side.
[0147] In some embodiments, multiple storage controllers in a storage array cooperate with each other to implement data reading and writing. Specifically, for ease of description, two storage controllers in the storage array are referred to as a first storage controller and a second storage controller, respectively.
[0148] Among them, the first storage controller is used to write the data at the host 100 into the local first cache and generate first verification data for the data stored in the first cache; copy the data stored in the first cache and the first verification data to the second storage controller; the first storage controller and the second storage controller are two storage controllers in the storage array.
[0149] The second storage controller is used to store the data stored in the first cache to a local second cache, and generate second verification data for the data stored in the second cache; when the second verification data is consistent with the first verification data, feedback a message to the first storage controller.
[0150] In this embodiment, when both the first storage controller and the second storage controller are able to operate normally (neither of them has any faults), data is mirrored on the caches 202 of the two storage controllers to ensure consistency of the caches 202 of the two storage controllers.
[0151] Specifically, the cache 202 of the first storage controller is referred to as the first cache, and the cache 202 of the second storage controller is referred to as the second cache. After the first storage controller obtains data from the host 100, it writes the data into its own first cache and generates verification data, namely, first verification data. For example, the first verification data can be generated by performing an exclusive-OR operation on the cache data. Furthermore, the first storage controller copies the data stored in the first cache to the second storage controller, so that the second storage controller writes the data into its local second cache.
[0152] In addition, the first storage controller also sends the first verification data to the second storage controller. The second storage controller can also obtain verification data, i.e., second verification data, by verifying the data in its second cache (such as XOR processing, etc.), and compares the second verification data with the first verification data. If the two are consistent, it means that the cache mirror is correct, and the two storage controllers can process the data accordingly.
[0153] In this embodiment, by performing cache mirroring on the first storage controller and the second storage controller, the consistency of the caches of the two can be maintained, thereby achieving dual-control operation of the data hard disk 300.
[0154] Although the embodiments of the present application have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations shall fall within the scope defined by the appended claims.
Claims
1. A storage controller, characterized in that: include: A central processing unit (201), a cache (202), a system hard disk (203), a first cache storage disk (204), a second cache storage disk (205), and a battery backup unit (206); The central processing unit (201) is connected to the cache (202) and is used to read and write data in the cache (202); The system hard disk (203) is connected to the central processing unit (201) and is used to provide the central processing unit (201) with an operating system required for operation; The first cache storage disk (204) and the second cache storage disk (205) are both connected to the central processing unit (201); the central processing unit (201) is further configured to write the data in the cache (202) to the first cache storage disk (204) and the second cache storage disk (205) in the event of an abnormal power failure of the storage controller; The battery backup unit (206) is used to supply power to the central processing unit (201), the cache (202), the system hard disk (203), the first cache storage disk (204) and the second cache storage disk (205) when the storage controller experiences an abnormal power outage.
2. The storage controller according to claim 1, wherein: Also includes: A first IO controller (207) and a second IO controller (208); The first IO controller (207) is used to connect to the front-end host (100); The second IO controller (208) is used to connect to the back-end data hard disk (300).
3. The storage controller according to claim 2, wherein: The central processing unit (201) is specifically used for: Obtaining a write request sent by the host (100) based on the first IO controller (207), and storing corresponding data to be written in the cache (202); Based on the second IO controller (208), the data in the cache (202) is persisted to the back-end data hard disk (300).
4. The storage controller according to claim 3, wherein: The step of persisting the data in the cache (202) to the back-end data hard disk (300) includes: Periodically persisting the data in the cache (202) to a back-end data hard disk (300); When the remaining space in the cache (202) is insufficient, at least part of the data first stored in the cache (202) is actively persisted to the back-end data hard disk (300).
5. The storage controller according to claim 1, wherein: The central processing unit (201) is specifically used for: In the event of abnormal power failure of the storage controller, the data in the cache (202) is synchronously written to the first cache storage disk (204) and the second cache storage disk (205) in a parallel manner.
6. The storage controller according to claim 5, wherein: Also includes: RAID card (209); the central processing unit (201) is connected to the first cache storage disk (204) and the second cache storage disk (205) via the RAID card (209); The RAID card (209) is used to synchronously write the data transmitted by the central processing unit (201) to the first cache storage disk (204) and the second cache storage disk (205).
7. The storage controller according to claim 6, wherein: The RAID card (209) is specifically used for: dividing the data transmitted by the central processing unit (201) into at least one data packet; For any data packet, the data packet is stored in the first cache storage disk (204), and the data packet is copied to the second cache storage disk (205).
8. The storage controller according to claim 5, wherein: Also includes: A switching device (210); the switching device (210) is connected to the root complex (2011) of the central processing unit (201), and is connected to the first cache storage disk (204) and the second cache storage disk (205); The switching device (210) is used to synchronously write the data transmitted by the central processing unit (201) to the first cache storage disk (204) and the second cache storage disk (205).
9. The storage controller according to claim 8, wherein: The switching device (210) is specifically used for: The first interface connected to the first cache storage disk (204) and the second interface connected to the second cache storage disk (205) are both used as valid interfaces; In the event of abnormal power failure of the storage controller, the data transmitted by the central processing unit (201) is broadcast to all valid interfaces.
10. The storage controller according to claim 1, wherein: The central processing unit (201) is further configured to: When the storage controller is powered on and started, determining whether the last shutdown of the storage controller was an abnormal power failure; In the case that the last shutdown of the storage controller was an abnormal power failure, recovery data is obtained from at least one of the first cache storage disk (204) and the second cache storage disk (205), and the recovery data is restored to the cache (202).
11. The storage controller according to claim 10, wherein: Obtaining the restored data from at least one of the first cache storage disk (204) and the second cache storage disk (205) comprises: When both the first cache storage disk (204) and the second cache storage disk (205) are normal, different parts of data are read from the first cache storage disk (204) and the second cache storage disk (205) in parallel, and the data read from the first cache storage disk (204) and the second cache storage disk (205) are combined into recovery data.
12. The storage controller according to claim 1, wherein: The system hard disk (203) is also used for performing any one of operating system booting, fault recovery and updating, storage configuration and management.
13. The storage controller according to claim 2, wherein: The central processing unit (201) is used for temporarily storing data at high speed based on the cache (202) during data interaction between the host (100) and the data hard disk (300).
14. The storage controller according to claim 1, wherein: The first cache storage disk (204) and the second cache storage disk (205) store the data in the cache (202) in a data mirroring manner.
15. The storage controller according to claim 10, wherein: The storage controller (200) is used to determine whether the last shutdown was an abnormal power failure based on the acquired system log and / or abnormal power failure flag.
16. A storage array, characterized in that: include: The storage controller (200) and the data hard disk (300) according to any one of claims 1 to 11; The storage controller (200) is connected to the data hard disk (300) and is used to perform read and write operations on the data hard disk (300).
17. The storage array according to claim 16, wherein: There are multiple storage controllers (200); A plurality of storage controllers (200) are interconnected.
18. The storage array according to claim 17, wherein: The first storage controller is used to write data at the host (100) into a local first cache and generate first verification data of the data stored in the first cache; copying the data stored in the first cache and the first verification data to a second storage controller; The first storage controller and the second storage controller are two storage controllers (200) in the storage array; The second storage controller is configured to store the data stored in the first cache into a local second cache and generate second verification data for the data stored in the second cache; When the second verification data is consistent with the first verification data, a message is fed back to the first storage controller.
19. The storage array according to claim 17, wherein: The plurality of storage controllers (200) are each used to connect to a plurality of network adapters of the host (100).
20. A server, characterized in that: The server comprises the storage array according to any one of claims 16 to 19.
Citation Information
Patent Citations
Method for increasing data writing speed of electronic hard disk
CN102541458A
Data buffer device, data storage system and method
CN102870100A
Cache data power failure protection method and computer equipment
CN103049070A
Power-off protection method of storage array and related device
CN111880636A
Data writing method and device, equipment and storage medium
CN115167784A