Partition moving method, apparatus, device, and storage medium
By preloading partition data on the target worker node and negotiating the service shutdown of the source worker node, the problem of excessively long unservice periods during partition migration is solved, achieving more efficient and convenient partition migration.
Patent Information
- Application Number
- CN202310519609.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-08
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2043-05-08
AI Technical Summary
In distributed systems, the time it takes for the target worker node to load the partition during partition movement is long, resulting in prolonged unserviceability of the partition and reducing the convenience of partition movement.
A negotiation mechanism is introduced between the source worker node and the target worker node. By communicating with each other, some memory data and log data are preloaded on the target worker node. When the preloading conditions are met, the source worker node is notified to stop the service, thereby reducing the time that the target worker node has to wait to load the partition lock.
It shortens the time a partition is unserviceable, improves the ease of moving partitions, and reduces the time it takes for the target worker node to load data.
Smart Images

Figure CN116628084B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a partition moving method and device, equipment and storage medium. BACKGROUND
[0002] In a distributed system, due to the need for version upgrade, load balancing and other reasons, the database thereof may need to perform a partition moving operation, that is, moving a partition from a source worker node of the distributed system to a target worker node. In the related art, a control node usually sends a partition unloading instruction to the source worker node and simultaneously sends a partition loading instruction to the target worker node, and after the source worker node unloads the partition, the partition is in an un-serviceable state, that is, no request can be made to the partition to be moved, such as a request for reading and writing data, until the target worker node loads successfully, and the partition to be moved can recover to normal. However, in the process of loading the partition by the target worker node, a long time is required for loading log data and other data, resulting in a long time of un-serviceable state of the partition, and causing low convenience of partition moving.
[0003] The information disclosed in the background section of this application is only intended to deepen the understanding of the general background of the application and should not be regarded as acknowledging or implying in any form that the information constitutes prior art known to those skilled in the art. SUMMARY
[0004] The present disclosure provides a partition moving method, device, equipment and storage medium.
[0005] According to an aspect of the present disclosure, a partition moving method is provided, which is used for a target worker node of a distributed system, and includes:
[0006] In a case where a partition loading instruction of a control node of the distributed system is received, a partition moving instruction is sent to a source worker node, wherein the partition moving instruction is an instruction for moving a partition to be moved in the source worker node to the target worker node;
[0007] In a case where first response information of the source worker node is received, memory data and log data of the partition to be moved are preloaded according to the first response information;
[0008] In a case where the preloaded log data meets a preloading condition, a partition stopping instruction is sent to the source worker node, wherein the partition stopping instruction causes the source worker node to stop serving the partition to be moved;
[0009] In a case where stop notification information of the source worker node is received, initialization processing is performed according to the first response information, and a target partition is obtained.
[0010] In a possible implementation, the first response information comprises metadata of the partition to be moved.
[0011] The preloading of the memory data of the partition to be moved according to the first response information comprises:
[0012] creating the target partition according to the metadata;
[0013] loading, in the target partition, part of the memory data of the partition to be moved according to the metadata, the part of the memory data comprising memory data that does not involve disk read / write.
[0014] In a possible implementation, the first response information comprises log replay information, the log replay information being used to indicate a starting point of replaying the log data.
[0015] The preloading of the log data of the partition to be moved according to the first response information comprises:
[0016] sending a pre-replay instruction to the source worker node;
[0017] In a case where the log replay information sent by the source worker node is received, loading, according to the log replay information, log data of the partition to be moved in the source worker node and not stored to a disk.
[0018] In a possible implementation, the preloading condition comprises that all log data of the partition to be moved in the source worker node is loaded, or the number of log data not loaded is less than or equal to a preset threshold.
[0019] In a possible implementation, the partition stop instruction is further used to cause the source worker node to release a partition lock of the partition to be moved,
[0020] The method further comprises:
[0021] In a case where the stop notification information sent by the source worker node is received, loading the partition lock of the partition to be moved.
[0022] In a possible implementation, the initialization processing according to the first response information comprises:
[0023] determining, according to the first response information, remaining memory data and remaining log data in the preloading process;
[0024] loading the remaining memory data and the remaining log data to obtain the target partition.
[0025] According to another aspect of the present disclosure, there is provided a partition moving method for a source worker node of a distributed system, comprising:
[0026] In a case where a partition moving instruction of a target worker node is received, generating metadata according to the partition moving instruction and sending to the target worker node, wherein the partition moving instruction is an instruction for moving a to-be-moved partition in the source worker node to the target worker node;
[0027] In a case where a pre-playback instruction of the target worker node is received, storing log data of the to-be-moved partition and sending log playback information to the target worker node, wherein the log playback information is used to indicate a starting point of playback of the log data;
[0028] In a case where a partition stop instruction of the target worker node is received, deleting the to-be-moved partition and sending stop notification information to the target worker node, wherein the partition stop instruction makes the source worker node stop service of the to-be-moved partition.
[0029] In a possible implementation, in a case where a pre-playback instruction of the target worker node is received, storing log data of the to-be-moved partition comprises:
[0030] Storing the log data of the to-be-moved partition to a disk;
[0031] Creating a log queue for buffering log data generated after the pre-playback instruction is received.
[0032] In a possible implementation, the method further comprises:
[0033] In a case where the partition stop instruction is received, releasing a partition lock of the to-be-moved partition.
[0034] According to another aspect of the present disclosure, there is provided a partition moving device, which is arranged in a target worker node of a distributed system, comprising:
[0035] A partition moving instruction sending module, configured to, in a case where a partition loading instruction of a management node of the distributed system is received, send a partition moving instruction to a source worker node, wherein the partition moving instruction is an instruction for moving a to-be-moved partition in the source worker node to the target worker node;
[0036] A pre-loading module, configured to, in a case where first response information of the source worker node is received, pre-load memory data and log data of the to-be-moved partition according to the first response information;
[0037] The partition stop instruction sending module is configured to send a partition stop instruction to the source-side worker node in a case where the preloaded log data meets a preloading condition, wherein the partition stop instruction causes the source-side worker node to stop serving the to-be-moved partition.
[0038] The target partition obtaining module is configured to, in a case where the stop notification information of the source-side worker node is received, perform initialization processing according to the first response information, and obtain a target partition.
[0039] In a possible implementation, the first response information includes metadata of the to-be-moved partition.
[0040] The preloading module is further configured to:
[0041] create the target partition according to the metadata;
[0042] load, according to the metadata, partial memory data of the to-be-moved partition in the target partition, wherein the partial memory data includes memory data that does not involve disk read / write.
[0043] In a possible implementation, the first response information includes log playback information, and the log playback information is used to indicate a starting point of playback of the log data.
[0044] The preloading module is further configured to:
[0045] send a pre-playback instruction to the source-side worker node;
[0046] In a case where the log playback information sent by the source-side worker node is received, load, according to the log playback information, log data of the to-be-moved partition in the source-side worker node that is not stored to a disk.
[0047] In a possible implementation, the preloading condition includes that all log data of the to-be-moved partition in the source-side worker node is loaded, or the number of log data that is not loaded is less than or equal to a preset threshold.
[0048] In a possible implementation, the partition stop instruction is further used to cause the source-side worker node to release a partition lock of the to-be-moved partition,
[0049] The apparatus further includes:
[0050] The partition lock loading module is configured to, in a case where the stop notification information sent by the source-side worker node is received, load a partition lock of the to-be-moved partition.
[0051] In a possible implementation, the target partition obtaining module is further configured to:
[0052] According to the first response information, determine remaining memory data and remaining log data in a preloading process;
[0053] Load the remaining memory data and the remaining log data to obtain the target partition.
[0054] According to another aspect of the present disclosure, a partition moving device is provided, which is arranged at a source working node of a distributed system, and includes:
[0055] A metadata sending module, configured to, in a case where a partition moving instruction of a target working node is received, generate metadata according to the partition moving instruction and send the metadata to the target working node, wherein the partition moving instruction is an instruction for moving a to-be-moved partition in the source working node to the target working node;
[0056] A log playback information sending module, configured to, in a case where a pre-playback instruction of the target working node is received, store log data of the to-be-moved partition and send log playback information to the target working node, wherein the log playback information is used to indicate a starting point of playback of the log data;
[0057] A stop notification information sending module, configured to, in a case where a partition stop instruction of the target working node is received, delete the to-be-moved partition and send stop notification information to the target working node, wherein the partition stop instruction causes the source working node to stop service of the to-be-moved partition.
[0058] In a possible implementation, the log playback information sending module is further configured to:
[0059] Store the log data of the to-be-moved partition to a disk;
[0060] Create a log queue, which is used to buffer log data generated after the pre-playback instruction is received.
[0061] In a possible implementation, the device further includes:
[0062] A partition lock releasing module, configured to, in a case where the partition stop instruction is received, release a partition lock of the to-be-moved partition.
[0063] According to an aspect of the present disclosure, a partition moving device is provided, which includes a processor, a memory for storing processor-executable instructions, and wherein the processor is configured to invoke the instructions stored in the memory to perform the above method.
[0064] According to an aspect of the present disclosure, a computer readable storage medium is provided, which stores computer program instructions. The computer program instructions are executed by a processor to implement the method described above.
[0065] According to the partition moving method of the embodiment of the present disclosure, the negotiation mechanism of the source working node and the target working node can be introduced. The target working node preloads part of the memory data and the log data of the to-be-moved partition through the mutual communication between the source working node and the target working node. When the preloading process reaches the preloading condition, the target working node only notifies the source working node to stop the service of the to-be-moved partition. The source working node and the target working node communicate with each other, and the target working node sends the stop notification information to the target working node, so that the target working node reduces the time for waiting for loading the partition lock. After the to-be-moved partition stops the service, the target working node only needs to load the remaining data to obtain the target partition, that is, the to-be-moved partition after moving, so as to restore the serviceable state of the target partition. The time-consuming of loading data of the target working node can be made to exist as much as possible before the source working node stops the service of the to-be-moved partition, so as to greatly shorten the time of the to-be-moved partition being not serviceable, and improve the convenience of the partition moving.
[0066] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, but not limiting the present disclosure. Other features and aspects of the present disclosure will be more apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, brief descriptions will be given below for the drawings needed to be used in the embodiments or prior art descriptions. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other embodiments can also be obtained from these drawings without creative labor,
[0068] Figure 1 A schematic diagram of a partition moving operation according to the related art is shown;
[0069] Figure 2 A flowchart of a partition moving method according to an embodiment of the present disclosure is shown;
[0070] Figure 3 A flowchart of a partition moving method according to an embodiment of the present disclosure is shown;
[0071] Figure 4 An application schematic diagram of a partition moving method according to an embodiment of the present disclosure is shown;
[0072] Figure 5 A block diagram of a partition moving device according to an embodiment of the present disclosure is shown;
[0073] Figure 6 a block diagram of a partitioned mobile device according to an embodiment of the present disclosure is shown;
[0074] Figure 7 a block diagram of a partitioned mobile device according to an embodiment of the present disclosure is shown;
[0075] Figure 8 a block diagram of a partitioned mobile device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0076] In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. Based upon the embodiments in the present disclosure, all other embodiments obtained by a person of ordinary skill in the art without creative effort should fall within the scope of the present disclosure.
[0077] The terms "first", "second", "third", "fourth" and the like in the description and claims of the present disclosure and above drawings (if any) are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in other than the order illustrated or described herein.
[0078] It should be understood that, in various embodiments of the present disclosure, the magnitude of the serial number of each process does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
[0079] It should be understood that, in the present disclosure, "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units need not be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0080] It should be understood that in the present disclosure, "multiple" refers to two or more. "And / or" is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the associated objects before and after it are in an "or" relationship. "Including A, B and C", "including A, B, C" means that A, B and C are all included, "including A, B or C" means that one of A, B and C is included, and "including A, B and / or C" means that any one or any two or three of A, B and C is included.
[0081] It should be understood that in the present disclosure, "B corresponding to A", "B corresponding to A", "A corresponding to B" or "B corresponding to A" means that B is associated with A, and B can be determined according to A. Determining B according to A does not mean that B is determined only according to A, but B can also be determined according to A and / or other information. The matching of A and B means that the similarity of A and B is greater than or equal to a preset threshold.
[0082] Depending on the context, "if" as used herein can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting".
[0083] The technical solutions of the present disclosure will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes can not be described in detail in some examples.
[0084] In the related art, in the partition moving operation process, the master node of the distributed system usually sends the unload partition instruction (Unload) to the source worker node (SourceWorker), and at the same time sends the load partition instruction (load) to the target worker node (TargetWorker), so as to complete the moving operation of the partition.
[0085] The master node mainly undertakes tasks such as metadata management and partition scheduling in the distributed system. The source worker node and the target worker node are both worker nodes in the distributed system, which are used to process read and write requests of users. The partition is a service unit in the distributed system, the whole data can be divided into multiple partitions, and multiple worker nodes are scheduled by the master node to process the read and write of each partition, so as to improve the parallel access ability of data and the service ability of the distributed system.
[0086] Figure 1 A schematic diagram of partition moving operation according to the related art is shown. In Figure 1 , the vertical direction is time, and the horizontal direction is the interaction direction of data.
[0087] AsFigure 1 As shown, in the case where a partition moving operation needs to be performed, the management node sends an instruction to unload the partition to the source worker node, and sends an instruction to load the partition to the target worker node, and the two nodes perform respective processing.
[0088] When the source worker node receives the instruction to unload the partition, the source worker node can delete the to-be-moved partition from the set of partitions served by the source worker node, i.e., the to-be-moved partition is no longer served, and the to-be-moved partition enters an unserveable state. Subsequently, the source worker node can perform unloading, deconstruction, and the like on the to-be-moved partition, and delete data of the to-be-moved partition. Further, in order to ensure that only one worker node serves a same partition at a same time, the source worker node loads a partition lock of the to-be-moved partition when serving the to-be-moved partition, so that other partitions cannot serve the to-be-moved partition, and the source worker node can release the partition lock of the to-be-moved partition during the partition moving process.
[0089] When the target worker node receives the instruction to load the partition, the target worker node can repeatedly attempt to acquire the lock, i.e., attempt to load the partition lock of the to-be-moved partition. Until the source worker node successfully releases the partition lock of the to-be-moved partition, the target worker node can load the partition lock of the to-be-moved partition, and thus can serve the to-be-moved partition. Subsequently, the target worker node can request metadata of the to-be-moved partition from the management node. The metadata can indicate attributes, structures, storage locations, and the like of data of the to-be-moved partition, and the target worker node can initialize a new partition according to the metadata after creating the new partition, i.e., create a data structure of the new partition, load data of the to-be-moved partition, and further, replay log data of the to-be-moved partition, i.e., import log data of the to-be-moved partition that has not yet been stored to the disk into the memory of the target worker node, for example, in the form of a MemFile file, and after the replay is completed, the to-be-moved partition can be moved to the target worker node. The target worker node can add the partition to a set of partitions served by the target worker node, and randomly start serving the partition, and the partition can resume normal operation and exit the unserveable state.
[0090] When generating log data, the source worker node can persistently store the log data in the form of a CommitLog file, and cache the log data in the form of a MemFile file in the memory. When the amount of data cached in the memory reaches a specific threshold, the source worker node can store the log data in the memory to the disk to form an immutable file with an index, for example, an ImmutableFile file. During the partition moving process, the log data in the disk does not need to be moved, and only the log data in the source worker node that has not yet been stored to the disk needs to be replayed, i.e., the target worker node imports the log data in the memory of the source worker node into the memory of the target worker node.
[0091] However, in the process of creating the partition by the target worker node, the time required for loading data, replaying log data and the like is long, that is, the time from when the target worker node obtains all information of the partition to when the target worker node is able to provide services is long, so that the time during which the partition is not serviceable is long, resulting in low convenience of moving the partition.
[0092] To shorten the time during which the partition is not serviceable and improve the convenience of moving the partition, the present disclosure provides a partition moving method, which can preload part of data in the target worker node before the source worker node stops providing services for the partition to be moved, so that the time required for the target worker node to load data is shortened after the source worker node stops providing services for the partition to be moved, thereby shortening the time during which the partition to be moved is not serviceable.
[0093] Figure 2 A flowchart of a partition moving method according to an embodiment of the present disclosure is shown in FIG. 1. Figure 2 As shown in FIG. 1, the method is used for a target worker node of a distributed system, and can include the following steps.
[0094] In step S11, a partition moving instruction is sent to a source worker node in a case where a partition loading instruction of a management node of the distributed system is received, where the partition moving instruction is an instruction for moving a partition to be moved in the source worker node to the target worker node.
[0095] In step S12, memory data and log data of the partition to be moved are preloaded according to first response information in a case where the first response information of the source worker node is received.
[0096] In step S13, a partition stop instruction is sent to the source worker node in a case where the preloaded log data meets a preloading condition, where the partition stop instruction causes the source worker node to stop providing services for the partition to be moved.
[0097] In step S14, initialization processing is performed according to the first response information to obtain a target partition in a case where stop notification information of the source worker node is received.
[0098] According to the partition moving method of the embodiment of the present disclosure, the target worker node can be enabled to preload part of the memory data and log data of the to-be-moved partition by means of the communication between the source worker node and the target worker node. When the preloading process reaches a preloading condition, the target worker node can only notify the source worker node to stop serving the to-be-moved partition. After the to-be-moved partition stops serving, the target worker node only needs to load the remaining data to obtain the target partition, i.e., the to-be-moved partition after moving, so as to restore the target partition to a serviceable state. Thus, the time during which the to-be-moved partition is not serviceable is greatly shortened, and the convenience of partition moving is improved.
[0099] In a possible implementation, when it is needed to move the to-be-moved partition in the source worker node to the target worker node, the management node can send a partition loading instruction to the target worker node and a partition unloading instruction to the source worker node. In step S11, the source worker node, upon receiving the partition unloading instruction, can not perform any processing but wait for the communication with the target worker node. The target worker node, upon receiving the partition loading instruction, can establish communication with the source worker node and send a partition moving instruction to the source worker node, so as to perform preloading of data.
[0100] In a possible implementation, the source worker node, upon receiving the partition moving instruction, can respond to the instruction, i.e., send first response information to the target worker node. For example, the partition moving instruction is used to request some data of the source worker node, and the source worker node can reply the data to the target worker node as the first response information, so that the target worker node can perform preloading of data based on the data.
[0101] In a possible implementation, in step S12, the target worker node can receive the first response information of the source worker node and perform preloading of part of the memory data and log data of the to-be-moved partition in the source worker node based on the first response information. In an example, preloading of part of the data can reduce the loading time of the target worker node after the source worker node stops serving the to-be-moved partition. However, before the source worker node stops serving the to-be-moved partition after preloading of part of the data, the source worker node still serves the to-be-moved partition and can perform disk read-write processing. Therefore, in order to keep the data of the target partition after moving consistent with the data of the to-be-moved partition before moving, only the data that does not involve disk read-write processing (e.g., data that does not change any more) can be loaded during preloading, and other data can be loaded after the source worker node stops serving the to-be-moved partition. Thus, the data of the target partition obtained after moving is kept consistent with the data of the to-be-moved partition before moving.
[0102] In a possible implementation, the first response information can include metadata of the to-be-moved partition; and step S12 can include: preloading, according to the first response information, the memory data of the to-be-moved partition, including: creating the target partition according to the metadata; and loading, according to the metadata, part of the memory data of the to-be-moved partition in the target partition, the part of the memory data including the memory data that does not involve disk read / write.
[0103] In a possible implementation, as described above, the metadata can indicate the attribute, structure, storage location and the like of the data of the to-be-moved partition, and the target worker node can create a new partition, for example, a target partition, according to the metadata, and currently, there is no data in the target partition, but the structure and capacity of the target partition can be used to store the data in the to-be-moved partition.
[0104] In a possible implementation, after the target partition is created, the target worker node can pre-load part of the data, for example, part of the memory data of the to-be-moved partition of the source worker node and related components according to the information such as the storage location and the data structure indicated by the metadata, where the memory data can include the memory data that does not involve disk read / write as described above, and the related components can include components for data read / write and the like, and the present disclosure does not limit the type of the memory data and the components.
[0105] In a possible implementation, further, in step S12, part of the log data of the to-be-moved partition can also be loaded, thereby reducing the amount of log data that needs to be played back after the source worker node stops providing services for the to-be-moved partition, and reducing the time when the to-be-moved partition is not in service.
[0106] In a possible implementation, the first response information includes log playback information, and the log playback information is used to indicate a starting point of playing back the log data; and step S12 can include: sending a pre-playback instruction to the source worker node; and in a case where the log playback information sent by the source worker node is received, loading, according to the log playback information, the log data of the to-be-moved partition in the source worker node that is not stored to the disk.
[0107] In a possible implementation, the target worker node can send a pre-playback instruction to the source worker node, and the source worker node can store all the log data buffered in the current memory to the disk after receiving the pre-playback instruction, so that the target worker node does not need to play back the log data again, thereby reducing the amount of data played back and the playback time. However, at the current time, the source worker node has not stopped serving the to-be-moved partition, and therefore, new log files can be generated. Therefore, the source worker node can continue to buffer the subsequently generated log data in the memory, and therefore, the target worker node can load the above-mentioned subsequently generated log data of the source worker node. The source worker node can send log playback information to the target worker node, that is, identification information (for example, a time identifier or a sequence identifier of the log data) indicating a starting point of log data playback, and the log data subsequently generated for the source worker node is after the starting point. The target worker node can load the log data after the starting point according to the log playback information.
[0108] In a possible implementation, the target worker node and the source worker node can iteratively perform the above-mentioned processing of playing back log data for multiple times. In an example, the target worker node can load the log data after the starting point indicated by the log playback information, while the source worker node can continue to generate new log data, and the source worker node can also move the starting point indicated by the log playback information to after the last log data loaded by the target worker node last time, and generate log playback information based on the new starting point and send the log playback information to the target worker node, and the target worker node can continue to load the log data after the starting point of the source worker node based on the log playback information. The above process can be iteratively performed for multiple times until the log data loaded by the target worker node meets the pre-loading condition.
[0109] In a possible implementation, the pre-loading condition includes that all the log data of the to-be-moved partition in the source worker node is loaded, or the number of log data not loaded is less than or equal to a preset threshold, that is, the gap (for example, a time gap or a sequence gap) between the earliest log data and the latest generated log data in the log data not loaded is less than or equal to the preset threshold.
[0110] In a possible implementation, in step S13, if the log data pre-loaded by the target worker node meets the above-mentioned pre-loading condition, the source worker node can be sent a partition stop instruction to stop serving the to-be-moved partition. The target worker node can delete the to-be-moved partition from the partition set of the target worker node after receiving the partition stop instruction, and the to-be-moved partition enters an unserviceable state.
[0111] In a possible implementation, the source worker node can further unload, deconstruct, or delete the data of the to-be-moved partition, and release the partition lock of the to-be-moved partition.
[0112] In a possible implementation, the partition stop instruction is further used to make the source worker node release the partition lock of the to-be-moved partition, and to make the target worker node load the partition lock of the to-be-moved partition for providing service to the moved target partition after the moving. As described above, in the prior art, the target worker node cannot know when the source worker node releases the partition lock, and thus the target worker node can repeatedly perform the lock loading process. If the target worker node performs the lock loading process every certain time period, there can be a case that the source worker node has released the partition lock, but the certain time period has not ended. Therefore, there is a time difference between the lock loading process of the target worker node and the process of releasing the partition lock by the source worker node, and the time difference exists after the to-be-moved partition enters the non-serviceable state, and thus the existence of the time difference prolongs the time of the to-be-moved partition in the non-serviceable state.
[0113] In a possible implementation, to solve the above problem, the method further includes: loading the partition lock of the to-be-moved partition in a case that the stop notification information sent by the source worker node is received. The source worker node can send the stop notification information to the target worker node after releasing the partition lock, so that the target worker node obtains the information that the partition lock has been released, and performs the lock loading process, thereby reducing the time difference between the lock loading process of the target worker node and the process of releasing the partition lock by the source worker node, and reducing the time of the to-be-moved partition in the non-serviceable state.
[0114] In a possible implementation, after the source worker node removes the to-be-moved partition and releases the partition lock in step S14, the above stop notification information can be sent to the target worker node. In a case that the stop notification information is received, the target worker node can perform the lock loading process, and after the lock loading succeeds, perform the initialization process on the target partition, that is, perform the initialization process according to the first response information, load the memory data and the log data that are not loaded in the preloading, and obtain the target partition.
[0115] In a possible implementation, the step S14 can include: determining, according to the first response information, remaining memory data and remaining log data in the preloading process; and loading the remaining memory data and the remaining log data to obtain the target partition. In an example, the memory data loaded in the preloading process is loaded according to the indication of the metadata, and therefore, the remaining memory data can be loaded based on the metadata. For example, some memory data has interaction behavior with the disk in the preloading process, and therefore, these data are not loaded in the preloading process. After the source-side working node stops serving the to-be-moved partition, these data will not change any more, and therefore, the above-mentioned remaining memory data that is not loaded can be loaded in the initialization process.
[0116] In a possible implementation, as described above, the preloading condition includes that all log data of the to-be-moved partition in the source-side working node is loaded, or the number of log data that is not loaded is less than or equal to a preset threshold. That is, there can be log data that is not loaded in the preloading stage, and therefore, the above-mentioned remaining log data that is not loaded can be loaded in the pre-processing process to obtain the target partition. The amount of data of the remaining log data that is loaded can be small, the playback time required is short, and the time of the to-be-moved partition in the non-serviceable state can be reduced.
[0117] In a possible implementation, after the target partition is obtained, the target working node can add the target partition to the partition set of the target working node, that is, the target working node serves the target partition, and the target partition can end the non-serviceable state immediately. After the target working node serves the target partition, the target working node can send information to the management node, for example, send the metadata of the target partition and the like, so that the management node can manage and control the target working node and the target partition.
[0118] According to the partition moving method provided in the embodiments of the present disclosure, a negotiation mechanism of the source-side working node and the target working node can be introduced, the target working node preloads part of the memory data and the log data of the to-be-moved partition through mutual communication of the source-side working node and the target working node, and the target working node notifies the source-side working node to stop serving the to-be-moved partition only when the preloading process reaches the preloading condition. The source-side working node and the target working node communicate with each other to send the stop notification information to the target working node, so that the target working node reduces the time of waiting for loading the partition lock. After the to-be-moved partition stops serving, the target working node only needs to load the remaining data to obtain the target partition, that is, the to-be-moved partition after moving, so that the target partition restores the serviceable state. The time-consuming of loading data of the target working node can be made to exist as much as possible before the source-side working node stops serving the to-be-moved partition, so that the time of the to-be-moved partition in the non-serviceable state is greatly shortened, and the convenience of partition moving is improved.
[0119] Figure 3 A flow chart of a partition moving method according to an embodiment of the present disclosure is shown, which is used for a source end worker node of a distributed system, as shown in Figure 3 The method comprises the following steps:
[0120] In step S21, in a case where a partition moving instruction of a target worker node is received, metadata is generated according to the partition moving instruction, and is sent to the target worker node, wherein the partition moving instruction is an instruction for moving a to-be-moved partition in the source end worker node to the target worker node;
[0121] In step S22, in a case where a pre-playback instruction of the target worker node is received, log data of the to-be-moved partition is stored, and log playback information is sent to the target worker node, wherein the log playback information is used to indicate a starting point of playback of the log data;
[0122] In step S23, in a case where a partition stop instruction of the target worker node is received, the to-be-moved partition is deleted, and stop notification information is sent to the target worker node, wherein the partition stop instruction makes the source end worker node stop service of the to-be-moved partition.
[0123] In a possible implementation, as described above, in a case where a partition unloading instruction is received by the source end worker node, no processing is performed, but the target worker node is waited to communicate with itself, that is, in step S21, in a case where a partition moving instruction sent by the target worker node is received, metadata of the to-be-moved partition is sent to the target worker node based on a request for the metadata of the to-be-moved partition in the partition moving instruction.
[0124] In a possible implementation, in step S22, the target worker node can preload memory data in the metadata, and send a pre-playback instruction to the source end worker node. In a case where the pre-playback instruction of the target worker node is received, step S22 comprises: storing log data of the to-be-moved partition to a disk; creating a log queue, which is used to buffer log data generated after the pre-playback instruction is received. That is, log data before the pre-playback instruction is received is stored to the disk to form an immutable file with an index, and the target worker node can not need to play back this part of log data. At this time, the source end worker node has not stopped service of the to-be-moved partition, and thus new log data can be generated, which can be buffered in the log queue, and the log queue can be created in the memory of the source end worker node.
[0125] In one possible implementation, in step S23, if the target worker node meets the preloading conditions, it can send a partition stop command to the source worker node. Upon receiving the partition stop command, the source worker node can delete the partition to be moved from its own partition set, causing the partition to be moved to enter an unserviceable state. It then performs unloading, destruction, and other processing on the partition to be moved.
[0126] In one possible implementation, the method further includes: upon receiving the partition stop instruction, releasing the partition lock of the partition to be moved. To enable the target worker node to provide services for the partition to be moved, the source worker node may release the partition lock, allowing the target worker node to load the partition lock. Furthermore, to reduce the time difference between the target worker node loading the partition lock and the source worker node releasing the partition lock, and to shorten the time the partition to be moved is in an unserviceable state, the source worker node may also send a stop notification to the target worker node to notify the target worker node to attempt to acquire the lock.
[0127] In one possible implementation, after the above processing is completed, the partition to be moved is completely removed from the source worker node. The source worker node can send the above stop notification information to the target worker node, so that the target worker node can compete for the lock. After successfully competing for the lock, the remaining memory data and remaining log data are loaded to obtain the target partition, and then the process of moving the partition to be moved from the source worker node to the target worker node is completed.
[0128] Figure 4 This diagram illustrates an application of the partition movement method according to an embodiment of the present disclosure. Figure 4 In the diagram, the vertical direction represents time, and the horizontal direction represents the data interaction direction.
[0129] like Figure 4 As shown, when it is necessary to move the partition to be moved in the source working node to the target working node, the control node can send a partition load command to the target working node and a partition unload command to the source working node. When the target working node receives the partition load command, it can send a partition move command to the source working node. When the source working node receives the partition unload command, it can perform no processing.
[0130] In a possible implementation, the source worker node can send the metadata to the target worker node upon receiving the partition moving instruction, and the target worker node can create the partition based on the metadata, that is, create the target partition, and pre-load the memory data of the to-be-moved partition of the source worker node that does not involve disk read / write based on the metadata. The target worker node can also send a pre-playback instruction to the source worker node, and the source worker node can store the log data generated before the pre-playback instruction to the disk upon receiving the pre-playback instruction, so that the target worker node does not need to play back the log data. The target worker node can also create a log queue in the memory, buffer the log data generated after the pre-playback instruction in the log queue, and send log playback information indicating a log playback starting point to the target worker node.
[0131] In a possible implementation, the target worker node can load the log data from the log queue of the source worker node according to the log playback information, and in a case where the source worker node continuously generates new log data, the target worker node can iteratively perform the processing of loading the log data until all the log data in the log queue is loaded or the number of log data that has not been loaded is less than or equal to a preset threshold.
[0132] In a possible implementation, after the above condition is met, the target worker node can send a partition stop instruction to the source worker node, and the source worker node can delete the to-be-moved partition from the partition set of the source worker node upon receiving the partition stop instruction, so as to stop serving the to-be-moved partition, and the to-be-moved partition enters an unserviceable state.
[0133] In a possible implementation, to enable the target worker node to serve the moved to-be-moved partition, the source worker node can release the partition lock, and send a stop notification information to the target worker node after the release is successful. The target worker node can immediately perform lock grabbing upon receiving the stop notification information, so as to reduce the time difference between the lock grabbing processing of the target worker node and the partition lock release processing of the source worker node, and reduce the time for which the to-be-moved partition is in the unserviceable state.
[0134] In a possible implementation, after the target worker node successfully performs lock grabbing, the target partition can be initialized. The remaining memory data can be loaded, and the remaining log data can be played back, and then the target partition can be obtained. After the target partition is added to the partition set of the target worker node, the target worker node can serve the target partition, that is, the target partition ends the unserviceable state.
[0135] Figure 5 A block diagram of a partition moving apparatus according to an embodiment of the present disclosure is shown as follows, Figure 5 As shown in the figure, the apparatus is arranged at a target worker node of a distributed system, and includes:
[0136] The partition moving instruction sending module 11 is configured to, in a case where the partition loading instruction of the management node of the distributed system is received, send a partition moving instruction to the source end working node, wherein the partition moving instruction is an instruction for moving a to-be-moved partition in the source end working node to the target working node.
[0137] The preloading module 12 is configured to, in a case where the first response information of the source end working node is received, pre-load memory data and log data of the to-be-moved partition according to the first response information.
[0138] The partition stopping instruction sending module 13 is configured to, in a case where the preloaded log data satisfies a preloading condition, send a partition stopping instruction to the source end working node, wherein the partition stopping instruction causes the source end working node to stop service of the to-be-moved partition.
[0139] The target partition obtaining module 14 is configured to, in a case where stop notification information of the source end working node is received, perform initialization processing according to the first response information, and obtain a target partition.
[0140] In a possible implementation, the first response information includes metadata of the to-be-moved partition.
[0141] The preloading module is further configured to:
[0142] create the target partition according to the metadata;
[0143] load, according to the metadata, part of memory data of the to-be-moved partition in the target partition, wherein the part of memory data includes memory data that does not involve disk read / write.
[0144] In a possible implementation, the first response information includes log playback information, and the log playback information is used to indicate a starting point of playback of the log data.
[0145] The preloading module is further configured to:
[0146] send a pre-playback instruction to the source end working node;
[0147] In a case where the log playback information sent by the source end working node is received, load, according to the log playback information, log data of the to-be-moved partition in the source end working node that is not stored to a disk.
[0148] In a possible implementation, the preloading condition includes that all log data of the to-be-moved partition in the source end working node is loaded, or a quantity of log data that is not loaded is less than or equal to a preset threshold.
[0149] In a possible implementation, the partition stopping instruction is further used to make the source worker node release the partition lock of the partition to be moved,
[0150] The apparatus further includes:
[0151] The partition lock loading module is configured to load the partition lock of the partition to be moved in a case where the stop notification information sent by the source worker node is received.
[0152] In a possible implementation, the target partition obtaining module is further configured to:
[0153] determine, according to the first response information, remaining memory data and remaining log data in the preloading process;
[0154] load the remaining memory data and the remaining log data, and obtain the target partition.
[0155] Figure 6 A block diagram of a partition moving apparatus according to an embodiment of the present disclosure is shown in FIG. 1. Figure 6 As shown in FIG. 1, the apparatus is arranged at a source worker node of a distributed system, and includes:
[0156] The metadata sending module 21 is configured to generate metadata according to a partition moving instruction and send the metadata to a target worker node in a case where the partition moving instruction is received, wherein the partition moving instruction is an instruction for moving a partition to be moved in the source worker node to the target worker node;
[0157] The log playback information sending module 22 is configured to store log data of the partition to be moved and send log playback information to the target worker node in a case where a pre-playback instruction is received, wherein the log playback information is used to indicate a starting point of playing back the log data;
[0158] The stop notification information sending module 23 is configured to delete the partition to be moved and send stop notification information to the target worker node in a case where a partition stopping instruction is received, wherein the partition stopping instruction makes the source worker node stop serving the partition to be moved.
[0159] In a possible implementation, the log playback information sending module is further configured to:
[0160] store the log data of the partition to be moved to a disk;
[0161] create a log queue, wherein the log queue is used to buffer log data generated after the pre-playback instruction is received.
[0162] In a possible implementation, the apparatus further includes:
[0163] a partition lock releasing module, configured to release the partition lock of the to-be-moved partition in a case where the partition stop instruction is received.
[0164] In some embodiments, the apparatus provided by the embodiments of the present disclosure has functions or includes modules that can be used to perform the methods described in the above method embodiments, and the specific implementation can refer to the description of the above method embodiments. For brevity, details are not repeated here.
[0165] The embodiments of the present disclosure also provide a computer-readable storage medium having computer program instructions stored therein, and the computer program instructions are executed by a processor to implement the above method. The computer-readable storage medium can be a non-volatile computer-readable storage medium.
[0166] The embodiments of the present disclosure also provide a partition moving device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
[0167] The embodiments of the present disclosure also provide a computer program product, including computer readable code, when the computer readable code is run on a device, a processor in the device executes instructions for implementing the cloud application management method provided by any of the above embodiments.
[0168] The embodiments of the present disclosure also provide another computer program product for storing computer readable instructions, which are executed to cause a computer to perform the operations of the cloud application management method provided by any of the above embodiments.
[0169] The device can be provided as a terminal, a server or other forms of devices.
[0170] Figure 7 A block diagram of a partition moving device 800 according to an embodiment of the present disclosure is shown. For example, the device 800 can be a terminal device such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0171] Referring to Figure 7 , the device 800 can include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0172] The processing component 802 generally controls the overall operations of the device 800, such as the operations associated with display, telephony calls, data communication, camera operations, and recording operations. The processing component 802 can include one or more processors 820 to execute instructions delivered from the memory 804 to complete all or part of the steps of the methods described above. In addition, the processing component 802 can include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0173] The memory 804 is configured to store various types of data to support the operations of the device 800. Examples of these data include instructions for any application or method operating on the device 800, contact data, phonebook data, messages, pictures, videos, and so on. The memory 804 can be realized by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic or optical disk.
[0174] The power component 806 provides power to the various components of the device 800. The power component 806 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0175] The multimedia component 808 includes a screen providing an output interface between the device 800 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide, and a gesture on the touch panel. The touch sensors can not only sense a position of a touch or a slide, but also detect a duration and a pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a back camera. The front camera and / or the back camera can receive external multimedia data when the device 800 is in an operation mode, such as a shooting mode or a video mode. Each of the front and back cameras can be a fixed optical lens system or have a focal length and optical zoom capability.
[0176] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive an external audio signal when the device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0177] The input / output interface 812 provides an interface between the processing component 802 and peripheral interface modules, which can include a keypad, a click wheel, buttons, and so on. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0178] The sensor component 814 includes one or more sensors for providing status assessments of various aspects of the device 800. For example, the sensor component 814 can detect an open / closed position of the device 800, relative positioning of components, such as a display and a keypad of the device 800, a change of position of the device 800 or a component of the device 800, presence or absence of user contact with the device 800, orientation or acceleration / deceleration / g-force and temperature of the device 800. The sensor component 814 can include an orientation sensor, an altimeter, a proximity sensor, a
[0179] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and another device. The device 800 can access a wireless network based on a corresponding communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an example embodiment, the communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 816 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.
[0180] In exemplary embodiments, the device 800 can be implemented using one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components, for performing the above-described methods.
[0181] In exemplary embodiments, a non-transitory computer readable storage medium, such as the memory 804 including computer program instructions, is also provided, which can be executed by the processor 820 of the device 800 to complete the above-described methods.
[0182] Figure 8 A block diagram of a partitioned mobile device 1900 is shown, in accordance with embodiments of the present disclosure. For example, the electronic device 1900 can be provided as a server or a terminal. Referring to Figure 8 , the electronic device 1900 includes a processing unit 1922, which further includes one or more processors, and memory resources represented by a storage unit 1932, for storing instructions, such as application programs, executable by the processing unit 1922. The application programs stored in the storage unit 1932 can include one or more than one module each corresponding to a set of instructions. In addition, the processing unit 1922 is configured to execute the instructions to perform the above-described methods.
[0183] The electronic device 1900 can also include a power supply unit 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958. The electronic device 1900 can operate based on an operating system stored in the storage unit 1932, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM or the like.
[0184] In exemplary embodiments, a non-transitory computer readable storage medium, such as the storage unit 1932 including computer program instructions, is also provided, which can be executed by the processing unit 1922 of the electronic device 1900 to complete the above-described methods.
[0185] The present disclosure can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present disclosure.
[0186] Computer readable storage media can be tangible storage media which can retain and store instructions for use by an instruction execution device. Computer readable storage media can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer readable storage media include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
[0187] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.
[0188] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.
[0189] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0190] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other data storage device. When the computer readable program instructions are loaded into the computer and other programmable data processing apparatus, a series of operational steps are implemented that provide processes such that the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0191] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0192] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0193] The computer program product can be specifically realized by means of hardware, software or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as a computer storage medium, and in another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK) or the like.
[0194] It can be understood that the above-mentioned embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Limited to the length of the present disclosure, the present disclosure will not be described again. Those skilled in the art can understand that the specific execution order of each step in the above-mentioned method of the specific embodiment should be determined according to its function and possible internal logic.
[0195] It is noted that all features disclosed in this specification, including any accompanying claims, abstract, and drawings, can be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise. Thus, unless expressly stated otherwise, each feature disclosed in this specification is one example only of a generic series of equivalent or similar features. Further, any part of the described embodiments can be further developed or modified without departing from the scope of the present disclosure. Any further developments or modifications, which are within the scope of the present disclosure, are to be considered as part of the present disclosure.
[0196] It is to be understood that the embodiments of the application described above and illustrated in the drawings are merely by way of example and are not limiting of the application. The objectives of the application have been fully achieved and any modifications or improvements which are within the scope of the application are considered to be part of the application. The principles and concepts of the application have been illustrated and described in the embodiments, and the embodiments of the application can be modified or changed without departing from the principles and concepts.
[0197] Finally, it should be noted that the above-described embodiments are merely intended for describing and illustrating, but not limiting the technical solutions of the present disclosure. Although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified or changed, or some or all of the technical features can be replaced by equivalent replacements. Such modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A method of partition movement, characterized by, The method is used for a target working node of a distributed system, and comprises: In a case where a partition loading instruction of a management node of the distributed system is received, a partition moving instruction is sent to a source working node, wherein the partition moving instruction is an instruction for moving a to-be-moved partition in the source working node to the target working node; In a case where first response information of the source working node is received, memory data and log data of the to-be-moved partition are preloaded according to the first response information; In a case where the preloaded log data meets a preloading condition, a partition stopping instruction is sent to the source working node, wherein the partition stopping instruction causes the source working node to stop service of the to-be-moved partition; In a case where stop notification information of the source working node is received, initialization processing is performed according to the first response information, and a target partition is obtained.
2. The method of claim 1, wherein, The first response information comprises metadata of the to-be-moved partition; The preloading of the memory data of the to-be-moved partition according to the first response information comprises: The target partition is created according to the metadata; Part of the memory data of the to-be-moved partition is loaded in the target partition according to the metadata, and the part of the memory data comprises memory data that does not involve disk read / write.
3. The method of claim 1, wherein, The first response information comprises log playback information, and the log playback information is used to indicate a starting point of playback of the log data; The preloading of the log data of the to-be-moved partition according to the first response information comprises: A pre-playback instruction is sent to the source working node; In a case where the log playback information sent by the source working node is received, log data of the to-be-moved partition in the source working node that is not stored to a disk is loaded according to the log playback information.
4. The method of claim 1, wherein, The preloading condition comprises that all the log data of the to-be-moved partition in the source working node is loaded, or the number of log data that is not loaded is less than or equal to a preset threshold.
5. The method of claim 1, wherein, The partition stopping instruction is also used to cause the source working node to release a partition lock of the to-be-moved partition, The method further comprises: In a case where stop notification information sent by the source working node is received, a partition lock of the to-be-moved partition is loaded.
6. The method of claim 1, wherein, The initialization processing according to the first response information to obtain the target partition comprises: According to the first response information, remaining memory data and remaining log data in a preloading process are determined; The remaining memory data and the remaining log data are loaded to obtain the target partition.
7. A method of partitioning movement, comprising: The method is used for a source working node of a distributed system, and comprises: In a case where a partition moving instruction of a target working node is received, metadata is generated according to the partition moving instruction and is sent to the target working node, wherein the partition moving instruction is an instruction for moving a to-be-moved partition in the source working node to the target working node; In a case where the pre-replay instruction of the target worker node is received, log data of the to-be-moved partition is stored, and log replay information is sent to the target worker node, the log replay information being used to indicate a starting point of replaying the log data; In a case where the partition stop instruction of the target worker node is received, the to-be-moved partition is deleted, and stop notification information is sent to the target worker node, wherein the partition stop instruction causes the source worker node to stop service of the to-be-moved partition.
8. The method of claim 7, wherein, In a case where the pre-replay instruction of the target worker node is received, log data of the to-be-moved partition is stored, and log replay information is sent to the target worker node, the log replay information being used to indicate a starting point of replaying the log data; The log data of the to-be-moved partition is stored to a disk; A log queue is created, and the log queue is used to buffer log data generated after the pre-replay instruction is received.
9. The method of claim 7, wherein, The method further includes: In a case where the partition stop instruction is received, a partition lock of the to-be-moved partition is released.
10. A partitioned mobile device, comprising: It includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to perform the method of any one of claims 1 to 9. 11.A computer-readable storage medium having computer program instructions stored thereon, the computer program instructions being executed by a processor to implement the method of any one of claims 1 to 9.
Citation Information
Patent Citations
Sharing data on mobile devices
CN103140850A
Data sending method and device, node starting method and device, equipment and computer readable medium
CN114637468A