Upgrading method and device of node to be upgraded, storage medium and electronic equipment
By starting the redirecting service process on the node to be upgraded to receive read and write requests, and restarting the stored process to update the data object after upgrading, the problem of inconsistency between read and write requests and data during the upgrade process to ensure business continuity.
Patent Information
- Application Number
- CN202510160093.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the upgrade process of the node to be upgraded, it is impossible to receive read and write requests sent by other nodes, resulting in timely responses to read and write requests sent by other nodes, and the data objects are inconsistent before and after the upgrade.
Start the redirection service process of the node to be upgraded, set the first port in the redirection service process as the port used for reading and writing requests in the node to be upgraded, and receive read and write requests sent by other nodes. After the upgrade node to be upgraded successfully, restart the stored process, set the second port in the stored process as a port for making read and write requests, and update the data object in the stored process through the read and write request received by the first port.
It solves the problem that the node to be upgraded cannot receive read and write requests and data inconsistent with other nodes during the upgrade process, ensuring that the upper-level business is not affected when the storage process is restarted.
Smart Images

Figure CN119621115A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communications, and in particular, to a method and device for upgrading a node to be upgraded, a storage medium, and an electronic device. Background Art
[0002] In the current related technology, when upgrading the node to be upgraded, it is necessary to restart the storage process on the node to be upgraded. When the storage process is restarted, the IO requests written by other nodes in the cluster cannot be processed accordingly, causing IO congestion. As a result, the upper-level business interacting with the storage process has to wait for the IO return of the upgraded node and cannot perform subsequent operations.
[0003] Regarding the problem in related technologies that during the upgrade process of the node to be upgraded, the read and write requests sent by other nodes cannot be received, resulting in the read and write requests sent by other nodes not being responded to in a timely manner and the data objects of the storage process of the node to be upgraded being inconsistent before and after the upgrade, no effective solution has been proposed. Summary of the invention
[0004] The embodiments of the present application provide an upgrade method and device, a storage medium and an electronic device for a node to be upgraded, so as to at least solve the problem in the related art that during the upgrade process of the node to be upgraded, the read and write requests sent by other nodes cannot be received, resulting in the read and write requests sent by other nodes cannot be responded to in a timely manner and the data objects of the storage process of the node to be upgraded are inconsistent before and after the upgrade.
[0005] According to one embodiment of the present application, a method for upgrading a node to be upgraded includes: when the node to be upgraded is allowed to upgrade, starting a redirection service process set for the node to be upgraded, and setting a first port in the redirection service process to a port for performing read and write requests in the node to be upgraded; receiving read and write requests sent by other nodes in the cluster where the node to be upgraded is located through the first port; when the node to be upgraded is successfully upgraded, restarting the storage process of the node to be upgraded, setting a second port in the storage process to a port for performing read and write requests in the node to be upgraded, and updating a data object in the storage process with the read and write requests sent by the other nodes received through the first port, wherein the data object is used to indicate a storage area in the memory corresponding to the storage process.
[0006] In an exemplary embodiment, setting the first port in the redirection service process as the port for performing read and write requests in the node to be upgraded includes: setting the first management network port, the first business network port and the first data network port in the redirection service process as the ports for performing read and write requests in the node to be upgraded, wherein the first port includes the first management network port, the first business network port and the first data network port.
[0007] In an exemplary embodiment, the receiving, through the first port, the read and write requests sent by other nodes in the cluster where the node to be upgraded is located, includes: broadcasting upgrade application information to other nodes in the cluster where the node to be upgraded is located, wherein the upgrade application message is used to indicate that the node to be upgraded is to be upgraded, and indicates that the port through which the node to be upgraded performs read and write requests during the upgrade process is the first port; upon receiving response information to the upgrade application message from the other nodes, receiving, through the first port, the read and write requests sent by other nodes in the cluster where the node to be upgraded is located.
[0008] In an exemplary embodiment, upon receiving the upgrade application information, the master node in the cluster verifies the upgrade request of the node to be upgraded, and upon passing the verification, the master node in the cluster broadcasts a confirmation instruction to other nodes in the cluster, and upon receiving the confirmation instruction, other nodes in the cluster respond to the upgrade application information broadcast by the node to be upgraded and send the response information to the node to be upgraded, wherein the upgrade application information also carries the upgrade content and upgrade version number of the node to be upgraded.
[0009] In an exemplary embodiment, after receiving the read and write requests sent by other nodes in the cluster where the node to be upgraded is located through the first port, the method also includes: in the process of receiving the read and write requests sent by other nodes in the cluster where the node to be upgraded is located through the first port, when receiving the read and write requests about the target data object sent by other nodes in the cluster, recording the request information of the read and write requests of the target data object in the log record of the target data object in the redirection service process, and updating the first serial number of the target data object recorded in the redirection service process; wherein, the first serial number is used to point to the last read and write request in the log record of the target data object, and the first serial number is increased by one each time a read and write request information is added to the log record of the target data object.
[0010] In an exemplary embodiment, the read and write requests sent by the other nodes received through the first port update the data objects in the storage process, including: when there are log records of M data objects recorded in the redirection service process, updating the metadata of the M data objects recorded in the storage process according to the log records of the M data objects, wherein M is an integer greater than or equal to 1.
[0011] In an exemplary embodiment, after updating the metadata of the M data objects recorded in the storage process according to the log records of the M data objects, the method further includes: marking the states of the M data objects in the storage process as pending states, wherein the state of a specified data object among the NM data objects in the storage process is a serviceable state, and the state of data objects among the NM data objects other than the specified data object is an unserviceable state, and the specified data object is a data object whose metadata has not changed before and after the restart of the storage process.
[0012] In an exemplary embodiment, updating the metadata of the M data objects recorded in the storage process according to the log records of the M data objects includes: using the log records of the i-th data object among the M data objects to replay the i-th object data in the storage process to update the metadata of the i-th data object among the M data objects recorded in the storage process, where i is 1, 2...M; updating the second serial number of the i-th data object recorded in the storage process to the first serial number of the i-th data object recorded in the redirection service process.
[0013] In an exemplary embodiment, after the read and write requests sent by the other nodes received through the first port update the data objects in the storage process, the method further includes: broadcasting a join request to the nodes in the cluster, wherein the join request is used to request that the upgraded node to be upgraded be added to the cluster; upon receiving a join permission message broadcasted by the master node in the cluster based on the join request, updating the node status of the node to be upgraded to a normal service status, wherein the join permission message is used to indicate that the upgraded node to be upgraded is allowed to join the cluster.
[0014] In an exemplary embodiment, after the read and write requests sent by the other nodes received through the first port update the data objects in the storage process, the method further includes: when the node to be upgraded is in normal service status and receives a read and write request for a specific data object sent by any one of the other nodes, determining a processing strategy for the read and write request sent by any one of the nodes according to the status of the specific data object in the storage process.
[0015] In an exemplary embodiment, the processing strategy for determining the read and write requests sent by any node based on the status of the specific data object in the storage process includes: when the status of the specific data object in the storage process is the serviceable status, directly processing the read and write requests sent by any node; when the status of the specific data object in the storage process is the unserviceable status, obtaining a complete copy of the specific data object from the cluster, and updating the specific data object based on the complete copy; marking the status of the specific data object as the serviceable status, and processing the read and write requests of the node to be upgraded; wherein the complete copy contains all read and write requests of the nodes in the cluster for the specific data object of the node to be upgraded.
[0016] In an exemplary embodiment, the processing strategy for determining the read and write requests sent by any node based on the status of the specific data object in the storage process includes: when the status of the specific data object in the storage process is the pending confirmation status, obtaining the first serial number of the specific data object recorded in the redirection service process; determining the processing strategy for the read and write requests sent by any node based on the first serial number of the specific data object recorded in the redirection service process and the second serial number of the specific data object recorded in the storage process.
[0017] In an exemplary embodiment, the processing strategy for the read and write requests sent by any node is determined based on the first serial number of the specific data object recorded in the redirection service process and the second serial number of the specific data object recorded in the storage process, including: when the second serial number is greater than or equal to the first serial number, directly processing the read and write requests sent by any node.
[0018] In an exemplary embodiment, the processing strategy for determining the read and write requests sent by any node based on the first serial number of the specific data object recorded in the redirection service process and the second serial number of the specific data object recorded in the storage process includes: when the second serial number is less than the first serial number, using the request information between the second serial number and the first serial number in the log record of the specific data object recorded in the redirection service process to update the metadata of the specific data object recorded in the storage process, and after updating the metadata of the specific data object recorded in the storage process, marking the status of the specific data object as the serviceable status, and processing the read and write requests of the node to be upgraded.
[0019] In an exemplary embodiment, after processing the read and write requests sent by any of the nodes, the method further includes: updating the M recorded in the redirection service process to M-1; when the updated M is equal to zero, closing the redirection service process in the node to be upgraded and releasing the storage resources of the redirection service process.
[0020] In an exemplary embodiment, setting the second port in the storage process as the port for performing read and write requests in the node to be upgraded includes: setting the second management network port, the second service network port and the second data network port in the storage process as the port for performing read and write requests in the node to be upgraded, wherein the second port includes the second management network port, the second service network port and the second data network port.
[0021] According to another embodiment of the present application, there is also provided an upgrade device for a node to be upgraded, comprising: a first processing module, for starting a redirection service process set for the node to be upgraded when the node to be upgraded is allowed to be upgraded, and setting a first port in the redirection service process to a port for performing read and write requests in the node to be upgraded; a receiving module, for receiving, through the first port, read and write requests sent by other nodes in the cluster where the node to be upgraded is located; a second processing module, for restarting the storage process of the node to be upgraded when the node to be upgraded is successfully upgraded, setting a second port in the storage process to a port for performing read and write requests in the node to be upgraded, and updating a data object in the storage process with the read and write requests sent by the other nodes received through the first port, wherein the data object is used to indicate a storage area in the memory corresponding to the storage process.
[0022] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0023] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0024] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiment are implemented.
[0025] Through this application, the redirection service of the node to be upgraded is started, and the first port in the redirection service process is set to the port for performing read and write requests in the node to be upgraded, so as to receive read and write requests sent by other nodes through the first port of the redirection service. After the upgrade of the node to be upgraded is completed, the storage process of the node to be upgraded is restarted, and the read and write requests are received through the second port of the storage process, and the data objects in the storage process are updated through the read and write requests received by the first port. The above technical solution is adopted to solve the problem in the related art that during the upgrade process of the node to be upgraded, the read and write requests sent by other nodes cannot be received, resulting in the read and write requests sent by other nodes being unable to be responded to in time and the data objects of the storage process of the node to be upgraded being inconsistent before and after the upgrade. Thereby, during the upgrade process of the node to be upgraded, the upper-layer business is not affected by the restart of the storage process. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a hardware structure block diagram of a node to be upgraded in a method for upgrading a node to be upgraded according to an embodiment of the present application;
[0027] Figure 2 is a flowchart of a method for upgrading a node to be upgraded according to an embodiment of the present application;
[0028] Figure 3 is a schematic diagram of a redirection service process of an upgrade method for a node to be upgraded according to an embodiment of the present application;
[0029] Figure 4 is a schematic diagram of upgrading a node to be upgraded according to a method for upgrading a node to be upgraded in an embodiment of the present application;
[0030] Figure 5 It is a schematic diagram of a node to be upgraded rejoining a cluster after a storage process of an upgrade method of a node to be upgraded according to an embodiment of the present application is restarted;
[0031] Figure 6 is a schematic diagram showing that the node to be upgraded is upgraded according to the method for upgrading the node to be upgraded in an embodiment of the present application;
[0032] Figure 7 It is a structural block diagram of an upgrading device for a node to be upgraded according to an embodiment of the present application. DETAILED DESCRIPTION
[0033] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0035] The method embodiments provided in the embodiments of the present application can be executed in the node to be upgraded or a similar computing device. Taking running on the node to be upgraded as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a node to be upgraded in a method for upgrading a node to be upgraded according to an embodiment of the present application. Figure 1 As shown, the nodes to be upgraded may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the node to be upgraded may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the node to be upgraded. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0036] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the upgrade method of the node to be upgraded in the embodiment of the present application, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the upgrade method of the node to be upgraded is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the node to be upgraded 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.
[0037] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the node to be upgraded. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0038] In this embodiment, a method for upgrading a node to be upgraded is provided, which is applied to the above-mentioned node to be upgraded. Figure 2 is a flowchart of an upgrade method for a node to be upgraded according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0039] Step S202, when the node to be upgraded is allowed to upgrade, starting a redirection service process set for the node to be upgraded, and setting a first port in the redirection service process as a port for performing read and write requests in the node to be upgraded;
[0040] Step S204, receiving, through the first port, a read / write request sent by other nodes in the cluster where the node to be upgraded is located;
[0041] Step S206, when the node to be upgraded is upgraded successfully, restart the storage process of the node to be upgraded, set the second port in the storage process as the port for performing read and write requests in the node to be upgraded, and update the data object in the storage process with the read and write requests sent by the other nodes received through the first port, wherein the data object is used to indicate the storage area in the memory corresponding to the storage process.
[0042] Through the above steps, when the node to be upgraded is allowed to upgrade, the redirection service process set for the node to be upgraded is started, and the first port in the redirection service process is set to the port for performing read and write requests in the node to be upgraded; the read and write requests sent by other nodes in the cluster where the node to be upgraded is located are received through the first port; when the node to be upgraded is successfully upgraded, the storage process of the node to be upgraded is restarted, the second port in the storage process is set to the port for performing read and write requests in the node to be upgraded, and the read and write requests sent by the other nodes received through the first port are used to update the data object in the storage process, wherein the data object is used to indicate the storage area in the memory corresponding to the storage process. The above technical solution is adopted to solve the problem in the related art that during the upgrade process of the node to be upgraded, the read and write requests sent by other nodes cannot be received, resulting in the read and write requests sent by other nodes not being able to be responded to in time and the data objects of the storage process of the node to be upgraded being inconsistent before and after the upgrade. Thereby, during the upgrade process of the node to be upgraded, the upper-layer business is not affected by the restart of the storage process.
[0043] It should be clear that when the node to be upgraded is ready to upgrade, it sends a preparation request to the upgrade management platform. When the upgrade management platform verifies the upgrade content and upgrade version number of the node to be upgraded, it sends a permission to prepare for upgrade message to the node to be upgraded, that is, the node to be upgraded in the above embodiment is allowed to upgrade.
[0044] In an exemplary embodiment, setting the first port in the redirection service process as the port for performing read and write requests in the node to be upgraded includes: setting the first management network port, the first business network port and the first data network port in the redirection service process as the ports for performing read and write requests in the node to be upgraded, wherein the first port includes the first management network port, the first business network port and the first data network port.
[0045] When the node to be upgraded is ready to be upgraded, the redirection service process is started. The redirection service process includes a first port, which is used to receive read and write requests sent by other nodes in the cluster to the node to be upgraded during the upgrade process of the node to be upgraded. Among them, the first management network port is used for management tasks and communication between nodes, the first business network port is used to process business logic and user requests, and the first data network port is used for data storage and retrieval. When switching ports, switching the second management network port to the first management network port means that the first management network port is used for management tasks and communication between nodes. Switching the second business network port to the first business network port means that the first business network port is used to process business logic and user requests. Switching the second data network port to the first data network port means that the first data network port is used for data storage and retrieval.
[0046] In this embodiment, the first management network port, the first business network port and the first data network port in the redirection service are set as ports used by the node to be upgraded for read and write requests, which can ensure that the business of the node to be upgraded is not affected during the upgrade process, and at the same time, the upgrade exceptions can be handled through the redirection service.
[0047] In an exemplary embodiment, the receiving, through the first port, the read and write requests sent by other nodes in the cluster where the node to be upgraded is located, includes: broadcasting upgrade application information to other nodes in the cluster where the node to be upgraded is located, wherein the upgrade application message is used to indicate that the node to be upgraded is to be upgraded, and indicates that the port through which the node to be upgraded performs read and write requests during the upgrade process is the first port; upon receiving response information to the upgrade application message from the other nodes, receiving, through the first port, the read and write requests sent by other nodes in the cluster where the node to be upgraded is located.
[0048] During the upgrade process of the node to be upgraded, the node to be upgraded first broadcasts an upgrade application message to other nodes in the entire cluster. This message not only indicates that the node to be upgraded is about to be upgraded, but also carries key indication information, that is, during the upgrade, all read and write requests for the node to be upgraded should be redirected to the first port of the redirection service, where the first port includes the first management network port, the first business network port and the first data network port. When other nodes receive the upgrade application message of the node to be upgraded, the other nodes will perform the corresponding redirection operation, modify the second port originally sent to the node to be upgraded for read and write requests to the first port of the redirection service, and send a "switched" feedback message to the cluster after the port switching is completed. Therefore, even if the node to be upgraded is in the upgrade state, it can still receive and process read and write requests from other nodes in the cluster through the first port.
[0049] In this embodiment, the node to be upgraded starts upgrading and restarting the storage process only after all other nodes in the cluster have fed back a "switched" message, ensuring that read and write requests from other nodes in the cluster can be sent to the node to be upgraded during the upgrade process.
[0050] In an exemplary embodiment, upon receiving the upgrade application information, the master node in the cluster verifies the upgrade request of the node to be upgraded, and upon passing the verification, the master node in the cluster broadcasts a confirmation instruction to other nodes in the cluster, and upon receiving the confirmation instruction, other nodes in the cluster respond to the upgrade application information broadcast by the node to be upgraded and send the response information to the node to be upgraded, wherein the upgrade application information also carries the upgrade content and upgrade version number of the node to be upgraded.
[0051] The node to be upgraded will send an upgrade application message to the master node in the cluster. This upgrade application message contains the key upgrade content and the version number to be upgraded, aiming to clearly inform the master node about the specific plan and target version of the upgrade. After receiving the upgrade application message from the node to be upgraded, the master node will immediately start a verification process to check the legitimacy and feasibility of the upgrade request. The verification content includes but is not limited to: confirming whether the upgrade version number is correct, whether the upgrade content is complete, and whether the current running state of the node to be upgraded is suitable for upgrading. If the master node passes the verification and considers that the upgrade request of the node to be upgraded is valid and safe, the master node will broadcast a confirmation instruction to all other nodes in the cluster. This confirmation instruction is used to notify each node in the cluster that the upgrade operation of the node to be upgraded is about to begin. After receiving the confirmation instruction from the master node, the other nodes in the cluster will immediately respond and start processing the upgrade application information. For example, modify the routing rules on this node to redirect the read and write requests originally directed to the node to be upgraded to the first port. At the same time, other nodes in the cluster will also send response information to the node to be upgraded to confirm that the corresponding routing settings have been adjusted and are ready to support the upgrade activities of the node to be upgraded.
[0052] In this embodiment, the verification and confirmation instructions of the master node and the responses of other nodes in the cluster together constitute a collaborative upgrade infrastructure, so that the node to be upgraded can be sure that the other parts of the cluster have made corresponding adjustments and can smoothly process redirected read and write requests without affecting the business.
[0053] In an exemplary embodiment, after receiving the read and write requests sent by other nodes in the cluster where the node to be upgraded is located through the first port, the method also includes: in the process of receiving the read and write requests sent by other nodes in the cluster where the node to be upgraded is located through the first port, when receiving the read and write requests about the target data object sent by other nodes in the cluster, recording the request information of the read and write requests of the target data object in the log record of the target data object in the redirection service process, and updating the first serial number of the target data object recorded in the redirection service process; wherein, the first serial number is used to point to the last read and write request in the log record of the target data object, and the first serial number is increased by one each time a read and write request information is added to the log record of the target data object.
[0054] When the redirection service receives a read or write request for a target data object, it records the request information in a log record associated with the target data object. The log record here is essentially an ordered data structure used to store all read and write operations on the target data object during the upgrade. Whenever the redirection service records a new read or write request, the first sequence number is automatically incremented by one to maintain the consistency of the log record and metadata information. The update mechanism of the log record and the first sequence number provides a basis for the upgraded node to restore the data state during the upgrade. When the node to be upgraded completes the upgrade and comes back online, it can update the state of the target data object in the local storage by replaying the read or write request information in the log record, thereby ensuring that the consistency of the data will not be affected by the upgrade operation. At the same time, the value of the first sequence number can also be used as a basis for judging whether the data object has been fully synchronized, helping the upgraded node determine whether it is ready to resume normal service.
[0055] In this embodiment, the read and write requests of the target data object are recorded in a log format, and the number of read and write requests received by the same target data object is recorded by the first serial number. For the same target data object, the first serial number is increased by one for each additional read and write request information, which is used as a basis for determining whether the data object has been fully synchronized.
[0056] In an exemplary embodiment, the read and write requests sent by the other nodes received through the first port update the data objects in the storage process, including: when there are log records of M data objects recorded in the redirection service process, updating the metadata of the M data objects recorded in the storage process according to the log records of the M data objects, wherein M is an integer greater than or equal to 1.
[0057] In an exemplary embodiment, after updating the metadata of the M data objects recorded in the storage process according to the log records of the M data objects, the method further includes: marking the states of the M data objects in the storage process as pending states, wherein the state of a specified data object among the NM data objects in the storage process is a serviceable state, and the state of data objects among the NM data objects other than the specified data object is an unserviceable state, and the specified data object is a data object whose metadata has not changed before and after the restart of the storage process.
[0058] After the storage service process is restarted, it will check the metadata of the data objects in the storage process and the metadata recorded in the redirection service, and mark the status of the data objects based on the comparison results. If the metadata in the storage process and the redirection service are consistent, it indicates that the data object has not been modified during the upgrade process, so the status of the data object is marked as serviceable (clean); if it is inconsistent, it is marked as unserviceable (stale), indicating that the data object may have been modified during the upgrade and requires further processing before the service can be provided. It is worth noting that when the storage service process synchronizes log information from the redirection service, it will uniformly mark the status of M data objects as to be determined (to_be_confirmed). This means that the final service status of these data objects has yet to be confirmed, and the storage service process needs to decide whether to mark them as serviceable based on the results of log playback.
[0059] In this embodiment, after the storage service process is restarted, the data object in the redirection service is marked as a pending state, and the metadata of the data object in the storage process and the redirection service are compared. If the data is consistent, the state of the data object is determined to be a serviceable state, and if the data object is inconsistent, the state of the data object is determined to be an unserviceable state. The different states of the data object are clarified.
[0060] In an exemplary embodiment, updating the metadata of the M data objects recorded in the storage process according to the log records of the M data objects includes: using the log records of the i-th data object among the M data objects to replay the i-th object data in the storage process to update the metadata of the i-th data object among the M data objects recorded in the storage process, where i is 1, 2...M; updating the second serial number of the i-th data object recorded in the storage process to the first serial number of the i-th data object recorded in the redirection service process.
[0061] After the distributed storage system is upgraded online and the node is restarted, the newly started storage process needs to synchronize data with the previously running redirection service to ensure that the storage service can accurately receive all read and write operations on the data object during the upgrade. This process is mainly implemented through the log playback mechanism. Specifically, the storage process will play back the log record of the i-th data object, where i ranges from 1 to M. The purpose of the playback is to apply the read and write requests that occurred during the upgrade to the data object, update its metadata in the storage process, and ensure that the state of the data object matches the operation results during the upgrade. When the storage process has finished playing back the log record of the i-th data object, it will update the second sequence number of the i-th data object to the corresponding first sequence number recorded by the redirection service. It should be clear that the first sequence number records the last read and write request about the data object processed by the redirection service during the upgrade, while the second sequence number reflects the current state sequence of the data object in the storage process.
[0062] In this embodiment, by replaying the log record of the i-th data object in the storage process, the second sequence number of the i-th data object is updated to the corresponding first sequence number of the redirection service record, ensuring that the metadata state in the storage process is completely consistent with the actual operation state during the upgrade, that is, the storage process can identify all state changes made to the data object during the upgrade.
[0063] In an exemplary embodiment, after the read and write requests sent by the other nodes received through the first port update the data objects in the storage process, the method further includes: broadcasting a join request to the nodes in the cluster, wherein the join request is used to request that the upgraded node to be upgraded be added to the cluster; upon receiving a join permission message broadcasted by the master node in the cluster based on the join request, updating the node status of the node to be upgraded to a normal service status, wherein the join permission message is used to indicate that the upgraded node to be upgraded is allowed to join the cluster.
[0064] In a distributed storage system, when the node to be upgraded completes its upgrade process, it will broadcast a join request to all nodes in the cluster. The join request clearly indicates that the node to be upgraded has completed the upgrade and requests to be allowed to rejoin the cluster. After the join request is broadcast to the cluster, the master node in the cluster will review the received join request to ensure that the upgraded node to be upgraded meets the conditions for rejoining. Once the master node confirms that the node to be upgraded meets the requirements for joining the cluster, it will broadcast a join permission message to the cluster. The join permission message is the master node's formal response to the join request, indicating to all nodes in the cluster that the upgraded node to be upgraded has been allowed to rejoin the cluster and become part of the cluster. When the node to be upgraded receives the join permission message broadcast by the cluster master node, the node to be upgraded will update its own state from the upgrade state to the normal service state. At the same time, the node to be upgraded will also notify other nodes in the cluster, so that other nodes can start to reroute read and write requests to the node to restore data interaction and service continuity.
[0065] In this embodiment, the node to be upgraded sends a join request to the cluster after the storage process updates the data object, and updates the node status to a normal service status after rejoining the cluster, which means that the node to be upgraded can normally use the second port to receive read and write requests from other nodes.
[0066] In an exemplary embodiment, after the read and write requests sent by the other nodes received through the first port update the data objects in the storage process, the method further includes: when the node to be upgraded is in normal service status and receives a read and write request for a specific data object sent by any one of the other nodes, determining a processing strategy for the read and write request sent by any one of the nodes according to the status of the specific data object in the storage process.
[0067] In an exemplary embodiment, the processing strategy for determining the read and write requests sent by any node based on the status of the specific data object in the storage process includes: when the status of the specific data object in the storage process is the serviceable status, directly processing the read and write requests sent by any node; when the status of the specific data object in the storage process is the unserviceable status, obtaining a complete copy of the specific data object from the cluster, and updating the specific data object based on the complete copy; marking the status of the specific data object as the serviceable status, and processing the read and write requests of the node to be upgraded; wherein the complete copy contains all read and write requests of the nodes in the cluster for the specific data object of the node to be upgraded.
[0068] After receiving the message of allowing to join sent by the master node in the cluster, the node to be upgraded updates its node status to a normal service status. At this time, for the received read and write requests, the corresponding processing strategy is determined according to the status of the data object of the storage process. When the status of the data object of the storage process is a serviceable state, the read and write request of the node to be upgraded is directly processed. When the status of the data object of the storage process is an unserviceable state, the complete copy location of the data object in the unserviceable state is obtained from the cluster. It should be clear that a node has two copy locations including a first copy location and a second copy location. When the node to be upgraded is upgraded, the first copy location is upgraded, and the second copy location continues to receive read and write requests, that is, the second copy location contains the complete read and write requests of the upgraded node. The complete copy location in this embodiment contains the complete read and write requests of the upgraded node. The complete read and write requests of the node to be upgraded are obtained according to the complete copy location. When all read and write requests are received, the status of the data object is updated to a serviceable state, and the read and write requests of the node to be upgraded are processed.
[0069] In this embodiment, after receiving the permission to join message sent by the master node in the cluster, the node to be upgraded determines the corresponding processing strategy for the received read and write requests according to the status of the data object of the storage process, thereby implementing the processing strategy for read and write requests in both the serviceable state and the unserviceable state.
[0070] In an exemplary embodiment, the processing strategy for determining the read and write requests sent by any node based on the status of the specific data object in the storage process includes: when the status of the specific data object in the storage process is the pending confirmation status, obtaining the first serial number of the specific data object recorded in the redirection service process; determining the processing strategy for the read and write requests sent by any node based on the first serial number of the specific data object recorded in the redirection service process and the second serial number of the specific data object recorded in the storage process.
[0071] In an exemplary embodiment, the processing strategy for the read and write requests sent by any node is determined based on the first serial number of the specific data object recorded in the redirection service process and the second serial number of the specific data object recorded in the storage process, including: when the second serial number is greater than or equal to the first serial number, directly processing the read and write requests sent by any node.
[0072] In an exemplary embodiment, the processing strategy for determining the read and write requests sent by any node based on the first serial number of the specific data object recorded in the redirection service process and the second serial number of the specific data object recorded in the storage process includes: when the second serial number is less than the first serial number, using the request information between the second serial number and the first serial number in the log record of the specific data object recorded in the redirection service process to update the metadata of the specific data object recorded in the storage process, and after updating the metadata of the specific data object recorded in the storage process, marking the status of the specific data object as the serviceable status, and processing the read and write requests of the node to be upgraded.
[0073] For a specific data object marked as pending confirmation in the storage process, the storage process first needs to obtain the first sequence number of the specific data object recorded in the redirection service. The first sequence number reflects the last read and write request received by the redirection service for the data object during the upgrade, and is essentially the latest record of the state change of the data object by the redirection service. After obtaining the first sequence number, the storage process will compare it with the second sequence number recorded by the storage process itself. By comparing the two sequence numbers, it can be determined whether the specific data object has undergone an external state change during the upgrade, thereby deciding how to handle the received read and write requests.
[0074] If the second sequence number is greater than or equal to the first sequence number, this means that the read and write requests of the data object in the storage process are at least consistent with or more advanced than the latest state during the upgrade. In this case, the data object state is marked as a serviceable state, indicating that the data object can be safely read and written. At the same time, the number M of the data object state recorded in the redirection service is reduced by one, indicating that the state confirmation of another data object has been completed.
[0075] If the second sequence number is less than the first sequence number, this indicates that during the upgrade, the read and write requests for the data object in the storage process are less than the read and write requests received by the redirection service. At this time, the storage process will synchronize all read and write request logs between the second sequence number and the first sequence number from the redirection service, and replay these logs to update the metadata of the data object in the storage process. After the replay is completed, the data object status is updated to the serviceable status. At the same time, the storage process will send a synchronization completion message to the redirection service, and the redirection service will reduce M by one to confirm that the data synchronization is complete.
[0076] In this embodiment, the first sequence number and the second sequence number are compared to determine whether the number of read and write requests for the data object in the storage process is updated during the storage process restart. If the second sequence number is smaller than the first sequence number, it indicates that during the storage process restart, other nodes still send read and write requests to the redirection service. At this time, it is necessary to synchronize the increased read and write requests in the redirection service to the storage process through playback. If the second sequence number is greater than or equal to the first sequence number, it means that during the storage process restart, no other nodes send read and write requests to the redirection service.
[0077] In an exemplary embodiment, after processing the read and write requests sent by any of the nodes, the method further includes: updating the M recorded in the redirection service process to M-1; when the updated M is equal to zero, closing the redirection service process in the node to be upgraded and releasing the storage resources of the redirection service process.
[0078] Whenever the storage service process successfully processes a read or write request for a data object in the pending state, the storage service process will reduce the M value recorded in the redirection service process by one, which means that another data object has completed state synchronization and confirmation. As the storage service process continues to process and confirm the state of the data object, the value of M will gradually decrease until M is equal to zero, which indicates that all data objects in the pending state have completed state confirmation and processing, and the redirection service no longer needs to store and process any data objects in the pending state. When M is equal to zero, shut down the redirection service process in the node to be upgraded and release the storage resources it occupies.
[0079] In this embodiment, by reducing the data objects in the pending confirmation state in the redirection service to zero, it means that all read and write requests of the data objects in the pending confirmation state in the redirection service have been synchronized to the storage process to ensure that the data objects in the storage process are the latest.
[0080] In an exemplary embodiment, setting the second port in the storage process as the port for performing read and write requests in the node to be upgraded includes: setting the second management network port, the second service network port and the second data network port in the storage process as the port for performing read and write requests in the node to be upgraded, wherein the second port includes the second management network port, the second service network port and the second data network port.
[0081] The port normally used by the node to be upgraded to receive read and write requests sent by other nodes in the cluster is the second port, and the second port includes a second management network port corresponding to the storage process, a second business network port, and a second data network port. Among them, the second management network port is used for management tasks and communication between nodes, the second business network port is used to process business logic and user requests, and the second data network port is used for data storage and retrieval.
[0082] In this embodiment, the type of the second port through which the node to be upgraded normally receives read and write requests sent by other nodes in the cluster is clarified, and the first port corresponds to the second port one-to-one, so that during the upgrade process of the node to be upgraded, the second port used to receive read and write requests sent by other nodes in the cluster is switched to the first port.
[0083] Figure 3 is a schematic diagram of a redirection service process of an upgrade method for a node to be upgraded according to an embodiment of the present application, such as Figure 3 As shown, the specific steps include:
[0084] When the node to be upgraded is ready to be upgraded, the redirection service process is started. The redirection service process switches the second port used for read and write requests of the node to be upgraded to the first port, wherein the first ports correspond to the management network, business network, and data network ports in the distributed storage network. The management network port is used to manage tasks and communications between nodes; the business network port is used to process business logic and user requests; the data network port is used to store and retrieve data. The storage space of the redirection service process is configured, and the above storage space includes but is not limited to memory, disk, USB flash drive, etc. The node to be upgraded broadcasts an "upgrade application" message to the cluster.
[0085] After receiving the upgrade application, the master node in the cluster checks the upgrade information of the node to be upgraded, including but not limited to the upgrade version number, upgrade path, etc. If the verification fails, a message "upgrade not allowed" is broadcasted. After receiving the broadcast, the node to be upgraded stops the redirection service process and releases the storage space, and other nodes in the cluster ignore the broadcast. If the verification passes, a message "upgrade allowed" is broadcasted. After receiving the broadcast, other nodes in the cluster mark the status of the node to be upgraded as "upgrading", and according to the above mark, the first port originally used to send read and write requests to the node to be upgraded is switched to the second port, and a message "switched" is broadcasted in the cluster.
[0086] In this embodiment, node A is the node to be upgraded, and node B is another node in the cluster. Before upgrading, node B directly makes read and write requests to the second port P1 / P2 / P3 of node A, where the second ports correspond to the management network, business network, and data network ports in the distributed storage network, respectively. When node A is ready to upgrade, the redirection service process is started. During the upgrade process of node A, node B makes read and write requests to the first port P4 / P5 / P6, where the first ports also correspond to the management network, business network, and data network ports in the distributed storage network, respectively.
[0087] Figure 4 Schematic diagram of upgrading a node to be upgraded according to an upgrading method of a node to be upgraded according to an embodiment of the present application, such as Figure 4 As shown, the specific steps include:
[0088] After all nodes in the cluster have switched ports, the node to be upgraded updates the installation package and restarts the storage process. After the storage process is started again, the metadata of the data object is loaded from the target storage space where the storage process stored the data object before the restart, and the above metadata is used as the first metadata, wherein the target storage space includes but is not limited to memory, disk, USB flash drive, etc. The first metadata is compared with the metadata of the data object of the storage process after the restart, that is, the second metadata. If the first metadata and the second metadata are consistent, the status of the corresponding data object in the storage process is marked as a serviceable state. If the first metadata and the second metadata are inconsistent, the status of the corresponding data object in the storage process is marked as an unserviceable state.
[0089] The data object is obtained from the redirection service process, and when the data object in the redirection service process is also in the storage process, the duplicate data object is determined. If the duplicate data object is in a serviceable state in the storage process, the state of the duplicate data object in the storage process is updated to an unserviceable state. If the duplicate data object is in an unserviceable state in the storage process, the state of the data object in the storage process remains in the current unserviceable state.
[0090] Obtain the corresponding service log from the redirected service process, replay the service log, obtain the data object in the successfully replayed log, change the state of the data object in the log from an unserviceable state to a pending confirmation state, and update the serial number of the data object of the storage process according to the number of successfully replayed data objects to obtain a second serial number.
[0091] After all nodes in the cluster have switched ports, the redirection service process synchronously receives read and write requests from other nodes in the cluster. For each read and write request, the read and write request is recorded again in log format in units of data objects. Read and write requests in different log formats for the same data object in the redirection service process are obtained, and the number of read and write requests in the above log format is recorded as N. The serial number of the data object of the redirection service process is added by N to obtain the first serial number, and the first serial number is updated to the storage process. At the same time, the number of all data objects in the storage process is recorded as M, where N and M are both positive integers.
[0092] Figure 5 is a schematic diagram of a node to be upgraded rejoining a cluster after a storage process of an upgrade method for a node to be upgraded according to an embodiment of the present application is restarted, such as Figure 5 As shown, the specific steps include:
[0093] After the upgrade, the node to be upgraded sends a join request to the master node in the cluster. After receiving the join request from the node to be upgraded, the master node in the cluster management verifies the running status and running version number of the upgraded node to be upgraded. After the verification is passed, the "allowed to join" message is broadcast in the cluster. After receiving the "allowed to join" message, the other nodes in the cluster modify the status of the node to be upgraded to the normal service status, and switch the first port used to send read and write requests to the second port. At this point, the upgrade management platform believes that the node to be upgraded has completed the upgrade and can perform a rolling upgrade of the next node.
[0094] Figure 6 is a schematic diagram of the node to be upgraded being upgraded according to the upgrade method of the node to be upgraded according to an embodiment of the present application, such as Figure 6 As shown, the specific steps include:
[0095] When the node to be upgraded is in normal service state and receives a read / write request sent by any other node in the cluster, a processing strategy for the read / write request sent by any node is determined according to the state of the data object of the storage process.
[0096] When the data object of the storage process is in a serviceable state, the read and write request of the node to be upgraded is directly processed.
[0097] When the state of the data object of the storage process is an unserviceable state, obtain the complete copy location of the data object in the unserviceable state from the cluster. It should be clear that a node has two copy locations including a first copy location and a second copy location. When the node to be upgraded is upgraded, the first copy location is upgraded, and the second copy location continues to receive read and write requests, that is, the second copy location contains the complete read and write requests of the upgraded node. The complete copy location in this embodiment contains the complete read and write requests of the upgraded node. Obtain the complete read and write requests of the node to be upgraded according to the complete copy location. When all read and write requests are received, update the state of the data object to a serviceable state, and process the read and write requests of the node to be upgraded.
[0098] When the status of the data object of the storage process is to be confirmed, a confirmation request is sent to the redirection service process, wherein the confirmation request carries the first serial number of the data object of the storage process. The redirection service process compares the second serial number with the first serial number, wherein the first serial number is the serial number of the data object of the redirection service process.
[0099] When the second sequence number is greater than or equal to the first sequence number, the redirection service process decrements the number M of the data objects of the storage process. When M is not equal to the target value, a target message is returned to the storage process, wherein the target message is used to instruct the storage process to update the state of the data objects of the storage process. When the state of the data objects of the storage process is modified to a serviceable state, the read and write requests of the node to be upgraded are processed. When M is equal to the target value, a message indicating that the upgrade of the node to be upgraded is completed is sent to the storage process, and then the redirection service process exits and releases the cache resources used to upgrade the node to be upgraded.
[0100] In the case where the second sequence number is less than the first sequence number, a target error code is returned to the storage process. After receiving the target error code, the storage process sends a read / write request that meets the preset standard to the redirection service process, wherein the preset standard is the open / closed interval from the second sequence number to the first sequence number, and the read / write request that meets the preset standard is replayed. When the redirection service process completes the replay, the state of the data object of the storage process is modified to a serviceable state, and the read / write request of the node to be upgraded is processed. At the same time, after sending a synchronization completion message to the redirection service process, the redirection service process decrements the number M of the data objects of the storage process. When M is equal to 0, a message is sent to the storage process indicating that the upgrade of the node to be upgraded is completed. The redirection service process then exits and releases the cache resources used to upgrade the node to be upgraded.
[0101] In this embodiment, the online upgrade problem in distributed storage is solved by defining a redirection service, wherein the essence of the redirection service is to temporarily redirect the second port of the node to be upgraded in the distributed storage service for receiving read and write requests, and redirect the second port to the first port of the redirection service, which provides IO access capability. At the same time, the storage process is updated synchronously with the redirection service after restarting and updating. Since the redirection service and the storage process are different service processes on the same host, the data synchronization process can be optimized by sharing content and other means. During data synchronization, the redirection service and the storage process can both provide read and write services, thereby reducing the problem of distributed storage performance degradation caused by the restart of the storage process. The upgrade of the node to be upgraded is completed through the gradual synchronization of the storage process and the redirection service data.
[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0103] In this embodiment, an upgrade device for a node to be upgraded is also provided. The system is used to implement the above-mentioned embodiments and preferred implementation modes. The descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of 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.
[0104] Figure 7 is a structural block diagram of an upgrade method for a node to be upgraded according to an embodiment of the present application, such as Figure 7 As shown, the device comprises:
[0105] A first processing module 70 is used to start a redirection service process set for the node to be upgraded, and set a first port in the redirection service process as a port for performing read and write requests in the node to be upgraded, if the node to be upgraded is allowed to be upgraded;
[0106] A receiving module 72, configured to receive, through the first port, read and write requests sent by other nodes in the cluster where the node to be upgraded is located;
[0107] The second processing module 74 is used to restart the storage process of the node to be upgraded if the node to be upgraded is upgraded successfully, set the second port in the storage process as the port for performing read and write requests in the node to be upgraded, and update the data object in the storage process with the read and write requests sent by the other nodes received through the first port, wherein the data object is used to indicate the storage area in the memory corresponding to the storage process.
[0108] In an embodiment of the present application, when the node to be upgraded is allowed to upgrade, the redirection service process set for the node to be upgraded is started, and the first port in the redirection service process is set to the port for performing read and write requests in the node to be upgraded; the read and write requests sent by other nodes in the cluster where the node to be upgraded is located are received through the first port; when the node to be upgraded is successfully upgraded, the storage process of the node to be upgraded is restarted, the second port in the storage process is set to the port for performing read and write requests in the node to be upgraded, and the read and write requests sent by the other nodes received through the first port are used to update the data object in the storage process, wherein the data object is used to indicate the storage area in the memory corresponding to the storage process. The above technical solution is adopted to solve the problem in the related art that, during the upgrade process of the node to be upgraded, the read and write requests sent by other nodes cannot be received, resulting in the read and write requests sent by other nodes not being able to be responded to in time and the data objects of the storage process of the node to be upgraded being inconsistent before and after the upgrade. Thereby, during the upgrade process of the node to be upgraded, the upper-layer business is not affected by the restart of the storage process.
[0109] In an exemplary embodiment, the first processing module 70 is also used to set the first management network port, the first business network port and the first data network port in the redirection service process as ports for performing read and write requests in the node to be upgraded, wherein the first port includes the first management network port, the first business network port and the first data network port.
[0110] In an exemplary embodiment, the receiving module 72 is also used to broadcast upgrade application information to other nodes in the cluster where the node to be upgraded is located, wherein the upgrade application message is used to indicate that the node to be upgraded is to be upgraded, and to indicate that the port for performing read and write requests on the node to be upgraded during the upgrade process is the first port; upon receiving response information to the upgrade application message from the other nodes, the read and write requests sent by the other nodes in the cluster where the node to be upgraded is located are received through the first port.
[0111] In an exemplary embodiment, the first processing module 70 is also used for the master node in the cluster to verify the upgrade request of the node to be upgraded when receiving the upgrade application information, and when the verification is passed, the master node in the cluster broadcasts a confirmation instruction to other nodes in the cluster, and when the other nodes in the cluster receive the confirmation instruction, they respond to the upgrade application information broadcast by the node to be upgraded and send the response information to the node to be upgraded, wherein the upgrade application information also carries the upgrade content and upgrade version number of the node to be upgraded.
[0112] In an exemplary embodiment, the receiving module 72 is also used to, during the process of receiving read and write requests sent by other nodes in the cluster where the node to be upgraded is located through the first port, record the request information of the read and write requests for the target data object in the log record of the target data object in the redirection service process when the read and write requests regarding the target data object are received from other nodes in the cluster, and update the first serial number of the target data object recorded in the redirection service process; wherein the first serial number is used to point to the last read and write request in the log record of the target data object, and the first serial number is increased by one each time a read and write request is added to the log record of the target data object.
[0113] In an exemplary embodiment, the receiving module 72 is also used to update the metadata of the M data objects recorded in the storage process according to the log records of the M data objects when there are log records of M data objects recorded in the redirection service process, where M is an integer greater than or equal to 1.
[0114] In an exemplary embodiment, the receiving module 72 is also used to mark the states of the M data objects in the storage process as pending states, wherein the state of a specified data object among the NM data objects in the storage process is a serviceable state, and the state of data objects among the NM data objects except the specified data object is an unserviceable state, and the specified data object is a data object whose metadata has not changed before and after the restart of the storage process.
[0115] In an exemplary embodiment, the receiving module 72 is also used to use the log record of the i-th data object among the M data objects to replay the i-th object data in the storage process to update the metadata of the i-th data object among the M data objects recorded in the storage process, where i is 1, 2...M; and update the second serial number of the i-th data object recorded in the storage process to the first serial number of the i-th data object recorded in the redirection service process.
[0116] In an exemplary embodiment, the second processing module 74 is also used to broadcast a join request to the nodes in the cluster, wherein the join request is used to request that the upgraded node to be upgraded be added to the cluster; upon receiving a join permission message broadcasted by the master node in the cluster based on the join request, the node state of the node to be upgraded is updated to a normal service state, wherein the join permission message is used to indicate that the upgraded node to be upgraded is allowed to join the cluster.
[0117] In an exemplary embodiment, the receiving module 72 is also used to determine the processing strategy of the read and write requests sent by any node according to the status of the specific data object in the storage process when the node to be upgraded is in normal service status and receives a read and write request for a specific data object sent by any of the other nodes.
[0118] In an exemplary embodiment, the receiving module 72 is also used to directly process the read and write requests sent by any node when the state of the specific data object in the storage process is the serviceable state; when the state of the specific data object in the storage process is the unserviceable state, obtain a complete copy of the specific data object from the cluster, and update the specific data object according to the complete copy; mark the state of the specific data object as the serviceable state, and process the read and write requests of the node to be upgraded; wherein the complete copy contains all read and write requests of the nodes in the cluster for the specific data object of the node to be upgraded.
[0119] In an exemplary embodiment, the receiving module 72 is also used to obtain the first serial number of the specific data object recorded in the redirection service process when the state of the specific data object in the storage process is the pending confirmation state; and determine the processing strategy of the read and write requests sent by any node based on the first serial number of the specific data object recorded in the redirection service process and the second serial number of the specific data object recorded in the storage process.
[0120] In an exemplary embodiment, the receiving module 72 is further configured to directly process the read / write request sent by any node when the second sequence number is greater than or equal to the first sequence number.
[0121] In an exemplary embodiment, the receiving module 72 is also used to update the metadata of the specific data object recorded in the storage process using the request information between the second serial number and the first serial number in the log record of the specific data object recorded in the redirection service process when the second serial number is smaller than the first serial number, and after updating the metadata of the specific data object recorded in the storage process, mark the status of the specific data object as the serviceable status and process the read and write requests of the node to be upgraded.
[0122] In an exemplary embodiment, the receiving module 72 is further used to update the M recorded in the redirection service process to M-1; when the updated M is equal to zero, close the redirection service process in the node to be upgraded and release the storage resources of the redirection service process.
[0123] In an exemplary embodiment, the second processing module 74 is also used to set the second management network port, the second business network port and the second data network port in the storage process as ports for performing read and write requests in the node to be upgraded, wherein the second port includes the second management network port, the second business network port and the second data network port.
[0124] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0125] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0126] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0127] S1, when the node to be upgraded is allowed to upgrade, starting a redirection service process set for the node to be upgraded, and setting a first port in the redirection service process as a port for performing read and write requests in the node to be upgraded;
[0128] S2, receiving, through the first port, read and write requests sent by other nodes in the cluster where the node to be upgraded is located;
[0129] S3, when the node to be upgraded is upgraded successfully, restart the storage process of the node to be upgraded, set the second port in the storage process as the port for performing read and write requests in the node to be upgraded, and update the data object in the storage process with the read and write requests sent by the other nodes received through the first port, wherein the data object is used to indicate the storage area in the memory corresponding to the storage process.
[0130] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0131] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0132] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0133] S1, when the node to be upgraded is allowed to upgrade, starting a redirection service process set for the node to be upgraded, and setting a first port in the redirection service process as a port for performing read and write requests in the node to be upgraded;
[0134] S2, receiving, through the first port, read and write requests sent by other nodes in the cluster where the node to be upgraded is located;
[0135] S3, when the node to be upgraded is upgraded successfully, restart the storage process of the node to be upgraded, set the second port in the storage process as the port for performing read and write requests in the node to be upgraded, and update the data object in the storage process with the read and write requests sent by the other nodes received through the first port, wherein the data object is used to indicate the storage area in the memory corresponding to the storage process.
[0136] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0137] Optionally, in this embodiment, the computer program may be configured to perform the following steps by means of the computer program:
[0138] S1, when the node to be upgraded is allowed to upgrade, starting a redirection service process set for the node to be upgraded, and setting a first port in the redirection service process as a port for performing read and write requests in the node to be upgraded;
[0139] S2, receiving, through the first port, read and write requests sent by other nodes in the cluster where the node to be upgraded is located;
[0140] S3, when the node to be upgraded is upgraded successfully, restart the storage process of the node to be upgraded, set the second port in the storage process as the port for performing read and write requests in the node to be upgraded, and update the data object in the storage process with the read and write requests sent by the other nodes received through the first port, wherein the data object is used to indicate the storage area in the memory corresponding to the storage process.
[0141] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0142] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0143] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for upgrading a node to be upgraded, characterized in that: include: In the case that the node to be upgraded is allowed to be upgraded, starting a redirection service process set for the node to be upgraded, and setting a first port in the redirection service process as a port for performing read and write requests in the node to be upgraded; Receiving, through the first port, a read / write request sent by other nodes in the cluster where the node to be upgraded is located; In the case where the node to be upgraded is upgraded successfully, the storage process of the node to be upgraded is restarted, the second port in the storage process is set as the port for performing read and write requests in the node to be upgraded, and the read and write requests sent by the other nodes received through the first port are used to update the data object in the storage process, wherein the data object is used to indicate the storage area in the memory corresponding to the storage process.
2. The method according to claim 1, characterized in that: The step of setting the first port in the redirection service process as a port for performing read and write requests in the node to be upgraded includes: The first management network port, the first service network port and the first data network port in the redirection service process are set as ports for performing read and write requests in the node to be upgraded, The first port includes the first management network port, the first service network port and the first data network port.
3. The method according to claim 1, characterized in that The receiving, through the first port, the read / write request sent by other nodes in the cluster where the node to be upgraded is located includes: Broadcasting upgrade application information to other nodes in the cluster where the node to be upgraded is located, wherein the upgrade application message is used to indicate that the node to be upgraded is to be upgraded, and indicates that the port for the node to be upgraded to perform read and write requests during the upgrade process is the first port; When the response information of the other nodes to the upgrade application message is received, the read and write requests sent by other nodes in the cluster where the node to be upgraded is located are received through the first port.
4. The method according to claim 1, characterized in that: Upon receiving the upgrade application information, the master node in the cluster verifies the upgrade request of the node to be upgraded, and upon passing the verification, the master node in the cluster broadcasts a confirmation instruction to other nodes in the cluster, and upon receiving the confirmation instruction, other nodes in the cluster respond to the upgrade application information broadcast by the node to be upgraded and send the response information to the node to be upgraded, wherein the upgrade application information also carries the upgrade content and upgrade version number of the node to be upgraded.
5. The method according to claim 1, characterized in that: After receiving, through the first port, a read / write request sent by other nodes in the cluster where the node to be upgraded is located, the method further includes: In the process of receiving read and write requests sent by other nodes in the cluster where the node to be upgraded is located through the first port, in the case of receiving read and write requests about a target data object sent by other nodes in the cluster, recording request information of the read and write requests of the target data object in a log record of the target data object in the redirection service process, and updating a first serial number of the target data object recorded in the redirection service process; The first serial number is used to point to the last read / write request in the log record of the target data object, and the first serial number is increased by one each time a piece of request information of a read / write request is added to the log record of the target data object.
6. The method according to claim 5, characterized in that The read / write request sent by the other node and received through the first port updates the data object in the storage process, including: In a case where log records of M data objects are recorded in the redirection service process, metadata of the M data objects recorded in the storage process are updated according to the log records of the M data objects, where M is an integer greater than or equal to 1.
7. The method according to claim 6, characterized in that After updating the metadata of the M data objects recorded in the storage process according to the log records of the M data objects, the method further includes: The states of the M data objects in the storage process are all marked as pending states, wherein the state of a specified data object among the NM data objects in the storage process is a serviceable state, and the state of data objects other than the specified data object among the NM data objects is an unserviceable state, and the specified data object is a data object whose metadata has not changed before and after the restart of the storage process.
8. The method according to claim 6, characterized in that The updating of metadata of the M data objects recorded in the storage process according to the log records of the M data objects includes: Replaying the i-th object data in the storage process using the log record of the i-th data object among the M data objects to update the metadata of the i-th data object among the M data objects recorded in the storage process, where i is 1, 2, ..., M; The second serial number of the i-th data object recorded in the storage process is updated to the first serial number of the i-th data object recorded in the redirection service process.
9. The method according to claim 1, characterized in that: After the read / write request sent by the other node and received through the first port updates the data object in the storage process, the method further includes: Broadcasting a join request to the nodes in the cluster, wherein the join request is used to request that the upgraded node to be upgraded be added to the cluster; Upon receiving a join permission message broadcasted by the master node in the cluster based on the join request, the node state of the node to be upgraded is updated to a normal service state, wherein the join permission message is used to indicate that the upgraded node to be upgraded is allowed to join the cluster.
10. The method according to claim 7, characterized in that After the read / write request sent by the other node received through the first port updates the data object in the storage process, the method further includes: When the node to be upgraded is in normal service state and receives a read or write request for a specific data object sent by any of the other nodes, a processing strategy for the read or write request sent by any of the other nodes is determined according to the state of the specific data object in the storage process.
11. The method according to claim 10, characterized in that The determining, according to the state of the specific data object in the storage process, a processing strategy for the read / write request sent by any node includes: When the state of the specific data object in the storage process is the serviceable state, directly processing the read and write request sent by any node; When the state of the specific data object in the storage process is the unserviceable state, a complete copy of the specific data object is obtained from the cluster, and the specific data object is updated according to the complete copy; the state of the specific data object is marked as the serviceable state, and the read and write requests of the node to be upgraded are processed; wherein the complete copy contains all read and write requests of the nodes in the cluster for the specific data object of the node to be upgraded.
12. The method according to claim 10, characterized in that The determining, according to the state of the specific data object in the storage process, a processing strategy for the read / write request sent by any node includes: When the state of the specific data object in the storage process is the pending confirmation state, obtaining a first serial number of the specific data object recorded in the redirection service process; A processing strategy for the read / write request sent by any node is determined according to the first serial number of the specific data object recorded in the redirection service process and the second serial number of the specific data object recorded in the storage process.
13. The method according to claim 12, characterized in that The determining, according to the first serial number of the specific data object recorded in the redirection service process and the second serial number of the specific data object recorded in the storage process, a processing strategy for the read / write request sent by any node includes: When the second sequence number is greater than or equal to the first sequence number, the read and write request sent by any node is directly processed.
14. The method according to claim 12, characterized in that The determining, according to the first serial number of the specific data object recorded in the redirection service process and the second serial number of the specific data object recorded in the storage process, a processing strategy for the read / write request sent by any node includes: In the case where the second serial number is less than the first serial number, the metadata of the specific data object recorded in the storage process is updated using the request information between the second serial number and the first serial number in the log record of the specific data object recorded in the redirection service process, and after updating the metadata of the specific data object recorded in the storage process, the state of the specific data object is marked as the serviceable state, and the read and write requests of the node to be upgraded are processed.
15. The method according to any one of claims 13 or 14, characterized in that After processing the read / write request sent by any node, the method further includes: Update M recorded in the redirection service process to M-1; When the updated M is equal to zero, the redirection service process in the node to be upgraded is closed, and the storage resources of the redirection service process are released.
16. The method according to claim 1, characterized in that The step of setting the second port in the storage process as a port in the node to be upgraded for performing read and write requests includes: The second management network port, the second service network port and the second data network port in the storage process are set as ports for performing read and write requests in the node to be upgraded, The second port includes the second management network port, the second service network port and the second data network port.
17. An upgrading device for a node to be upgraded, characterized in that: include: A first processing module is used to start a redirection service process set for the node to be upgraded, and set a first port in the redirection service process as a port for performing read and write requests in the node to be upgraded, if the node to be upgraded is allowed to be upgraded; A receiving module, used for receiving, through the first port, read and write requests sent by other nodes in the cluster where the node to be upgraded is located; The second processing module is used to restart the storage process of the node to be upgraded if the node to be upgraded is upgraded successfully, set the second port in the storage process as the port for performing read and write requests in the node to be upgraded, and update the data object in the storage process through the read and write requests sent by the other nodes received through the first port, wherein the data object is used to indicate the storage area in the memory corresponding to the storage process.
18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 16 when executed by a processor.
19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 16 are implemented.
20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 16 are implemented.
Citation Information
Patent Citations
Node online upgrading method and device, equipment and medium
CN118433027A
Distributed storage system upgrading method and device, equipment and medium
CN119336361A
Data processing method and apparatus
US20200348851A1
Cited By
Upgrading method and device for metadata nodes in distributed cluster, equipment and medium
CN120848925A