Memory management method and device, computer equipment and storage medium
By performing version upgrade and memory management in a multi-control cluster, the insufficient memory caused by excessive memory occupancy of business modules is solved, and the system's business processing capabilities and IO performance are improved.
Patent Information
- Application Number
- CN202411128964.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-13
AI Technical Summary
In a multi-control cluster, some business modules apply for more memory during their work, resulting in less memory available for other business modules, which affects the system's business processing capabilities and IO performance.
By determining the target node among multiple storage nodes, obtaining its configuration information and applied memory, and performing version upgrades based on the upgraded version information, reducing the memory used by the business module, determining the allocable memory and applying for the target memory occupancy for the target business module, Ensure the accuracy and efficiency of memory allocation.
It saves system memory resources, improves the use ability of other modules that consume more memory, improves business processing capabilities and IO performance, and solves the problem of insufficient memory.
Smart Images

Figure CN119127472A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a memory management method, device, computer equipment and storage medium. Background Art
[0002] A multi-controller cluster is a cluster consisting of two or more storage devices. The entire cluster has a common CSM (Control state machine). CSM is the control state machine of each module in the multi-controller cluster to control the management information of the cluster. There are multiple controller nodes in the storage device of the multi-controller cluster. Each controller node has an Agent module (management module). The Agent module is the module terminal of the controller node and is used to control various business modules in the storage device, such as memory application, IO (Input / Output) processing, etc.
[0003] The memory used by business modules such as the volume compression module is allocated by the dynamic memory management module (DMM) according to the configuration. When creating a compressed volume, the compression volume module applies for memory from the dynamic memory management module according to business logic requirements and performs IO processing. Business modules such as the volume compression module may apply for more memory during operation, resulting in less memory available for other business modules.
[0004] Therefore, the related art has the problem that some business modules apply for more memory during the working process, resulting in less memory available for other business modules. Summary of the invention
[0005] In view of this, the present invention provides a memory management method, apparatus, computer device and storage medium to solve the problem that some business modules apply for more memory during operation, resulting in less memory available for other business modules.
[0006] In a first aspect, the present invention provides a memory management method, comprising:
[0007] Get the upgrade version information;
[0008] Determine a target node among multiple storage nodes, obtain configuration information of the target node and applied memory of a business module in the target node, and perform version upgrade on the target node according to the upgrade version information, wherein the multiple storage nodes are included in a storage device;
[0009] Restore the configuration of the business module in the upgraded target node according to the configuration information to obtain the target business module;
[0010] Determine the allocatable memory of the target business module, and use the smaller memory between the applied memory and the allocatable memory as the target occupied memory of the target business module;
[0011] Apply for target memory usage for the target business module.
[0012] The memory management method provided in this embodiment determines the target node among multiple storage nodes, obtains the configuration information of the target node and the applied memory of the business module in the target node, and upgrades the version of the target node according to the upgrade version information, thereby reducing the memory used by the business module through online upgrades. The smaller memory among the applied memory and the allocatable memory is used as the target occupied memory of the target business module, and the target occupied memory is applied for the target business module, and the comparison with the memory information that can be used by the business modules supported by the current system is increased to facilitate correct memory allocation. More memory can be saved for use by other modules that consume more memory, thereby improving business processing capabilities and IO performance. The problem that some business modules apply for more memory during the working process is solved, resulting in less memory available for other business modules.
[0013] In some optional implementations, after applying for target occupied memory for the target business module, the method further includes:
[0014] In the case where the target business module no longer executes the target business, first memory release information is generated according to the target occupied memory, and the first memory release information is written to the control module of the target node, wherein the first memory release information is used to release the target occupied memory, and the control module is used to apply for the target occupied memory for the target business module or release the target occupied memory;
[0015] Second memory release information is generated according to the applied memory, and the second memory release information is written into the control state machine of the multi-control cluster to instruct the control state machine to release the memory.
[0016] In this embodiment, when the target business module no longer executes the target business, the memory occupied by the target business module is released in time to save the memory resources of the multi-control cluster. In addition, when releasing the memory occupied by the business module, the memory of the business module of the node is not only released based on the configuration information saved by the CSM end, but is released based on the memory configuration information actually applied by the business module of the target node, so as to prevent the error of releasing the memory larger than the currently applied memory when releasing the memory.
[0017] In some optional implementations, determining the allocatable memory of the target business module and using the smaller memory between the applied memory and the allocatable memory as the target occupied memory of the target business module includes:
[0018] Determine whether the target business module is configured with the target business;
[0019] When the target service module is not configured with the target service, the size of the allocatable memory is set to a preset value, wherein the preset value is smaller than the size of the applied memory;
[0020] Allocatable memory is used as target occupied memory;
[0021] When the target business module is configured with the target business, the maximum memory value that can be used by the target business module is determined according to the control module, and the allocatable memory is determined according to the maximum memory value;
[0022] Compare the size of the requested memory with the size of the allocatable memory;
[0023] If the size of the applied memory is equal to the size of the allocatable memory, the applied memory or the allocatable memory is used as the target occupied memory;
[0024] If the size of the allocatable memory is smaller than the size of the requested memory, the allocatable memory will be used as the target occupied memory.
[0025] In this embodiment, if the target business module is not configured with the target business, the allocatable memory with a value smaller than the applied memory is used as the target occupied memory, the memory of the target business module is reduced, and the system memory resources are saved. If the target business module is configured with the target business, the smaller memory between the applied memory and the allocatable memory is used as the target occupied memory of the target business module, and the target occupied memory is applied for the target business module, and the comparison with the memory information that can be used by the business modules supported by the current system is increased to facilitate the correct memory allocation.
[0026] In some optional implementations, determining a target node among multiple storage nodes, acquiring configuration information of the target node and applied memory of a business module in the target node, and performing a version upgrade on the target node according to the upgrade version information includes:
[0027] Among the multiple storage nodes, a storage node that does not perform configuration operations is used as a target node;
[0028] Obtaining configuration information of the target node and applied memory of the business module, generating non-volatile data, and saving the non-volatile data to a system hard disk in a storage device, wherein the non-volatile data includes the configuration information and first memory information of the applied memory;
[0029] Start the control module of the target node, and use the control module to upgrade the version of the target node according to the upgrade version information.
[0030] In some optional implementations, restoring the configuration of the service module in the upgraded target node according to the configuration information to obtain the target service module includes:
[0031] After the target node is upgraded, the control module is instructed to obtain configuration information from the non-volatile data of the system hard disk;
[0032] The upgraded target node is initialized, and the configuration of the service module in the upgraded target node is restored according to the configuration information to obtain the target service module.
[0033] In this embodiment, the control module obtains configuration information from the non-volatile data of the system hard disk, initializes the target node, and restores the configuration of the business module in the upgraded target node according to the configuration information, so that the configuration of the business module is the same before and after the upgrade, and the user's usage habits are not changed.
[0034] In some optional implementations, after performing a version upgrade on the target node according to the upgrade version information, the method further includes:
[0035] Sending the upgrade version information to the control state machine, instructing the control state machine to upgrade;
[0036] After the control state machine is upgraded, the configuration information and the first memory information of the applied memory are saved to the upgraded control state machine.
[0037] In this embodiment, the upgrade version information is sent to the control state machine, instructing the control state machine to upgrade, and completing the online upgrade of the entire multi-control cluster, so that the memory of the business module in the multi-control cluster is reduced without affecting the performance of the multi-control cluster. In addition, the configuration information and the first memory information of the applied memory are saved to the upgraded control state machine, which is convenient for comparison with the new allocatable memory when the business module memory is subsequently reduced, so as to facilitate correct memory allocation.
[0038] In some optional embodiments, the method further comprises:
[0039] After releasing the target occupied memory, if the target service module executes the target service again, instruct the control module to apply for the target occupied memory for the target service module again, and send the second memory information of the target occupied memory saved by the control module to the control state machine;
[0040] The control state machine is configured to: after receiving the second memory information, allocate a target occupied memory to the target service module.
[0041] In this embodiment, after releasing the target occupied memory, if the target business module executes the target business again, the target occupied memory is reallocated to the target business module, which does not affect the target business module's execution of the target business and avoids allocating too much memory to the target business module, resulting in less memory available for other business modules.
[0042] In a second aspect, the present invention provides a memory management device, comprising:
[0043] An acquisition unit, used to acquire upgrade version information;
[0044] A version upgrade unit, used to determine a target node among multiple storage nodes, obtain configuration information of the target node and applied memory of a business module in the target node, and perform version upgrade on the target node according to the upgrade version information, wherein the multiple storage nodes are included in a storage device;
[0045] A configuration recovery unit, used to recover the configuration of the service module in the upgraded target node according to the configuration information to obtain the target service module;
[0046] A determination unit, used for determining the allocatable memory of the target business module, and taking the smaller memory between the applied memory and the allocatable memory as the target occupied memory of the target business module;
[0047] The application unit is used to apply for the target occupied memory for the target business module.
[0048] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the memory management method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0049] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the memory management method of the first aspect or any corresponding embodiment thereof.
[0050] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the memory management method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 is a flowchart of a memory management method according to an embodiment of the present invention;
[0053] Figure 2 is a flow chart of a method for reducing dynamic memory of a service module through online upgrade according to an embodiment of the present invention;
[0054] Figure 3 is a structural block diagram of a memory management device according to an embodiment of the present invention;
[0055] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0057] A multi-controller cluster refers to a cluster composed of two or more dual-controller or quad-controller storage devices. A cluster refers to a group (or several) of independent computers that form a larger computer service system using a high-speed communication network. Each cluster node (i.e., each computer in the cluster) is an independent server that runs its own service. Each storage device has two or four controllers, and each controller is a storage node. The memory sizes of the storage devices that make up the cluster can be different, but the memory of all controllers that make up an IOGROUP (IOGROUP Input / Output group) must be the same. For example, an eight-controller cluster consists of four dual-controller storage devices. Storage devices 1 and 2 form IOGROUP1 of the cluster, and storage devices 3 and 4 form IOGROUP2. Then the memory of storage devices 1 and 2 must be the same, with a memory specification of 512GB, and the memory of storage devices 3 and 4 must be the same, with a memory specification of 256GB, but the memory of the two IOGROUPs can be different. The PLMM (platform memory management) of the multi-controller cluster applies for the memory space required by the entire storage node to process storage services from the operating system, manages it, and allocates memory according to the needs of each module. Each controller node of the storage device in the multi-controller cluster has an Agent module (management module) to control the logic of each business module on the storage node, such as memory application, IO processing, information interaction with the CSM end, and communication between nodes.
[0058] For example, a business module is a compressed volume business module. A compressed volume is a data volume that uses a hardware compression card to compress data. The memory used by the metadata management module of the compressed volume is allocated by the dynamic memory management module from the platform management module according to the configuration. When creating a compressed volume, the compressed volume module applies for memory from the dynamic memory management module according to the business logic requirements and performs IO processing. The current process of online upgrading of a multi-control cluster storage system includes: the storage node containing the Agent module is called the Agent end. The Agent end sets the required memory size based on the memory information saved by the CSM end, and keeps it consistent with the CSM end information; the Agent end applies for the corresponding size of memory from the dynamic memory management module based on the acquired memory size information and uses it. After the configuration is completed, IO processing begins to facilitate subsequent business takeover and allow other nodes to be upgraded. After all node Agent end versions are upgraded, the CSM end version of the cluster is upgraded to finally complete the online upgrade of the cluster storage system. However, in the above process, both the Agent and CSM sides are restoring according to the existing configuration information without making any modifications. If the business module occupies too much memory before the upgrade, it will still occupy too much memory after the upgrade, resulting in insufficient memory for other business modules and inability to carry out storage business processing normally.
[0059] Based on the above content, an embodiment of the present invention provides a memory management method, which determines a target node among multiple storage nodes, obtains the configuration information of the target node and the applied memory of the business module in the target node, and upgrades the version of the target node according to the upgrade version information, thereby reducing the memory used by the business module through online upgrades. The smaller memory in the applied memory and the allocatable memory is used as the target occupied memory of the target business module, and the target occupied memory is applied for the target business module. Not only is the configuration information obtained from the non-volatile data (harden_data) for use, but a comparison with the memory information that can be used by the volume compression module supported by the current system is added to facilitate correct configuration updates and memory allocation. This can save more memory for use by other modules that consume more memory, improve business processing capabilities, and improve IO performance.
[0060] According to an embodiment of the present invention, a memory management embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer device with data processing capabilities, such as a computer, a server, etc., and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0061] In this embodiment, a memory management method is provided, which can be used in the above-mentioned computer device. Figure 1is a flowchart of a memory management method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0062] Step S101, obtaining upgrade version information.
[0063] Specifically, before the upgrade, the business module applied for more memory, resulting in less memory available for other modules. Through online upgrade, the memory used by the volume compression module is reduced. This embodiment is explained by taking the business module as a compressed volume business module as an example. Before the upgrade, a multi-control cluster containing multiple storage nodes has been created, and the multi-control cluster is configured with a compressed volume business module and mapped to a host, and users can use it normally.
[0064] Prepare the version to be upgraded. This version also needs to support the compressed volume function. This is convenient for the user to use the same version information before and after the upgrade without changing the user's usage habits. The upgrade version information is uploaded to the multi-controller cluster system. The storage devices in the multi-controller cluster obtain the upgrade version information and start the version upgrade. In addition, the upgrade version information also includes the upgrade strategy of the multi-controller cluster storage system.
[0065] Step S102, determining a target node among multiple storage nodes, obtaining configuration information of the target node and applied memory of a business module in the target node, and performing version upgrade on the target node according to the upgrade version information, wherein the multiple storage nodes are included in a storage device.
[0066] Specifically, a non-configuration storage node is selected as the target node from multiple storage nodes in the multi-controller cluster. When the multi-controller cluster is created, a storage node is selected as the master node of the cluster. Configuration operations can be performed on the cluster on this storage node. This storage node is the configuration node, and storage nodes other than the configuration node are non-configuration nodes.
[0067] Before upgrading the target node, generate non-volatile data (harden_data), obtain the configuration information of the target node and the applied memory of the business module in the target node for non-volatile storage. Start the Agent module (control module) of the target node to start the node version upgrade and replace the old version on the node.
[0068] Step S103: restore the configuration of the service module in the upgraded target node according to the configuration information to obtain the target service module.
[0069] Specifically, after the target node is upgraded, the Agent module on the target node is started, the business modules in the target node are initialized, and the configuration information in harden_data is used to restore the configuration of each business module to obtain the target business module.
[0070] Step S104, determining the allocatable memory of the target business module, and taking the smaller memory between the applied memory and the allocatable memory as the target occupied memory of the target business module.
[0071] Specifically, when initializing the business module, this embodiment adds a check on the memory information used by the compressed volume function, resets the memory information used by the volume compression module, and determines the allocatable memory of the target business module. The allocatable memory is the maximum memory that the target business module can use or the maximum memory that the multi-control cluster storage system allows to be allocated to the target business module. For example, the allocatable memory is 15GB. The applied memory of the target business module before the upgrade is obtained from harden_data. For example, the applied memory is 20GB. The smaller memory between the applied memory and the allocatable memory is used as the target occupied memory of the target business module. For example, if the allocatable memory is 15GB and the applied memory is 20GB, the target occupied memory is 15GB.
[0072] Step S105, applying for target occupied memory for the target business module.
[0073] Specifically, when the target node is upgraded, it will apply to the dynamic memory management module (DMM) for the target business module to occupy the target memory, and the DMM will allocate the target memory to the target business module. After the memory is completed, the target business module will take over the target business to be processed on the target node.
[0074] In addition, the multi-controller cluster will select other non-upgraded nodes in the cluster for upgrading according to the upgrade strategy in the upgrade version information until all nodes in the cluster are upgraded. After all nodes are upgraded, the memory requested and used by the Agent-side volume compression module on the node is the maximum memory value that the volume compression module can use after the reduction.
[0075] The memory management method provided in this embodiment determines the target node among multiple storage nodes, obtains the configuration information of the target node and the applied memory of the business module in the target node, and upgrades the version of the target node according to the upgrade version information, thereby reducing the memory used by the business module through online upgrades. The smaller memory among the applied memory and the allocatable memory is used as the target occupied memory of the target business module, and the target occupied memory is applied for the target business module, and the comparison with the memory information that can be used by the business modules supported by the current system is increased to facilitate correct memory allocation. More memory can be saved for use by other modules that consume more memory, thereby improving business processing capabilities and IO performance. The problem that some business modules apply for more memory during the working process is solved, resulting in less memory available for other business modules.
[0076] In some optional implementations, after applying for target occupied memory for the target business module, the method further includes:
[0077] In the case where the target business module no longer executes the target business, first memory release information is generated according to the target occupied memory, and the first memory release information is written to the control module of the target node, wherein the first memory release information is used to release the target occupied memory, and the control module is used to apply for the target occupied memory for the target business module or release the target occupied memory;
[0078] Second memory release information is generated according to the applied memory, and the second memory release information is written into the control state machine of the multi-control cluster to instruct the control state machine to release the memory.
[0079] Specifically, when the target service module no longer executes the target service, for example, when the volume compression module service in the cluster is no longer in use, after deleting all compressed volumes, the volume compression service module will release the occupied memory.
[0080] At the Agent module (control module) end of the target node, the Agent module is used to apply for the target occupied memory or release the target occupied memory for the target business module. When the business module releases the memory, it will release the memory according to the memory configuration information after the online upgrade, that is, generate the first memory release information according to the target occupied memory. For example: the target occupied memory is 15GB, and the first memory release information is generated according to 15GB. The locate_buffer_size in the Agent module is modified to 0 through the first memory release information to complete the memory release. The first memory release information is written to the Agent module of the target node, and the Agent module releases the memory of the business module to the dynamic memory management module.
[0081] After the business modules of each storage node in the multi-control cluster release the memory, the CSM modifies the configuration information according to the memory configuration information before the version upgrade, that is, generates the second memory release information based on the applied memory. For example, if the applied memory is 20GB, the first memory release information is generated based on 20GB. The locate_buffer_size in the Agent module is modified to 0 through the second memory release information to complete the memory release. After that, the CSM modifies the configuration information of the dynamic memory management module. The configuration information in the dynamic memory management module records the size of the memory that has been applied for, how much memory is left to apply, the maximum amount of memory that can be applied for, the starting address of the applied memory, and other information.
[0082] In this embodiment, when the target business module no longer executes the target business, the memory occupied by the target business module is released in time to save the memory resources of the multi-control cluster. In addition, when releasing the memory occupied by the business module, the memory of the agent-side business module of the node is not only released based on the configuration information saved by the CSM end, but is released based on the memory configuration information actually applied for by the agent-side business module of the node, so as to prevent the error of releasing the memory larger than the currently applied memory when releasing the memory.
[0083] In some optional implementations, determining the allocatable memory of the target business module and using the smaller memory between the applied memory and the allocatable memory as the target occupied memory of the target business module includes:
[0084] Determine whether the target business module is configured with the target business;
[0085] When the target service module is not configured with the target service, the size of the allocatable memory is set to a preset value, wherein the preset value is smaller than the size of the applied memory;
[0086] Allocatable memory is used as target occupied memory;
[0087] When the target business module is configured with the target business, the maximum memory value that can be used by the target business module is determined according to the control module, and the allocatable memory is determined according to the maximum memory value;
[0088] Compare the size of the requested memory with the size of the allocatable memory;
[0089] If the size of the applied memory is equal to the size of the allocatable memory, the applied memory or the allocatable memory is used as the target occupied memory;
[0090] If the size of the allocatable memory is smaller than the size of the requested memory, the allocatable memory will be used as the target occupied memory.
[0091] Specifically, when initializing the business module, this embodiment adds a check on the memory information used by the compression volume function, resets the memory information used by the business module, and checks whether the target business module has been configured with the target business before. Depending on whether the target business is configured, the initialization information of the target business module is treated differently. For example, if the target business module is configured with the target business, the memory information used by the target business module is set to the memory size to be used after the upgrade and the target occupied memory during initialization. If the target business module is not configured with the target business, the memory to be used by the target business module is configured to be 0. The process specifically includes:
[0092] Determine whether the target service module is configured with the target service. For example, if the target service module is a volume compression service module, determine whether the volume compression service module is configured with the volume compression service.
[0093] When the target service module is not configured with the target service, the size of the allocatable memory is set to a preset value, wherein the preset value is smaller than the size of the applied memory, and the preset value is, for example, 0 or other smaller values.
[0094] The size of the allocatable memory is a preset value, which is smaller than the size of the applied memory. Therefore, the allocatable memory is the smaller of the applied memory and the allocatable memory. The allocatable memory is used as the target occupied memory. When the preset value is 0, there is no need to apply for memory for the target business module.
[0095] When the target business module is configured with the target business, determine the allocatable memory of the target business module. The allocatable memory is the maximum memory that the target business module can use or the maximum memory that the multi-control cluster storage system allows to allocate to the target business module. Determine the allocatable memory of the target business module based on the maximum value of the memory that the target business module can use. Apply for temporary variables to record the allocatable memory, for example: max_buffer_size_new = 15GB, the maximum memory information that the reduced volume compression module can use. After the online upgrade, the maximum memory value allowed by the system for the volume compression module will become this value.
[0096] The memory information of the occupied memory is recorded in the Agent module of the target node and the CSM of the multi-control cluster as non-volatile data (harden_data). From harden_data, read the applied memory of the target business module before the online upgrade. Apply for temporary variables to record the allocable memory, for example: allocated_buffer_size = 20GB, indicating that the size of the applied memory is 20GB.
[0097] Compare the size of requested memory with the size of available memory.
[0098] If the size of the applied memory is equal to the size of the allocatable memory, it means that the memory allocated to the target business module is the same before and after the multi-controller cluster storage system is upgraded. The applied memory or allocatable memory is used as the target occupied memory. Memory can be applied for and allocated from the dynamic memory management module (DMM) according to the target occupied memory. No other adaptation is required.
[0099] If the size of the allocatable memory is smaller than the size of the applied memory, the allocatable memory is used as the target occupied memory, the memory information that can be configured by the volume compression module is reset according to the target occupied memory, and the target occupied memory is applied for the target business module from the dynamic memory management module (DMM).
[0100] In this embodiment, if the target business module is not configured with the target business, the allocatable memory with a value smaller than the applied memory is used as the target occupied memory, the memory of the target business module is reduced, and the system memory resources are saved. If the target business module is configured with the target business, the smaller memory between the applied memory and the allocatable memory is used as the target occupied memory of the target business module, and the target occupied memory is applied for the target business module, and the comparison with the memory information that can be used by the business modules supported by the current system is increased to facilitate the correct memory allocation.
[0101] In some optional implementations, determining a target node among multiple storage nodes, acquiring configuration information of the target node and applied memory of a business module in the target node, and performing a version upgrade on the target node according to the upgrade version information includes:
[0102] Among the multiple storage nodes, a storage node that does not perform configuration operations is used as a target node;
[0103] Obtaining configuration information of the target node and applied memory of the business module, generating non-volatile data, and saving the non-volatile data to a system hard disk in a storage device, wherein the non-volatile data includes the configuration information and first memory information of the applied memory;
[0104] Start the control module of the target node, and use the control module to upgrade the version of the target node according to the upgrade version information.
[0105] Specifically, when a multi-controller cluster is created, a storage node is selected as the master node of the cluster. Configuration operations can be performed on this storage node. This storage node is the configuration node, and storage nodes other than configuration nodes are non-configuration nodes. Storage nodes that do not perform configuration operations are non-configuration storage nodes. A non-configuration storage node is randomly selected from multiple storage nodes as the target node.
[0106] Before upgrading the target node, obtain the configuration information of the target node and the applied memory of the business module, generate non-volatile data (harden_data) including the configuration information and the first memory information of the applied memory, save the non-volatile data to the system hard disk in the storage device, save the configuration information and the first memory information of the applied memory in a non-volatile manner, and the above information will not be lost even if the multi-control cluster loses power.
[0107] The Agent module (control module) of the target node is started, and the control module is used to upgrade the target node according to the upgrade version information, thereby replacing the old version on the node.
[0108] In some optional implementations, restoring the configuration of the service module in the upgraded target node according to the configuration information to obtain the target service module includes:
[0109] After the target node is upgraded, the control module is instructed to obtain configuration information from the non-volatile data of the system hard disk;
[0110] The upgraded target node is initialized, and the configuration of the service module in the upgraded target node is restored according to the configuration information to obtain the target service module.
[0111] Specifically, after the target node is upgraded, the Agent module (control module) on the target node is started. The Agent module obtains configuration information from non-volatile data of the system hard disk.
[0112] When the Agent module of the target node starts to start, the business module in the target node is initialized, and the configuration information is read from the previously saved harden_data. The configuration of the business module in the upgraded target node is restored according to the configuration information to obtain the target business module.
[0113] In this embodiment, the control module obtains configuration information from the non-volatile data of the system hard disk, initializes the target node, and restores the configuration of the business module in the upgraded target node according to the configuration information, so that the configuration of the business module is the same before and after the upgrade, and the user's usage habits are not changed.
[0114] In some optional implementations, after performing a version upgrade on the target node according to the upgrade version information, the method further includes:
[0115] Sending the upgrade version information to the control state machine, instructing the control state machine to upgrade;
[0116] After the control state machine is upgraded, the configuration information and the first memory information of the applied memory are saved to the upgraded control state machine.
[0117] Specifically, when the storage nodes of all storage devices in the multi-control cluster are upgraded, the upgrade version information is sent to the control state machine (CSM), the upgrade of the CSM in the multi-control cluster is started, and then the online upgrade of the entire multi-control cluster can be completed.
[0118] In addition, the memory configuration information on the CSM side still retains the configuration information before the online upgrade. Specifically, it includes: saving the configuration information and the first memory information of the applied memory to the upgraded control state machine. This is convenient for comparing the new allocatable memory with the information saved on the CSM side during the subsequent online upgrade, and the memory configuration size saved by the CSM is not allowed to be exceeded.
[0119] In this embodiment, the upgrade version information is sent to the control state machine, instructing the control state machine to upgrade, and completing the online upgrade of the entire multi-control cluster, so that the memory of the business module in the multi-control cluster is reduced without affecting the performance of the multi-control cluster. In addition, the configuration information and the first memory information of the applied memory are saved to the upgraded control state machine, which is convenient for comparison with the new allocatable memory when the business module memory is subsequently reduced, so as to facilitate correct memory allocation.
[0120] In some optional implementations, a method for online software upgrade of a multi-control cluster is provided, the method comprising steps A1 to A4.
[0121] Step A1: According to the received upgrade version information, a software package for upgrading the multi-control cluster is obtained, where the software package includes a software main program and a control state machine CSM that can be unloaded and loaded during runtime.
[0122] Specifically, in this embodiment, the configuration node of the multi-control cluster obtains the latest version of the software package according to the upgrade version information. The software package includes the latest version of the software main program and a CSM that can be unloaded and loaded during runtime.
[0123] Step A2: Send the software package to each storage node in the multi-controller cluster.
[0124] Step A3, upgrading the main software program of one of the storage nodes in each pair of redundant storage nodes. After one storage node in each pair of redundant storage nodes completes the main software program upgrade, the main software program of the other storage node in each pair of redundant storage nodes is upgraded.
[0125] Specifically, in order to ensure that I / O requests and business processing are not interrupted when the software main program of the storage node is upgraded, the present application does not upgrade the software main program in each pair of redundant storage nodes at the same time, but upgrades the software main program of one of the storage nodes in each pair of redundant storage nodes. After one storage node in each pair of redundant storage nodes completes the software main program upgrade, the software main program of the other storage node in each pair of redundant storage nodes is upgraded to ensure that there is always a software main program in each pair of redundant storage nodes that is processing business and IO requests normally. In each pair of redundant storage nodes, the selected storage node exits the storage node cluster and stops IO processing, and is automatically taken over by another storage node that is redundant with it, exits the IO processing process, replaces the software main program and restarts the IO processing process, and runs the new version of the software main program. The old version of CSM is still used in this process.
[0126] Step A4, the control event manager sends the CSM update event to each storage node after the software main program upgrade is completed based on the distributed consistency algorithm, so as to update the CSM.
[0127] Specifically, the distributed consistency algorithm ensures the consistency of CSM replacement, including uninstalling the old version, loading the new version and other actions, thereby ensuring the consistency of the status of all storage nodes during the upgrade process. Considering that in actual applications, the event manager will be affected by factors such as the network when sending CSM update events to each storage node, the time when each storage node receives the CSM update event may be inconsistent, which in turn leads to inconsistent CSM update time, and ultimately may cause inconsistency in the status of all storage nodes. After the software main program of all storage nodes has been upgraded, the configuration node will send the CSM update event to the event manager, and the event manager will send the CSM update event to each storage node based on the distributed consistency algorithm.
[0128] In this embodiment, the present application divides the storage node software into a software main program and a CSM according to functions. The present application first upgrades the software main program of one of the storage nodes in each pair of redundant storage nodes. After one storage node in each pair of redundant storage nodes completes the software main program upgrade, the software main program is upgraded for the other storage node in each pair of redundant storage nodes, ensuring that there is always a software main program in each pair of redundant storage nodes that performs business processing and I / O request processing normally; and then the event manager is controlled to send the CSM update event to each storage node that has completed the software main program upgrade based on the distributed consistency algorithm, so that each storage node updates the CSM, ensuring the consistency of the CSM update, and further ensuring the consistency of the status of all storage nodes during the upgrade process.
[0129] In some alternative embodiments, the method further includes:
[0130] After releasing the target occupied memory, if the target service module executes the target service again, instruct the control module to apply for the target occupied memory for the target service module again, and send the second memory information of the target occupied memory saved by the control module to the control state machine;
[0131] The control state machine is configured to: after receiving the second memory information, allocate the target occupied memory for the target service module.
[0132] Specifically, taking the target service module as the volume compression service module and the target service as the volume compression service as an example for illustration.
[0133] After the volume compression service module releases the target occupied memory, when the volume compression service is reconfigured in the multi-control cluster, that is, when the target service module executes the target service again, both the CSM of the multi-control cluster and the Agent module of the target node apply for memory for the target service module according to the memory configuration information after version upgrade, that is, the target occupied memory. Specifically, it includes: sending the second memory information of the target occupied memory saved by the control module to the CSM, and after receiving the second memory information, the CSM controls the dynamic memory management module (DMM) to allocate the target occupied memory for the target service module.
[0134] In this embodiment, after releasing the target occupied memory, if the target service module executes the target service again, re-allocate the target occupied memory for the target service module, which does not affect the execution of the target service by the target service module, and avoids allocating too much memory for the target service module, resulting in less memory available for other service modules.
[0135] In some alternative embodiments, a method for reducing the dynamic memory of a service module through online upgrade is provided. This method can solve the same technical problems and produce the same technical effects as those in steps S101 to S105, as Figure 2 shown, including:
[0136] Upgrade starts; the Agent side saves the pre-upgrade configuration information; starts online upgrading the version of the Agent side node; after the upgrade, the node starts and the service module is initialized; obtains the configured memory information (PageInfo1) from the information saved before the upgrade; obtains the available memory information (PageInfo2) after the upgrade; determines whether PageInfo2 < PageInfo1 is satisfied. If satisfied, modify the applied configuration information to PageInfo2. If not satisfied, keep the applied configuration information as PageInfo1; apply for new memory; end.
[0137] In this embodiment, when the Agent-side volume compression module node is online and initialized, the calculation method of the dynamic memory to be configured is not only to obtain the configuration information from the non-volatile memory (harden_data), but also to increase the comparison with the memory information that can be used by the volume compression module supported by the current system, so as to facilitate the correct configuration update and memory allocation. It can save more memory for other modules that consume more memory, improve business processing capabilities, and improve IO performance.
[0138] In this embodiment, a memory management device is also provided, which 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 "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0139] This embodiment provides a memory management device, such as Figure 3 As shown, including:
[0140] The acquisition unit 301 is used to acquire the upgrade version information;
[0141] A version upgrade unit 302 is used to determine a target node from a plurality of storage nodes, obtain configuration information of the target node and applied memory of a business module in the target node, and perform a version upgrade on the target node according to the upgrade version information, wherein the plurality of storage nodes are included in a storage device;
[0142] A configuration recovery unit 303, configured to recover the configuration of the service module in the upgraded target node according to the configuration information to obtain the target service module;
[0143] A determination unit 304 is used to determine the allocatable memory of the target business module, and use the smaller memory between the applied memory and the allocatable memory as the target occupied memory of the target business module;
[0144] The application unit 305 is used to apply for target occupied memory for the target business module.
[0145] In some optional implementations, after applying for a target occupied memory for a target service module, the device is used to:
[0146] In the case where the target business module no longer executes the target business, first memory release information is generated according to the target occupied memory, and the first memory release information is written to the control module of the target node, wherein the first memory release information is used to release the target occupied memory, and the control module is used to apply for the target occupied memory for the target business module or release the target occupied memory;
[0147] Second memory release information is generated according to the applied memory, and the second memory release information is written into the control state machine of the multi-control cluster to instruct the control state machine to release the memory.
[0148] In some optional implementations, the determining unit 304 determines the allocatable memory of the target business module, and uses the smaller memory between the applied memory and the allocatable memory as the target occupied memory of the target business module, including:
[0149] Determine whether the target business module is configured with the target business;
[0150] When the target service module is not configured with the target service, the size of the allocatable memory is set to a preset value, wherein the preset value is smaller than the size of the applied memory;
[0151] Allocatable memory is used as target occupied memory;
[0152] When the target business module is configured with the target business, the maximum memory value that can be used by the target business module is determined according to the control module, and the allocatable memory is determined according to the maximum memory value;
[0153] Compare the size of the requested memory with the size of the allocatable memory;
[0154] If the size of the applied memory is equal to the size of the allocatable memory, the applied memory or the allocatable memory is used as the target occupied memory;
[0155] If the size of the allocatable memory is smaller than the size of the requested memory, the allocatable memory will be used as the target occupied memory.
[0156] In some optional implementations, the version upgrade unit 302 determines a target node from a plurality of storage nodes, obtains configuration information of the target node and applied memory of a business module in the target node, and performs a version upgrade on the target node according to the upgrade version information, including:
[0157] Among the multiple storage nodes, a storage node that does not perform configuration operations is used as a target node;
[0158] Obtaining configuration information of the target node and applied memory of the business module, generating non-volatile data, and saving the non-volatile data to a system hard disk in a storage device, wherein the non-volatile data includes the configuration information and first memory information of the applied memory;
[0159] Start the control module of the target node, and use the control module to upgrade the version of the target node according to the upgrade version information.
[0160] In some optional implementations, the configuration recovery unit 303 performs configuration recovery on the service module in the upgraded target node according to the configuration information to obtain the target service module, including:
[0161] After the target node is upgraded, the control module is instructed to obtain configuration information from the non-volatile data of the system hard disk;
[0162] The upgraded target node is initialized, and the configuration of the service module in the upgraded target node is restored according to the configuration information to obtain the target service module.
[0163] In some optional implementations, after performing version upgrade on the target node according to the upgrade version information, the device is further configured to:
[0164] Sending the upgrade version information to the control state machine, instructing the control state machine to upgrade;
[0165] After the control state machine is upgraded, the configuration information and the first memory information of the applied memory are saved to the upgraded control state machine.
[0166] In some optional embodiments, the device is also used for:
[0167] After releasing the target occupied memory, if the target service module executes the target service again, instruct the control module to apply for the target occupied memory for the target service module again, and send the second memory information of the target occupied memory saved by the control module to the control state machine;
[0168] The control state machine is configured to: after receiving the second memory information, allocate a target occupied memory to the target service module.
[0169] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0170] The memory management device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0171] The embodiment of the present invention also provides a computer device having the above Figure 3 The memory management device shown.
[0172] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4As shown, 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. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the 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 some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0173] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include 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.
[0174] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0175] 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.
[0176] 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.
[0177] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0178] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention 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 through a network download, 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 hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. 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.
[0179] A part of the present invention 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 the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the 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.
[0180] Although the embodiments of the present invention 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 invention, and such modifications and variations are all within the scope defined in this application.
Claims
1. A memory management method, characterized in that: The method comprises: Get the upgrade version information; Determine a target node from a plurality of storage nodes, obtain configuration information of the target node and applied memory of a service module in the target node, and perform a version upgrade on the target node according to the upgrade version information, wherein the plurality of storage nodes are included in a storage device; Recover the configuration of the service module in the upgraded target node according to the configuration information to obtain the target service module; Determine the allocatable memory of the target business module, and use the smaller memory between the applied memory and the allocatable memory as the target occupied memory of the target business module; Apply for the target occupied memory for the target business module.
2. The method according to claim 1, characterized in that After applying for the target occupied memory for the target service module, the method further includes: In a case where the target service module no longer executes the target service, first memory release information is generated according to the target occupied memory, and the first memory release information is written into the control module of the target node, wherein the first memory release information is used to release the target occupied memory, and the control module is used to apply for the target occupied memory for the target service module or release the target occupied memory; Second memory release information is generated according to the applied memory, and the second memory release information is written into a control state machine of the multi-control cluster to instruct the control state machine to release the memory.
3. The method according to claim 1, characterized in that: The determining of the allocatable memory of the target business module and using the smaller memory of the applied memory and the allocatable memory as the target occupied memory of the target business module includes: Determining whether the target service module is configured with the target service; In the case where the target service module is not configured with the target service, the size of the allocatable memory is set to a preset value, wherein the preset value is smaller than the size of the applied memory; Using the allocatable memory as the target occupied memory; In the case where the target service module configures the target service, determining the maximum value of the memory that can be used by the target service module according to the control module, and determining the allocatable memory according to the maximum value of the memory; Compare the size of the applied memory with the size of the allocatable memory; If the size of the applied memory is equal to the size of the allocatable memory, taking the applied memory or the allocatable memory as the target occupied memory; If the size of the allocatable memory is smaller than the size of the applied memory, the allocatable memory is used as the target occupied memory.
4. The method according to claim 1, characterized in that: The determining of a target node from a plurality of storage nodes, acquiring configuration information of the target node and applied memory of a business module in the target node, and performing a version upgrade on the target node according to the upgrade version information includes: Using a storage node that does not perform configuration operations among the multiple storage nodes as the target node; Obtaining the configuration information of the target node and the applied memory of the business module, generating non-volatile data, and saving the non-volatile data to a system hard disk in the storage device, wherein the non-volatile data includes the configuration information and first memory information of the applied memory; The control module of the target node is started, and the version of the target node is upgraded according to the upgrade version information by using the control module.
5. The method according to claim 4, characterized in that The step of restoring the configuration of the service module in the upgraded target node according to the configuration information to obtain the target service module includes: After the target node is upgraded, the control module is instructed to obtain the configuration information from the non-volatile data of the system hard disk; The upgraded target node is initialized, and the service module in the upgraded target node is restored according to the configuration information to obtain the target service module.
6. The method according to claim 2, characterized in that After performing version upgrade on the target node according to the upgrade version information, the method further includes: Sending the upgrade version information to the control state machine to instruct the control state machine to upgrade; After the control state machine is upgraded, the configuration information and the first memory information of the applied memory are saved to the upgraded control state machine.
7. The method according to claim 2, characterized in that The method further comprises: After releasing the target occupied memory, if the target service module executes the target service again, instruct the control module to apply for the target occupied memory for the target service module again, and send the second memory information of the target occupied memory saved by the control module to the control state machine; The control state machine is configured to: after receiving the second memory information, allocate the target occupied memory to the target service module.
8. A memory management device, characterized in that: The device comprises: An acquisition unit, used to acquire upgrade version information; A version upgrade unit, configured to determine a target node from a plurality of storage nodes, obtain configuration information of the target node and applied memory of a business module in the target node, and perform a version upgrade on the target node according to the upgrade version information, wherein the plurality of storage nodes are included in a storage device; A configuration recovery unit, configured to recover the configuration of the service module in the upgraded target node according to the configuration information to obtain the target service module; A determination unit, configured to determine the allocatable memory of the target business module, and use the smaller memory between the applied memory and the allocatable memory as the target occupied memory of the target business module; The application unit is used to apply for the target occupied memory for the target business module.
9. 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 memory management method according to any one of claims 1 to 7 by executing the computer instructions.
10. 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 memory management method according to any one of claims 1 to 7.
