Method for managing hard disk, computer equipment and storage medium
By receiving asynchronous event data of NVME hard disk and controlling its status, the data storage problem caused by the error restart of NVME hard disk is solved, and the reliability of the NVME hard disk system is improved.
Patent Information
- Application Number
- CN202411083805.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-08-08
AI Technical Summary
In NVME hard disk data storage systems with databases, when an incorrect NVME hard disk is restarted, it may lead to a large number of data storage errors and reduce system reliability.
By receiving the asynchronous event data of the NVME hard disk, control it to be in a read-only or unwritable state, and judge whether to remove it from the independent disk redundant array based on the event data, and switch to other healthy hard disks to avoid data writing errors.
Improve the reliability of the NVME hard disk data storage system, prevent data storage errors during NVME hard disk failure, and improve the stability and reliability of the system.
Smart Images

Figure CN118642660B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method for managing a hard disk, a computer device, and a storage medium. Background Art
[0002] Currently, a data storage system having a database and a Non Volatile Memory Host Controller Interface Specification (NVME) hard disk provided to the database is widely used. During the operation of the data storage system having the NVME hard disk and the database, sometimes, the NVME hard disk provided to the database may have an error.
[0003] In the related art, when an error occurs in the NVME hard disk provided to the database, the NVME hard disk provided to the database with the error is restarted. However, during the restart of the NVME hard disk with the error, the database can still use the NVME hard disk with the error provided to the database to complete the database operation. If during the restart of the NVME hard disk, the database uses the NVME hard disk with the error provided to the database to complete the data write operation, data will be written to the NVME hard disk with the error provided to the database, causing data storage errors. The restart time of the NVME hard disk with the error is long, and a large number of data storage errors may occur. This results in a reduction in the reliability of the data storage system having a database and an NVME hard disk provided to the database. How to improve the reliability of the data storage system having a database and an NVME hard disk provided to the database has become a problem that needs to be solved. Summary of the invention
[0004] In view of this, embodiments of the present disclosure provide a method, apparatus, computer device, and storage medium for managing a hard disk.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for managing a hard disk, the method comprising:
[0006] Receive asynchronous event data of a target asynchronous event related to a target non-volatile memory host controller interface hard disk, the asynchronous event data of the target asynchronous event including: an asynchronous event type of the target asynchronous event and asynchronous event information of the target asynchronous event, wherein the asynchronous event data of the target asynchronous event is sent by a module for reporting asynchronous events of the non-volatile memory host controller interface hard disk when an asynchronous event reporting function of the non-volatile memory host controller interface hard disk is enabled, and the target non-volatile memory host controller interface hard disk belongs to a target redundant array of independent disks;
[0007] Control the target non-volatile memory host controller interface hard disk to be in a read-only state or a non-writable state;
[0008] Determining whether it is necessary to remove the target non-volatile memory host controller interface hard disk from the target independent disk redundant array according to the asynchronous event data of the target asynchronous event;
[0009] When it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array, the target non-volatile memory host controller interface hard disk is removed from the target independent disk redundant array, and the non-volatile memory host controller interface hard disk provided to the target database is switched from the target non-volatile memory host controller interface hard disk to other non-volatile memory host controller interface hard disks in the target independent disk redundant array, wherein the other non-volatile memory host controller interface hard disks are non-volatile memory host controller interface hard disks in the target independent disk redundant array except the target non-volatile memory host controller interface hard disk.
[0010] In a possible implementation, determining whether to remove the target non-volatile memory host controller interface hard disk from the target independent disk redundant array according to the asynchronous event data of the target asynchronous event includes:
[0011] Determine whether the asynchronous event type of the target asynchronous event is one of a plurality of preset error types;
[0012] When it is determined that the asynchronous event type of the target asynchronous event is one of the preset error types, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array;
[0013] When it is determined that the asynchronous event type of the target asynchronous event is not one of the preset error types, determining whether the asynchronous event type of the target asynchronous event is one of the preset fault types;
[0014] When it is determined that the asynchronous event type of the target asynchronous event is one of the preset fault types, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array;
[0015] When it is determined that the asynchronous event type of the target asynchronous event is not one of the preset fault types, determining whether the asynchronous event type of the target asynchronous event is a device status type;
[0016] When it is determined that the asynchronous event type of the target asynchronous event is a device status type, determining whether the device status of the target non-volatile memory host controller interface hard disk is a device abnormal status according to asynchronous event information indicating the status of the target non-volatile memory host controller interface hard disk in the asynchronous event data of the target asynchronous event;
[0017] When it is determined that the device state of the target non-volatile memory host controller interface hard disk is a device abnormal state, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array.
[0018] In a possible implementation, determining whether the device state of the target non-volatile memory host controller interface hard disk is a device abnormal state according to the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk in the asynchronous event data of the target asynchronous event includes:
[0019] Determine whether the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk meets a preset condition corresponding to the device abnormal state, wherein the preset condition corresponding to the device abnormal state is one of the following conditions: the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk is greater than a preset value corresponding to the device abnormal state, and the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk is less than or equal to the preset value corresponding to the device abnormal state;
[0020] When it is determined that the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk meets the preset condition corresponding to the device abnormal state, the device state of the target non-volatile memory host controller interface hard disk is determined to be the device abnormal state.
[0021] In a possible implementation, the plurality of preset error types include: an error event type agreed upon by a non-volatile memory host controller interface protocol and a user-defined error event type.
[0022] In a possible implementation, when it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array, removing the target non-volatile memory host controller interface hard disk from the target independent disk redundant array, and switching the non-volatile memory host controller interface hard disk provided to the target database from the target non-volatile memory host controller interface hard disk to another non-volatile memory host controller interface hard disk in the target independent disk redundant array includes:
[0023] A target database is used to send a trigger instruction to a tool for managing a target independent redundant array of disks running on a target server, wherein the target database runs on the target server, and the trigger instruction is used to trigger the tool for managing the target independent redundant array of disks to remove a target non-volatile memory host controller interface hard disk from the target independent redundant array of disks, and to switch the non-volatile memory host controller interface hard disk provided to the target database from the target non-volatile memory host controller interface hard disk to other non-volatile memory host controller interface hard disks in the target independent redundant array of disks.
[0024] In one possible implementation, receiving asynchronous event data of a target asynchronous event related to a target non-volatile memory host controller interface hard disk includes:
[0025] Receiving asynchronous event data of a health status asynchronous event related to a target non-volatile memory host controller interface hard disk sent by a baseboard management controller of a target server, wherein the asynchronous event data of the health status asynchronous event includes: a health status event type and health status information of the target non-volatile memory host controller interface hard disk; and
[0026] Determining whether to remove a target non-volatile memory host controller interface hard disk from a target independent disk redundant array according to asynchronous event data of the target asynchronous event includes:
[0027] Determine whether the target non-volatile memory host controller interface hard disk is in an abnormal health state according to the health status information of the target non-volatile memory host controller interface hard disk;
[0028] When it is determined that the target non-volatile memory host controller interface hard disk is in an abnormal health state, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array.
[0029] In a possible implementation, determining whether the target non-volatile memory host controller interface hard disk is in an abnormal health state according to the health status information of the target non-volatile memory host controller interface hard disk includes:
[0030] Determine whether an information item used for comparison with a preset value corresponding to a healthy abnormal state in the health status information of the target non-volatile memory host controller interface hard disk satisfies a preset condition corresponding to the healthy abnormal state, wherein the preset condition corresponding to the healthy abnormal state is one of the following conditions: the information item used for comparison with the preset value corresponding to the healthy abnormal state is greater than the preset value corresponding to the healthy abnormal state, and the information item used for comparison with the preset value corresponding to the healthy abnormal state is less than or equal to the preset value corresponding to the healthy abnormal state;
[0031] When it is determined that the information item used for comparison with the preset value corresponding to the abnormal health state meets the preset condition corresponding to the abnormal health state, it is determined that the target non-volatile memory host controller interface hard disk is in the abnormal health state.
[0032] In a possible implementation, it also includes:
[0033] During the startup of the target server, after entering the operating system of the target server, the non-volatile memory host controller interface hard disk asynchronous event reporting function is enabled using the operating system of the target server.
[0034] In a possible implementation, the asynchronous event of the target asynchronous event is an asynchronous event agreed upon by the non-volatile memory host controller interface protocol or a user-defined asynchronous event.
[0035] In a possible implementation, controlling the target non-volatile memory host controller interface hard disk to be in a read-only state or a non-writable state includes:
[0036] A write request to a target non-volatile memory host controller interface hard disk is not sent to a hard disk controller of the target non-volatile memory host controller interface hard disk.
[0037] In one possible implementation, the target redundant array of independent disks includes one of the following items: multiple non-volatile memory host controller interface hard disks on the target server, and multiple non-volatile memory host controller interface hard disks outside the target server and communicatively connected to the target server.
[0038] In a possible implementation, it also includes:
[0039] When it is determined that the target non-volatile memory host controller interface hard disk does not need to be removed from the target independent disk redundant array, the target non-volatile memory host controller interface hard disk is controlled to be in a readable and writable state.
[0040] In a second aspect, an embodiment of the present disclosure provides a device for managing a hard disk, the device for managing a hard disk comprising:
[0041] A receiving unit, used for receiving asynchronous event data of a target asynchronous event related to a target non-volatile memory host controller interface hard disk, wherein the asynchronous event data of the target asynchronous event includes: an asynchronous event type of the target asynchronous event and asynchronous event information of the target asynchronous event, wherein the asynchronous event data of the target asynchronous event is sent by a module for reporting asynchronous events of the non-volatile memory host controller interface hard disk when an asynchronous event reporting function of the non-volatile memory host controller interface hard disk is enabled, and the target non-volatile memory host controller interface hard disk belongs to a target redundant array of independent disks;
[0042] A control unit, used for controlling the target non-volatile memory host controller interface hard disk to be in a read-only state or a non-writable state;
[0043] A determination unit, configured to determine whether it is necessary to remove the target non-volatile memory host controller interface hard disk from the target independent disk redundant array according to the asynchronous event data of the target asynchronous event;
[0044] The removal and switching unit is used to remove the target non-volatile memory host controller interface hard disk from the target independent disk redundant array when it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array, and to switch the NVME hard disk provided to the target database from the target non-volatile memory host controller interface hard disk to other non-volatile memory host controller interface hard disks in the target independent disk redundant array, wherein the other non-volatile memory host controller interface hard disks are non-volatile memory host controller interface hard disks in the target independent disk redundant array except the target non-volatile memory host controller interface hard disk.
[0045] In a possible implementation, the determination unit is further used to determine whether the asynchronous event type of the target asynchronous event is a preset error type among multiple preset error types; when it is determined that the asynchronous event type of the target asynchronous event is a preset error type among multiple preset error types, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array; when it is determined that the asynchronous event type of the target asynchronous event is not a preset error type among multiple preset error types, it is determined whether the asynchronous event type of the target asynchronous event is a preset fault among multiple preset fault types; when it is determined that the asynchronous event type of the target asynchronous event is a preset fault type among multiple preset fault types, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array. The target non-volatile memory host controller interface hard disk is removed from the target independent disk redundant array; when it is determined that the asynchronous event type of the target asynchronous event is not one of the preset fault types, whether the asynchronous event type of the target asynchronous event is a device status type; when it is determined that the asynchronous event type of the target asynchronous event is a device status type, based on the asynchronous event information indicating the status of the target non-volatile memory host controller interface hard disk in the asynchronous event data of the target asynchronous event, whether the device status of the target non-volatile memory host controller interface hard disk is a device abnormal status; when it is determined that the device status of the target non-volatile memory host controller interface hard disk is a device abnormal status, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array.
[0046] In one possible implementation, the determination unit is further used to determine whether the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk meets a preset condition corresponding to the device abnormal state, and the preset condition corresponding to the device abnormal state is one of the following conditions: the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk is greater than a preset value corresponding to the device abnormal state, and the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk is less than or equal to the preset value corresponding to the device abnormal state; when it is determined that the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk meets the preset condition corresponding to the device abnormal state, it is determined that the device state of the target non-volatile memory host controller interface hard disk is a device abnormal state.
[0047] In a possible implementation, the plurality of preset error types include: an error event type agreed upon by a non-volatile memory host controller interface protocol and a user-defined error event type.
[0048] In one possible implementation, the removal and switching unit is further used to use the target database to send a trigger instruction to a tool for managing a target independent redundant array of disks running on a target server, wherein the target database runs on the target server, and the trigger instruction is used to trigger the tool for managing the target independent redundant array of disks to remove the target non-volatile memory host controller interface hard disk from the target independent redundant array of disks, and to switch the non-volatile memory host controller interface hard disk provided to the target database from the target non-volatile memory host controller interface hard disk to other non-volatile memory host controller interface hard disks in the target independent redundant array of disks.
[0049] In one possible implementation, the receiving unit is further used to receive asynchronous event data of a health status asynchronous event related to a target non-volatile memory host controller interface hard disk sent by a baseboard management controller of a target server, the asynchronous event data of the health status asynchronous event including: a health status event type and health status information of the target non-volatile memory host controller interface hard disk; the determining unit is further used to determine whether the target non-volatile memory host controller interface hard disk is in an abnormal health state based on the health status information of the target non-volatile memory host controller interface hard disk; when it is determined that the target non-volatile memory host controller interface hard disk is in an abnormal health state, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array.
[0050] In one possible implementation, the determination unit is further used to determine whether an information item in the health status information of the target non-volatile memory host controller interface hard disk used for comparison with a preset value corresponding to a healthy abnormal state satisfies a preset condition corresponding to the healthy abnormal state, and the preset condition corresponding to the healthy abnormal state is one of the following conditions: the information item used for comparison with the preset value corresponding to the healthy abnormal state is greater than the preset value corresponding to the healthy abnormal state, and the information item used for comparison with the preset value corresponding to the healthy abnormal state is less than or equal to the preset value corresponding to the healthy abnormal state; when it is determined that the information item used for comparison with the preset value corresponding to the healthy abnormal state satisfies the preset condition corresponding to the healthy abnormal state, it is determined that the target non-volatile memory host controller interface hard disk is in a healthy abnormal state.
[0051] In a possible implementation, the device for managing a hard disk further includes:
[0052] The enabling unit is used to enable the non-volatile memory host controller interface hard disk asynchronous event reporting function by using the operating system of the target server after entering the operating system of the target server during the startup of the target server.
[0053] In a possible implementation, the asynchronous event of the target asynchronous event is an asynchronous event agreed upon by the non-volatile memory host controller interface protocol or a user-defined asynchronous event.
[0054] In a possible implementation, the control unit is further configured to not send a write request for the target non-volatile memory host controller interface hard disk to a hard disk controller of the target non-volatile memory host controller interface hard disk.
[0055] In one possible implementation, the target redundant array of independent disks includes one of the following items: multiple non-volatile memory host controller interface hard disks on the target server, and multiple non-volatile memory host controller interface hard disks outside the target server and communicatively connected to the target server.
[0056] In a possible implementation, the device for managing a hard disk further includes:
[0057] The recovery unit is used to control the target non-volatile memory host controller interface hard disk to be in a readable and writable state when it is determined that the target non-volatile memory host controller interface hard disk does not need to be removed from the target independent disk redundant array.
[0058] In a third aspect, an embodiment of the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0059] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding implementation manner thereof.
[0060] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0061] The method for managing a hard disk provided by the embodiment of the present disclosure receives asynchronous event data of a target asynchronous event related to a target NVME hard disk; controls the target NVME hard disk to be in a read-only state or a non-writable state; determines whether it is necessary to remove the target NVME hard disk from the target independent disk redundant array according to the asynchronous event data of the target asynchronous event; when it is determined that the target NVME hard disk needs to be removed from the target independent disk redundant array, removes the target NVME hard disk from the target independent disk redundant array, and switches the NVME hard disk provided to the target database from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array. Controlling the target NVME hard disk to be in a read-only state or a non-writable state can avoid data storage errors caused by writing data to the target NVME hard disk when the target NVME hard disk fails. When the target NVME hard disk needs to be removed from the target independent disk redundant array, the target NVME hard disk can be promptly removed from the target independent disk redundant array according to the asynchronous event data of the target asynchronous event related to the target NVME hard disk, and the target NVME hard disk can be promptly removed from the target independent disk redundant array, and the NVME hard disk provided to the target database can be promptly switched from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array. There is no need to restart the target NVME hard disk, which avoids the situation where the database uses the NVME hard disk with errors provided to the database to complete database operations during the restart of the NVME hard disk, causing data storage errors, and improves the reliability of the data storage system having a database and the NVME hard disk provided to the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0063] Figure 1 It is a schematic diagram of an example of an NVME hard disk constituting a redundant array of independent disks involved in the method for managing a hard disk provided in an embodiment of the present disclosure;
[0064] Figure 2 is a flowchart of a method for managing a hard disk provided by an embodiment of the present disclosure;
[0065] Figure 3 is a flowchart of another method for managing a hard disk provided by an embodiment of the present disclosure;
[0066] Figure 4 is a flowchart of an example of managing a hard disk in an embodiment of the present disclosure;
[0067] Figure 5 is a structural block diagram of a device for managing a hard disk according to an embodiment of the present disclosure;
[0068] Figure 6 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0070] It should be noted that the NVME hard disk involved in the method for managing a hard disk provided in the embodiment of the present disclosure can form a redundant array of independent disks (Redundant Arrays of Independent Disks, RAID for short), and the NVME hard disk involved in the method for managing a hard disk provided in the embodiment of the present disclosure can work in RAID mode.
[0071] As an example, the NVME hard disks involved in the method for managing hard disks provided in the embodiment of the present disclosure may constitute a redundant array of independent disks 10.
[0072] refer to Figure 1, which shows a schematic diagram of an example of an NVME hard disk forming an independent disk redundant array involved in the method for managing a hard disk provided in an embodiment of the present disclosure.
[0073] Figure 1The method for managing hard disks provided by the embodiment of the present disclosure is shown to be applied to NVME hard disk 0, NVME hard disk 1, NVME hard disk 2, NVME hard disk 3, NVME hard disk 4, NVME hard disk 5, NVME hard disk 6, and NVME hard disk 7 in the storage system. NVME hard disk 0, NVME hard disk 1, NVME hard disk 2, NVME hard disk 3, NVME hard disk 4, NVME hard disk 5, NVME hard disk 6, and NVME hard disk 7 are on the target server. The central processing unit (CPU) 0 of the target server can communicate with the CPU1 of the target server through the Cache Coherent Interconnect for Accelerators (CCIX) protocol or the Ultra Path Interconnect (UPI) protocol. The CPU0 of the target server is connected to the RAID card 0 on the target server through a high-speed peripheral component interconnect express (PCIe) bus, and the CPU1 of the target server is connected to the RAID card 1 on the target server through the PCIe bus. RAID card 0 on the target server is connected to NVME hard disk 0 through peripheral component interconnect slot (PCI SLOT) 0, RAID card 0 on the target server is connected to NVME hard disk 1 through PCI SLOT 1, RAID card 0 on the target server is connected to NVME hard disk 2 through PCI SLOT 2, and RAID card 0 on the target server is connected to NVME hard disk 3 through PCI SLOT 3. RAID card 1 on the target server is connected to NVME hard disk 4 through PCI SLOT 4, RAID card 1 on the target server is connected to NVME hard disk 5 through PCI SLOT 5, RAID card 1 on the target server is connected to NVME hard disk 6 through PCI SLOT 6, and RAID card 1 on the target server is connected to NVME hard disk 7 through PCI SLOT 3. NVME hard disk 0, NVME hard disk 1, NVME hard disk 2, and NVME hard disk 3 can form a RAID 10, such as soft RAID 10, and NVME hard disk 0, NVME hard disk 1, NVME hard disk 2, and NVME hard disk 3 work in RAID 10 mode. NVME hard disk 4, NVME hard disk 5, NVME hard disk 6, and NVME hard disk 7 can form another RAID10, such as soft RAID10, and NVME hard disk 4, NVME hard disk 5, NVME hard disk 6, and NVME hard disk 7 work in RAID10 mode.
[0074] refer to Figure 2 , which shows a flow chart of a method for managing a hard disk provided in an embodiment of the present disclosure.
[0075] In step S201, asynchronous event data of a target asynchronous event related to a target NVME hard disk is received.
[0076] The target NVME hard disk can be any NVME hard disk. The target NVME hard disk can be on the target server.
[0077] In the embodiment of the present disclosure, the target asynchronous event (Asynchronous Event) related to the target NVME hard disk may be any asynchronous event related to the target NVME hard disk.
[0078] The asynchronous event data of the target asynchronous event includes: the asynchronous event type of the target asynchronous event and the asynchronous event information (Asynchronous Event Information) of the target asynchronous event. The asynchronous event information of the target asynchronous event is used to describe the target asynchronous event.
[0079] As an example, the asynchronous event type of the target asynchronous event is an error event type. The target asynchronous event is an error event.
[0080] As another example, the asynchronous event type of the target asynchronous event is a SMART event type. The target asynchronous event is a SMART event.
[0081] As another example, the target asynchronous event is a health status event (Health Status event). The asynchronous event information of the target asynchronous event is health information (health information).
[0082] It should be noted that the asynchronous event types such as error event type, SMART event type, and health status event type in the above examples are asynchronous event types agreed upon by the NVME protocol. The target asynchronous event related to the target NVME hard disk can also be a user-defined asynchronous event. The user can define the asynchronous event type through the Vendor specific type.
[0083] The asynchronous event data of the target asynchronous event related to the target NVME hard disk is sent by the module for reporting the NVME hard disk asynchronous event when the NVME hard disk asynchronous event reporting function is turned on.
[0084] In the disclosed embodiment, the target NVME hard disk belongs to a target redundant array of independent disks.
[0085] In the embodiment of the present disclosure, the target server may be any server to which the method for managing a hard disk provided in the embodiment of the present disclosure is applied.
[0086] The target independent disk redundant array may be an independent disk redundant array composed of multiple NVME hard disks on the target server. The target independent disk redundant array may also be an independent disk redundant array composed of multiple NVME hard disks outside the target server and communicatively connected to the target server.
[0087] The module for reporting NVME hard disk asynchronous events and the module for executing the method for managing the hard disk provided in the embodiment of the present disclosure can run on the target server.
[0088] In the disclosed embodiment, the NVME hard disk firmware for managing the NVME hard disk on the target server can report the target NVME hard disk-related error events, target NVME hard disk-related SMART events, target NVME hard disk-related custom asynchronous events, and other asynchronous events related to the target NVME hard disk when the NVME hard disk asynchronous event reporting function is turned on. The NVME hard disk firmware for managing the NVME hard disk is an inherent unit in the storage system having a database and an NVME hard disk provided to the database. There is no need to develop a new module to report the asynchronous events related to the target NVME hard disk, which improves the convenience of reporting the asynchronous events related to the target NVME hard disk.
[0089] In step S202, the target NVME hard disk is controlled to be in a read-only state or a non-writable state.
[0090] The target NVME hard disk is controlled to be in a read-only state or a non-writable state, thereby avoiding data storage errors caused by writing data to the target NVME hard disk when the target NVME hard disk fails.
[0091] In step S202, the write request to the target NVME hard disk may not be sent to the hard disk controller of the target NVME hard disk or the hard disk controller of the target NVME hard disk may be prohibited from processing the write request to the target NVME hard disk. By controlling the target NVME hard disk to be in a read-only state or a non-writable state, data may be temporarily unable to be written to the target NVME hard disk. Thus, data storage errors caused by writing data to the target NVME hard disk when the target NVME hard disk fails are prevented.
[0092] In step S203, it is determined whether the target NVME hard disk needs to be removed from the target redundant array of independent disks according to the asynchronous event data of the target asynchronous event related to the target NVME hard disk.
[0093] The asynchronous event type of the target asynchronous event related to the target NVME hard disk and the asynchronous event information of the target asynchronous event related to the target NVME hard disk can be parsed from the asynchronous event data of the target asynchronous event related to the target NVME hard disk.
[0094] In a possible implementation, multiple asynchronous event types indicating that the target NVME hard disk needs to be removed from the target independent disk redundant array can be pre-set, and the multiple asynchronous event types indicating that the target NVME hard disk needs to be removed from the target independent disk redundant array can include: error event types agreed upon in the NVME protocol, and user-defined error event types. In step S203, it can be determined whether the asynchronous event type of the target asynchronous event related to the target NVME hard disk is a pre-set asynchronous event type indicating that the target NVME hard disk needs to be removed from the target independent disk redundant array. If the asynchronous event type of the target asynchronous event related to the target NVME hard disk is a pre-set asynchronous event type indicating that the target NVME hard disk needs to be removed from the target independent disk redundant array, it can be determined that the target NVME hard disk needs to be removed from the target independent disk redundant array. If the asynchronous event type of the target asynchronous event related to the target NVME hard disk is not a pre-set asynchronous event type indicating that the target NVME hard disk needs to be removed from the target independent disk redundant array, it can be determined that the target NVME hard disk does not need to be removed from the target independent disk redundant array.
[0095] In another possible implementation, multiple asynchronous event types indicating that the target NVME hard disk needs to be removed from the target independent disk redundant array, and multiple asynchronous event types indicating that the target NVME hard disk may need to be removed from the target independent disk redundant array, such as device status types, can be pre-set. If the asynchronous event type of the target asynchronous event is not a pre-set asynchronous event type indicating that the target NVME hard disk needs to be removed from the target independent disk redundant array, but the asynchronous event type of the target asynchronous event is an asynchronous event type indicating that the target NVME hard disk may need to be removed from the target independent disk redundant array, it can be determined whether the asynchronous event information of the target asynchronous event related to the target NVME hard disk meets the preset fault condition corresponding to the asynchronous event type indicating that the target NVME hard disk may need to be removed from the target independent disk redundant array. If the asynchronous event information of the target asynchronous event related to the target NVME hard disk meets the preset fault condition, it can be determined that the target NVME hard disk needs to be removed from the target independent disk redundant array. As an example, the preset fault condition may include one of the following items: the information item in the asynchronous event information of the target asynchronous event related to the target NVME hard disk is greater than the threshold corresponding to the preset fault condition, and the information item in the asynchronous event information of the target asynchronous event related to the target NVME hard disk is less than or equal to the threshold corresponding to the preset fault condition.
[0096] In step S204, when it is determined that the target NVME hard disk needs to be removed from the target independent disk redundant array, the target NVME hard disk is removed from the target independent disk redundant array, and the NVME hard disk provided to the target database is switched from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array.
[0097] As an example, the type of the target database is a TDSQL database.
[0098] When it is determined that the target NVME hard disk needs to be removed from the target independent disk redundant array, removing the target NVME hard disk from the target independent disk redundant array may include: when it is determined that the target NVME hard disk needs to be removed from the target independent disk redundant array, deleting the target NVME hard disk from the target independent disk redundant array.
[0099] It should be noted that removing the target NVME hard disk from the target independent disk redundant array can be called kicking the target NVME hard disk.
[0100] The other NVME hard disks in the target redundant array of independent disks are NVME hard disks other than the target NVME hard disk in the target redundant array of independent disks.
[0101] It should be noted that other NVME hard disks in the target redundant array of independent disks can be regarded as NVME hard disks that are not currently faulty.
[0102] When it is determined that the target NVME hard disk needs to be removed from the target independent disk redundant array, the NVME hard disk provided to the target database is switched from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array. Thus, the NVME hard disk provided to the target database is changed from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array.
[0103] The NVME hard disk provided to the target database is switched from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array, so that the target database can complete database operations such as data writing and data reading through other NVME hard disks in the target independent disk redundant array.
[0104] In step S204, when it is determined that the target NVME hard disk does not need to be removed from the target redundant array of independent disks, the target non-volatile memory host controller interface hard disk can be controlled to be in a readable and writable state.
[0105] refer to Figure 3 , which shows a flow chart of another method for managing a hard disk provided in an embodiment of the present disclosure.
[0106] In step S301, asynchronous event data of a target asynchronous event related to a target NVME hard disk is received.
[0107] In a possible implementation, it also includes: during the startup of the target server, after entering the operating system of the target server, using the operating system of the target server to enable the NVME hard disk asynchronous event reporting function. After the NVME hard disk asynchronous event reporting function is enabled, the module for reporting the NVME hard disk asynchronous event reports the NVME hard disk asynchronous event, that is, sends the asynchronous event data of the target asynchronous event related to the target NVME hard disk to the module for executing the method for managing the hard disk provided by the embodiment of the present disclosure. Thus, once the target server is started, the module for reporting the NVME hard disk asynchronous event can report the NVME hard disk asynchronous event.
[0108] In step S302, the target NVME hard disk is controlled to be in a read-only state or a non-writable state.
[0109] Controlling the target NVME hard disk to be in a read-only state or a non-writable state can avoid data storage errors caused by writing data to the target NVME hard disk when the target NVME hard disk fails.
[0110] In step S303, it is determined whether the target NVME hard disk needs to be removed from the target independent disk redundant array according to the asynchronous event data of the target asynchronous event, multiple preset fault types, multiple preset error types, and the device status type.
[0111] The plurality of preset error types may include: an error event type agreed upon by the NVME protocol and an error event type defined by a user.
[0112] The asynchronous event type of the target asynchronous event related to the target NVME hard disk and the asynchronous event information of the target asynchronous event related to the target NVME hard disk can be parsed from the asynchronous event data of the target asynchronous event related to the target NVME hard disk.
[0113] Step S303 may include: determining whether the asynchronous event type of the target asynchronous event is a preset error type among multiple preset error types; when it is determined that the asynchronous event type of the target asynchronous event is a preset error type among multiple preset error types, determining that the target NVME hard disk needs to be removed from the target independent disk redundant array; when it is determined that the asynchronous event type of the target asynchronous event is not a preset error type among multiple preset error types, determining whether the asynchronous event type of the target asynchronous event is a preset fault among multiple preset fault types; when it is determined that the asynchronous event type of the target asynchronous event is a preset fault type among multiple preset fault types, determining that The target NVME hard disk is removed from the target independent disk redundant array; when it is determined that the asynchronous event type of the target asynchronous event is not one of the preset fault types among multiple preset fault types, whether the asynchronous event type of the target asynchronous event is a device status type; when it is determined that the asynchronous event type of the target asynchronous event is a device status type, according to the asynchronous event information indicating the status of the target NVME hard disk in the asynchronous event data of the target asynchronous event, whether the device status of the target NVME hard disk is a device abnormal state; when it is determined that the device status of the target NVME hard disk is a device abnormal state, it is determined that the target NVME hard disk needs to be removed from the target independent disk redundant array.
[0114] In a possible implementation, when it is determined that the asynchronous event type of the target asynchronous event related to the target NVME hard disk is a device status type, determining whether the device status of the target NVME hard disk is a device abnormal state according to the asynchronous event information indicating the status of the target NVME hard disk in the asynchronous event data of the target asynchronous event related to the target NVME hard disk includes: determining whether the asynchronous event information indicating the status of the target NVME hard disk meets the preset condition corresponding to the device abnormal state, and the preset condition corresponding to the device abnormal state is one of the following conditions: the asynchronous event information indicating the status of the target non-volatile memory host controller interface hard disk is greater than the preset value corresponding to the device abnormal state, and the asynchronous event information indicating the status of the target non-volatile memory host controller interface hard disk is less than or equal to the preset value corresponding to the device abnormal state; when it is determined that the asynchronous event information indicating the status of the target NVME hard disk meets the preset condition corresponding to the device abnormal state, determining that the device status of the target NVME hard disk is a device abnormal state.
[0115] As an example, an asynchronous event information indicating the state of the target NVME hard disk in the asynchronous event data of the target asynchronous event is the temperature of the target NVME hard disk, a preset condition corresponding to the device abnormal state is that the temperature of the target NVME hard disk is higher than the temperature threshold, and a preset value corresponding to the device abnormal state in a preset condition corresponding to the device abnormal state is the temperature threshold. When it is determined that the temperature of the target NVME hard disk is greater than the temperature threshold, the device state of the target NVME hard disk is determined to be the device abnormal state.
[0116] In the embodiments of the present disclosure, it is determined whether the asynchronous event type of the target asynchronous event is a preset error type among multiple preset error types, whether the asynchronous event type of the target asynchronous event is a preset fault among multiple preset fault types, and whether the device status of the target NVME hard disk is an abnormal device status. Thus, it can be more comprehensively judged whether the target NVME hard disk needs to be removed from the target independent disk redundant array.
[0117] In one possible implementation, a target database is used to send a trigger instruction to a tool for managing a target independent redundant array of disks running on a target server, wherein the target database runs on the target server, and the trigger instruction is used to trigger the tool for managing the target independent redundant array of disks to remove the target non-volatile memory host controller interface hard disk from the target independent redundant array of disks, and to switch the non-volatile memory host controller interface hard disk provided to the target database from the target non-volatile memory host controller interface hard disk to other non-volatile memory host controller interface hard disks in the target independent redundant array of disks.
[0118] As an example, the tool used to manage the target redundant array of independent disks may be MDADM. MDADM is a software tool for Linux systems that is used to manage RAID (Redundant Array of Independent Disks) arrays. MDADM allows users to create, manage, and monitor different levels of RAID, such as RAID 0, RAID 1, RAID 5, RAID 6, etc. With MDADM, users can add, delete, rebuild, and repair RAID devices to improve data redundancy and performance. MDADM also provides a command line interface and configuration files to manage RAID devices, allowing users to easily perform related operations.
[0119] In a possible implementation, the target asynchronous event is a health status asynchronous event, and receiving asynchronous event data of the target asynchronous event related to the target NVME hard disk includes: receiving asynchronous event data of the health status asynchronous event related to the target NVME hard disk sent by the baseboard management controller (BMC) of the target server, the asynchronous event data of the health status asynchronous event including: health status event type, health status information of the target NVME hard disk; and determining whether the target NVME hard disk needs to be removed from the target independent disk redundant array according to the asynchronous event data of the target asynchronous event includes: determining whether the target NVME hard disk is in a health abnormal state according to the health status information of the target NVME hard disk; when it is determined that the target NVME hard disk is in a health abnormal state, determining that the target NVME hard disk needs to be removed from the target independent disk redundant array.
[0120] When the target asynchronous event related to the target non-volatile memory host controller interface hard disk is a health status asynchronous event, the asynchronous event information of the target asynchronous event is the health status information of the target NVME hard disk.
[0121] When determining whether the target NVME hard disk is in an abnormal health state based on the health status information of the target NVME hard disk, determine whether the information item used for comparison with the preset value corresponding to the abnormal health state in the health status information of the target non-volatile memory host controller interface hard disk meets the preset condition corresponding to the abnormal health state, and the preset condition corresponding to the abnormal health state is one of the following conditions: the information item used for comparison with the preset value corresponding to the abnormal health state is greater than the preset value corresponding to the abnormal health state, and the information item used for comparison with the preset value corresponding to the abnormal health state is less than or equal to the preset value corresponding to the abnormal health state; when it is determined that the information item used for comparison with the preset value corresponding to the abnormal health state meets the preset condition corresponding to the abnormal health state, it is determined that the target non-volatile memory host controller interface hard disk is in an abnormal health state.
[0122] As an example, the information item used for comparison with the preset value corresponding to the abnormal health state is
[0123] One of the following items: read error rate in the health status information of the target non-volatile memory host controller interface hard disk, spindle motor re-rotation to the specified speed in the health status information of the target non-volatile memory host controller interface hard disk, current number of sectors to be mapped and offline uncorrectable sectors in the health status information of the target non-volatile memory host controller interface hard disk, seek error rate in the health status information of the target non-volatile memory host controller interface hard disk. The preset value corresponding to the abnormal health status is one of the following items: preset read error rate, preset spindle motor re-rotation to the specified speed, preset number of sectors to be mapped and offline uncorrectable sectors, preset seek error rate.
[0124] In an embodiment of the present disclosure, the baseboard management controller of the target server can report a health status asynchronous event, that is, send the asynchronous event data of the health status asynchronous event related to the target NVME hard disk to the module that executes the method for managing the hard disk provided by the embodiment of the present disclosure. When it is determined that the target NVME hard disk is in a healthy abnormal state, it is determined that the target NVME hard disk needs to be removed from the target independent disk redundant array, and the target NVME hard disk is removed from the target independent disk redundant array. Thus, when the target NVME hard disk needs to be removed from the target independent disk redundant array because the target NVME hard disk is in a healthy abnormal state, it can be determined in time according to the asynchronous event data of the health status asynchronous event related to the target NVME hard disk that the target NVME hard disk needs to be removed from the target independent disk redundant array, and the target NVME hard disk can be removed from the target independent disk redundant array in time, and the NVME hard disk provided to the target database can be switched from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array in time.
[0125] In step S304, when it is determined that the target NVME hard disk needs to be removed from the target independent disk redundant array, the target NVME hard disk is removed from the target independent disk redundant array, and the NVME hard disk provided to the target database is switched from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array.
[0126] refer to Figure 4 , which shows a flowchart of an example of managing a hard disk in an embodiment of the present disclosure.
[0127] The target server is a server to which the method for managing a hard disk provided in the embodiment of the present disclosure is applied. The target NVME hard disk belongs to a target independent redundant array of disks. The target independent redundant array of disks is an independent redundant array of disks composed of multiple NVME hard disks on the target server or multiple NVME hard disks outside the target server and communicatively connected to the target server. The module for reporting NVME hard disk asynchronous events and the module for executing the method for managing a hard disk provided in the embodiment of the present disclosure can run on the target server.
[0128] In this example, after the server to which the method for managing a hard disk provided by an embodiment of the present disclosure is applied is powered on, the operating system of the target server enables the NVME hard disk asynchronous event reporting function.
[0129] After receiving asynchronous event data of a target asynchronous event related to a target NVME hard disk, the module executing the method for managing a hard disk provided by an embodiment of the present disclosure controls the target NVME hard disk to be in a read-only state or a non-writable state.
[0130] In this example, the module executing the method for managing a hard disk provided by an embodiment of the present disclosure can determine whether the asynchronous event type of the target asynchronous event is one of multiple preset error types. When it is determined that the asynchronous event type of the target asynchronous event is one of multiple preset error types, the target NVME hard disk is removed from the target independent disk redundant array, and the NVME hard disk provided to the target database is switched from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array.
[0131] In this example, after receiving the asynchronous event data of the target asynchronous event related to the target NVME hard disk, the module executing the method for managing the hard disk provided by the embodiment of the present disclosure can determine whether the asynchronous event type of the target asynchronous event is one of the preset fault types. When it is determined that the asynchronous event type of the target asynchronous event is one of the preset fault types, the target NVME hard disk is removed from the target independent disk redundant array, and the NVME hard disk provided to the target database is switched from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array.
[0132] In this example, when the asynchronous event type of the target asynchronous event in the asynchronous event data of the target asynchronous event related to the target NVME hard disk is the device status type, the module that executes the method for managing the hard disk provided by the embodiment of the present disclosure can determine whether the device status of the target NVME hard disk is a device abnormal state according to the asynchronous event information indicating the status of the target NVME hard disk in the asynchronous event data of the target asynchronous event. When it is determined that the device status of the target NVME hard disk is a device abnormal state, the target NVME hard disk is removed from the target independent disk redundant array, and the NVME hard disk provided to the target database is switched from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array.
[0133] In this example, when the asynchronous event type of the target asynchronous event in the asynchronous event data of the target asynchronous event related to the target NVME hard disk is a health status asynchronous event related to the target NVME hard disk, the module that executes the method for managing the hard disk provided by the embodiment of the present disclosure can determine whether the target NVME hard disk is in a healthy abnormal state according to the health status information of the target NVME hard disk. When it is determined that the target NVME hard disk is in a healthy abnormal state, the target NVME hard disk is removed from the target independent disk redundant array, and the NVME hard disk provided to the target database is switched from the target NVME hard disk to other NVME hard disks in the target independent disk redundant array.
[0134] The embodiments of the present disclosure provide a device for managing a hard disk. The device for managing a hard disk is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "unit" may be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0135] like Figure 5 As shown, the device for managing a hard disk includes:
[0136] The receiving unit 501 is used to receive asynchronous event data of a target asynchronous event related to a target non-volatile memory host controller interface hard disk, wherein the asynchronous event data of the target asynchronous event includes: an asynchronous event type of the target asynchronous event and asynchronous event information of the target asynchronous event, wherein the asynchronous event data of the target asynchronous event is sent by a module for reporting asynchronous events of the non-volatile memory host controller interface hard disk when the asynchronous event reporting function of the non-volatile memory host controller interface hard disk is turned on, and the target non-volatile memory host controller interface hard disk belongs to a target redundant array of independent disks;
[0137] The control unit 502 is used to control the target non-volatile memory host controller interface hard disk to be in a read-only state or a non-writable state;
[0138] The determination unit 503 is used to determine whether it is necessary to remove the target non-volatile memory host controller interface hard disk from the target independent disk redundant array according to the asynchronous event data of the target asynchronous event;
[0139] The removal and switching unit 504 is used to remove the target non-volatile memory host controller interface hard disk from the target independent disk redundant array when it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array, and to switch the NVME hard disk provided to the target database from the target non-volatile memory host controller interface hard disk to other non-volatile memory host controller interface hard disks in the target independent disk redundant array, wherein the other non-volatile memory host controller interface hard disks are non-volatile memory host controller interface hard disks in the target independent disk redundant array except the target non-volatile memory host controller interface hard disk.
[0140] In a possible implementation, the determination unit 503 is further used to determine whether the asynchronous event type of the target asynchronous event is a preset error type among multiple preset error types; when it is determined that the asynchronous event type of the target asynchronous event is a preset error type among multiple preset error types, determine that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array; when it is determined that the asynchronous event type of the target asynchronous event is not a preset error type among multiple preset error types, determine whether the asynchronous event type of the target asynchronous event is a preset fault among multiple preset fault types; when it is determined that the asynchronous event type of the target asynchronous event is a preset fault type among multiple preset fault types, determine that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array. The target non-volatile memory host controller interface hard disk is removed from the target independent disk redundant array; when it is determined that the asynchronous event type of the target asynchronous event is not one of the preset fault types, whether the asynchronous event type of the target asynchronous event is a device status type; when it is determined that the asynchronous event type of the target asynchronous event is a device status type, based on the asynchronous event information indicating the status of the target non-volatile memory host controller interface hard disk in the asynchronous event data of the target asynchronous event, whether the device status of the target non-volatile memory host controller interface hard disk is a device abnormal status; when it is determined that the device status of the target non-volatile memory host controller interface hard disk is a device abnormal status, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array.
[0141] In one possible implementation, the determination unit 503 is further used to determine whether the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk meets a preset condition corresponding to the device abnormal state, and the preset condition corresponding to the device abnormal state is one of the following conditions: the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk is greater than a preset value corresponding to the device abnormal state, and the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk is less than or equal to the preset value corresponding to the device abnormal state; when it is determined that the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk meets the preset condition corresponding to the device abnormal state, it is determined that the device state of the target non-volatile memory host controller interface hard disk is a device abnormal state.
[0142] In a possible implementation, the plurality of preset error types include: an error event type agreed upon by a non-volatile memory host controller interface protocol and a user-defined error event type.
[0143] In one possible implementation, the removal and switching unit 504 is further used to use the target database to send a trigger instruction to a tool for managing a target independent redundant array of disks running on a target server, wherein the target database runs on the target server, and the trigger instruction is used to trigger the tool for managing the target independent redundant array of disks to remove the target non-volatile memory host controller interface hard disk from the target independent redundant array of disks, and to switch the non-volatile memory host controller interface hard disk provided to the target database from the target non-volatile memory host controller interface hard disk to other non-volatile memory host controller interface hard disks in the target independent redundant array of disks.
[0144] In one possible implementation, the receiving unit 501 is further used to receive asynchronous event data of a health status asynchronous event related to a target non-volatile memory host controller interface hard disk sent by the baseboard management controller of the target server, the asynchronous event data of the health status asynchronous event including: a health status event type and health status information of the target non-volatile memory host controller interface hard disk; the determination unit is further used to determine whether the target non-volatile memory host controller interface hard disk is in an abnormal health state based on the health status information of the target non-volatile memory host controller interface hard disk; when it is determined that the target non-volatile memory host controller interface hard disk is in an abnormal health state, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array.
[0145] In one possible implementation, the determination unit 503 is further used to determine whether the information item in the health status information of the target non-volatile memory host controller interface hard disk used for comparison with the preset value corresponding to the healthy abnormal state meets the preset condition corresponding to the healthy abnormal state, and the preset condition corresponding to the healthy abnormal state is one of the following conditions: the information item used for comparison with the preset value corresponding to the healthy abnormal state is greater than the preset value corresponding to the healthy abnormal state, and the information item used for comparison with the preset value corresponding to the healthy abnormal state is less than or equal to the preset value corresponding to the healthy abnormal state; when it is determined that the information item used for comparison with the preset value corresponding to the healthy abnormal state meets the preset condition corresponding to the healthy abnormal state, it is determined that the target non-volatile memory host controller interface hard disk is in a healthy abnormal state.
[0146] In a possible implementation, the device for managing a hard disk further includes:
[0147] The enabling unit is used to enable the non-volatile memory host controller interface hard disk asynchronous event reporting function by using the operating system of the target server after entering the operating system of the target server during the startup of the target server.
[0148] In a possible implementation, the asynchronous event of the target asynchronous event is an asynchronous event agreed upon by the non-volatile memory host controller interface protocol or a user-defined asynchronous event.
[0149] In a possible implementation, the control unit 502 is further configured to not send a write request for the target non-volatile memory host controller interface hard disk to the hard disk controller of the target non-volatile memory host controller interface hard disk.
[0150] In one possible implementation, the target redundant array of independent disks includes one of the following items: multiple non-volatile memory host controller interface hard disks on the target server, and multiple non-volatile memory host controller interface hard disks outside the target server and communicatively connected to the target server.
[0151] In a possible implementation, the device for managing a hard disk further includes:
[0152] The recovery unit is used to control the target non-volatile memory host controller interface hard disk to be in a readable and writable state when it is determined that the target non-volatile memory host controller interface hard disk does not need to be removed from the target independent disk redundant array.
[0153] In this embodiment, the device is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and a memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0154] The further functional description of each of the above units is the same as that of the above corresponding embodiments and will not be repeated here.
[0155] refer to Figure 6 , which shows a schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0156] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0157] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0158] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0159] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0160] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means.
[0161] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0162] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0163] A portion of the embodiments of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0164] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for managing a hard disk, characterized in that: The method comprises: Receive asynchronous event data of a target asynchronous event related to a target non-volatile memory host controller interface hard disk, the asynchronous event data of the target asynchronous event including: an asynchronous event type of the target asynchronous event and asynchronous event information of the target asynchronous event, wherein the asynchronous event data of the target asynchronous event is sent by a module for reporting asynchronous events of the non-volatile memory host controller interface hard disk when an asynchronous event reporting function of the non-volatile memory host controller interface hard disk is enabled, and the target non-volatile memory host controller interface hard disk belongs to a target redundant array of independent disks; Control the target non-volatile memory host controller interface hard disk to be in a read-only state or a non-writable state; Determining whether it is necessary to remove the target non-volatile memory host controller interface hard disk from the target independent disk redundant array according to the asynchronous event data of the target asynchronous event and a plurality of preset types, wherein the plurality of preset types include: a preset error type, a preset fault type, and a device status type; When it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array, the target non-volatile memory host controller interface hard disk is removed from the target independent disk redundant array, and the non-volatile memory host controller interface hard disk provided to the target database is switched from the target non-volatile memory host controller interface hard disk to other non-volatile memory host controller interface hard disks in the target independent disk redundant array, wherein the other non-volatile memory host controller interface hard disks are non-volatile memory host controller interface hard disks in the target independent disk redundant array except the target non-volatile memory host controller interface hard disk.
2. The method according to claim 1, characterized in that Determining whether to remove a target non-volatile memory host controller interface hard disk from a target independent disk redundant array according to asynchronous event data of the target asynchronous event includes: Determine whether the asynchronous event type of the target asynchronous event is one of a plurality of preset error types; When it is determined that the asynchronous event type of the target asynchronous event is one of the preset error types, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array; When it is determined that the asynchronous event type of the target asynchronous event is not one of the preset error types, determining whether the asynchronous event type of the target asynchronous event is one of the preset fault types; When it is determined that the asynchronous event type of the target asynchronous event is one of the preset fault types, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array; When it is determined that the asynchronous event type of the target asynchronous event is not one of the preset fault types, determining whether the asynchronous event type of the target asynchronous event is a device status type; When it is determined that the asynchronous event type of the target asynchronous event is a device status type, determining whether the device status of the target non-volatile memory host controller interface hard disk is a device abnormal status according to asynchronous event information indicating the status of the target non-volatile memory host controller interface hard disk in the asynchronous event data of the target asynchronous event; When it is determined that the device state of the target non-volatile memory host controller interface hard disk is a device abnormal state, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target redundant array of independent disks.
3. The method according to claim 2, characterized in that The step of determining whether the device state of the target non-volatile memory host controller interface hard disk is a device abnormal state according to the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk in the asynchronous event data of the target asynchronous event comprises: Determine whether the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk meets a preset condition corresponding to the device abnormal state, wherein the preset condition corresponding to the device abnormal state is one of the following conditions: the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk is greater than a preset value corresponding to the device abnormal state, and the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk is less than or equal to the preset value corresponding to the device abnormal state; When it is determined that the asynchronous event information indicating the state of the target non-volatile memory host controller interface hard disk meets the preset condition corresponding to the device abnormal state, the device state of the target non-volatile memory host controller interface hard disk is determined to be the device abnormal state.
4. The method according to claim 2, characterized in that: The plurality of preset error types include: error event types agreed upon by the non-volatile memory host controller interface protocol and user-defined error event types.
5. The method according to claim 1, characterized in that When it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array, removing the target non-volatile memory host controller interface hard disk from the target independent disk redundant array, and switching the non-volatile memory host controller interface hard disk provided to the target database from the target non-volatile memory host controller interface hard disk to another non-volatile memory host controller interface hard disk in the target independent disk redundant array include: A target database is used to send a trigger instruction to a tool for managing a target independent redundant array of disks running on a target server, wherein the target database runs on the target server, and the trigger instruction is used to trigger the tool for managing the target independent redundant array of disks to remove a target non-volatile memory host controller interface hard disk from the target independent redundant array of disks, and to switch the non-volatile memory host controller interface hard disk provided to the target database from the target non-volatile memory host controller interface hard disk to other non-volatile memory host controller interface hard disks in the target independent redundant array of disks.
6. The method according to claim 1, characterized in that Receiving asynchronous event data of a target asynchronous event associated with a target non-volatile memory host controller interface hard disk includes: Receiving asynchronous event data of a health status asynchronous event related to a target non-volatile memory host controller interface hard disk sent by a baseboard management controller of a target server, wherein the asynchronous event data of the health status asynchronous event includes: a health status event type and health status information of the target non-volatile memory host controller interface hard disk; and Determining whether to remove a target non-volatile memory host controller interface hard disk from a target independent disk redundant array according to asynchronous event data of the target asynchronous event includes: Determine whether the target non-volatile memory host controller interface hard disk is in an abnormal health state according to the health status information of the target non-volatile memory host controller interface hard disk; When it is determined that the target non-volatile memory host controller interface hard disk is in an abnormal health state, it is determined that the target non-volatile memory host controller interface hard disk needs to be removed from the target independent disk redundant array.
7. The method according to claim 6, characterized in that Determining whether the target non-volatile memory host controller interface hard disk is in an abnormal health state according to the health status information of the target non-volatile memory host controller interface hard disk includes: Determine whether an information item used for comparison with a preset value corresponding to a healthy abnormal state in the health status information of the target non-volatile memory host controller interface hard disk satisfies a preset condition corresponding to the healthy abnormal state, wherein the preset condition corresponding to the healthy abnormal state is one of the following conditions: the information item used for comparison with the preset value corresponding to the healthy abnormal state is greater than the preset value corresponding to the healthy abnormal state, and the information item used for comparison with the preset value corresponding to the healthy abnormal state is less than or equal to the preset value corresponding to the healthy abnormal state; When it is determined that the information item used for comparison with the preset value corresponding to the abnormal health state meets the preset condition corresponding to the abnormal health state, it is determined that the target non-volatile memory host controller interface hard disk is in the abnormal health state.
8. The method according to claim 1, characterized in that The method further comprises: During the startup of the target server, after entering the operating system of the target server, the non-volatile memory host controller interface hard disk asynchronous event reporting function is enabled using the operating system of the target server.
9. The method according to claim 1, characterized in that: The asynchronous event of the target asynchronous event is an asynchronous event agreed upon by the non-volatile memory host controller interface protocol or a user-defined asynchronous event.
10. The method according to claim 1, characterized in that Controlling the target non-volatile memory host controller interface hard disk to be in a read-only state or a non-writable state includes: A write request to a target non-volatile memory host controller interface hard disk is not sent to a hard disk controller of the target non-volatile memory host controller interface hard disk.
11. The method according to claim 1, characterized in that: The target redundant array of independent disks includes one of the following: a plurality of non-volatile memory host controller interface hard disks on the target server, a plurality of non-volatile memory host controller interface hard disks external to the target server and communicatively connected to the target server.
12. The method according to any one of claims 1 to 11, characterized in that The method further comprises: When it is determined that the target non-volatile memory host controller interface hard disk does not need to be removed from the target independent disk redundant array, the target non-volatile memory host controller interface hard disk is controlled to be in a readable and writable state.
13. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 12 by executing the computer instructions.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 12.
15. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Method and device for fault positioning of hard disk on basis of raid card log
CN103207820A
Two-dimensional data processing method and device, and computer readable storage medium
CN108804478A
Hard disk management method, RAID card and server
CN117519585A
Data processing method, system and equipment for solid state disk
CN118426689A
Distributed storage space management method, computing device and storage medium
WO2023138460A1
