Data processing method and device, electronic equipment and storage medium

Through the Kafka hierarchical storage architecture, combined with local and cloud storage, the data migration strategy is optimized, which solves the problem of low data migration efficiency when expanding the Kafka cluster, and achieves minute-level migration and resource saving.

CN118540334APending Publication Date: 2024-08-23XIAOHONGSHU TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410665571.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

When the Kafka cluster is expanded, data migration efficiency is low, resulting in long migration time and occupying a large amount of network bandwidth, resulting in online delays and resource waste.

Method used

By building a Kafka hierarchical storage architecture, using the combination of local storage and cloud storage, we optimize the data migration strategy and only synchronize target data that has not been uploaded to the cloud, thereby improving data migration efficiency and reducing storage space requirements.

Benefits of technology

It achieves minute-level data migration, improves the expansion and contraction capabilities of the Kafka cluster, reduces storage costs and migration time, and avoids repeated backups and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540334A
    Figure CN118540334A
Patent Text Reader

Abstract

The invention provides a data processing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining an initial offset of a first node in a target partition through receiving a message synchronization request sent by a newly accessed second node in the target partition; determining a target offset according to the initial offset and a global message offset of the target partition, the target offset including a first offset and a second offset; total data stored by the first node are included between the initial offset and the first offset, cloud data uploaded to the cloud by the first node are included between the initial offset and the second offset, and target data not uploaded to the cloud by the first node are included between the first offset and the second offset; and synchronizing the target data between the first offset and the second offset to the second node. According to the method, the local data storage pressure of the distributed platform can be improved and relieved, and the data migration efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device, electronic device and computer-readable storage medium. Background Art

[0002] Kafka (distributed stream processing platform) uses a combination of memory and disk to achieve high throughput, low latency and reliable message delivery through reasonable caching and persistence mechanisms.

[0003] However, when Kafka is expanded, the data on the old Broker (Broke refers to a node in the Kafka cluster, that is, the server running the Kafka service) needs to be moved to the new Broker. Broker refers to a node in the Kafka cluster, that is, the server running the Kafka service. Each Broker can store data from multiple partitions under multiple topics, where each partition contains a master node and multiple slave nodes.

[0004] If the Broker contains a large amount of data, migrating the data often takes several hours or even dozens of hours, resulting in very low data migration efficiency. Summary of the invention

[0005] The embodiments of the present application provide a data processing method, device, electronic device, and computer-readable storage medium, which are intended to alleviate the local data storage pressure of a distributed platform and thereby improve data migration efficiency.

[0006] In a first aspect, an embodiment of the present application provides a data processing method, comprising:

[0007] Receive a message synchronization request sent by a newly connected second node in the target partition, and obtain a starting offset of a first node in the target partition;

[0008] Determine a target offset according to the starting offset and the global message offset of the target partition, wherein the target offset includes a first offset and a second offset; the area between the starting offset and the first offset includes the full amount of data stored by the first node, the area between the starting offset and the second offset includes the cloud data uploaded to the cloud by the first node, and the area between the first offset and the second offset includes the target data not uploaded to the cloud by the first node;

[0009] The target data between the first offset and the second offset is synchronized to the second node.

[0010] In a second aspect, an embodiment of the present application provides a data processing device, including:

[0011] An acquisition module, configured to receive a message synchronization request sent by a newly connected second node in a target partition, and acquire a starting offset of a first node in the target partition;

[0012] A determination module, configured to determine a target offset according to the starting offset and the global message offset of the target partition, wherein the target offset includes a first offset and a second offset; the area between the starting offset and the first offset includes the full amount of data stored by the first node, the area between the starting offset and the second offset includes the cloud data uploaded to the cloud by the first node, and the area between the first offset and the second offset includes the target data not uploaded to the cloud by the first node;

[0013] A synchronization module is used to synchronize the target data between the first offset and the second offset to the second node.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the above-mentioned data processing method.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the above-mentioned data processing method.

[0016] Beneficial effects of the embodiments of the present application:

[0017] In this embodiment, the first node can receive a message synchronization request sent by a newly connected second node in the target partition, obtain the starting offset of the target partition, and then determine the target offset including the first offset and the second offset based on the above starting offset and the global message offset of the target partition, wherein the area between the starting offset and the first offset includes the full data stored by the first node, the area between the starting offset and the second offset includes the cloud data uploaded to the cloud by the first node, and the area between the first offset and the second offset includes the target data not uploaded to the cloud by the first node. On this basis, the target data not uploaded to the cloud can be synchronized to the second node, avoiding the prior art of directly synchronizing the full data of the first node to the second node, but synchronizing the target data not uploaded to the cloud at the second node. This embodiment can not only improve the efficiency of data synchronization between nodes in the partition during the expansion and contraction of the distributed platform, but also reduce the storage space requirements of the distributed platform, thereby reducing storage costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 is a schematic diagram of a hierarchical storage architecture provided in an embodiment of the present application;

[0020] Figure 2 It is a schematic diagram of the first data synchronization process provided in an embodiment of the present application;

[0021] Figure 3 This is a first schematic diagram of data synchronization provided in an embodiment of the present application;

[0022] Figure 4 This is a second schematic diagram of data synchronization provided in an embodiment of the present application;

[0023] Figure 5 It is a schematic diagram of the architecture of the second process of data synchronization in an embodiment of the present application;

[0024] Figure 6 is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0025] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application. In addition, it should be understood that the specific implementation methods described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In the present application, unless otherwise specified, the directional words such as "upper" and "lower" used generally refer to the upper and lower parts of the device in actual use or working state, specifically the drawing direction in the drawings; while "inside" and "outside" refer to the outline of the device. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0027] Apache Kafka is an open source distributed stream processing platform with the following features:

[0028] Messaging system: Kafka provides a high-throughput, persistent messaging system that allows producers to publish messages to specific topics, and consumers can subscribe to these topics to receive messages;

[0029] Distributed storage: Kafka's message storage is distributed and divided into multiple partitions. Each partition is an ordered, immutable message log. Partitions allow Kafka to scale horizontally across multiple nodes, providing high throughput and fault tolerance. Each partition has a Leader (master node) replica that is responsible for processing read and write requests. Other replicas are called Follower replicas, which are used to provide redundancy and fault tolerance. If the Leader fails, a Follower (slave node) will be elected as the new Leader.

[0030] Real-time stream processing: Kafka is not just a message queue, it also supports real-time stream processing. Through the KafkaStreams API or other stream processing frameworks, developers can build complex real-time applications on Kafka to process and analyze data streams.

[0031] Persistence: Kafka ensures data persistence by persisting messages on disk. This allows consumers to still get unread messages even if they are offline;

[0032] Replication and fault tolerance: Kafka has a partition replication mechanism, which allows replicas of partitions to be retained on multiple nodes to improve the availability and fault tolerance of the system;

[0033] Horizontal scalability: Kafka’s distributed architecture allows for easy horizontal scaling when needed to accommodate growing workloads.

[0034] Ecosystem: Kafka has a rich ecosystem, including various tools and libraries, such as Kafka Connect for data integration, Schema Registry for message format management, and Kafka Streams for stream processing.

[0035] In general, Apache Kafka is a powerful stream processing platform that is widely used in scenarios such as building real-time data pipelines, event-driven microservice architectures, and log aggregation.

[0036] In the existing Kafka architecture, all data is stored in the local cloud disk, and storage and computing are integrated, which leads to at least the following problems:

[0037] (1) Short storage time for business topics: Currently, a broker's disk has reached 16TB, but for large topics (>100MB / S), it can only store 12 hours of data; medium-sized topics (>10MB / s) can store 24 hours of data; small topics (<10MB / s) can only store 1-3 days. However, many task topics in scenarios such as data warehouses and advertising are relatively large, and 12 hours may not be enough to handle business failures. If you want to store data for a longer period of time, you will have to pay a very high fee;

[0038] (2) There is a lot of disk data, and expansion and other operations are time-consuming: Kafka expansion requires moving data from the old broker to the new broker. Migrating a large topic often takes several hours or even dozens of hours, and it takes a lot of network bandwidth during the migration, which can easily cause online delays. The migrated data is often not used except for consumption, which is time-consuming and resource-consuming.

[0039] (3) Kafka’s bottlenecks are often disk capacity and bandwidth. Expansion will cause a lot of CPU and Memory waste, so it is necessary to expand the storage part separately.

[0040] It can be seen that according to the background technology description of this application, when expanding Kafka, it is necessary to move the data on the old Broker to the new Broker. Broker refers to a node in the Kafka cluster, that is, the server running the Kafka service. Each Broker can store data in multiple partitions under multiple topics, where each partition contains a master node and multiple slave nodes. If the Broker contains a large amount of data, it often takes several hours or even dozens of hours to migrate the data, resulting in very low data migration efficiency.

[0041] Therefore, in this application, considering that many Kafka clusters are currently maintained at a high water level, some business traffic has increased very quickly, resulting in the current Broker being unable to store so much data. It is necessary to open a new set of Broker machines and migrate the Topic to the new Broker. When migrating a Topic in traditional Kafka, all data on the old Broker needs to be migrated to the new Broker. A high-traffic topic takes several hours and needs to be migrated during the off-peak period of the business.

[0042] Therefore, in order to solve the above problems, the present application provides a data processing method, device, electronic device and computer-readable storage medium, which aims to achieve minute-level data migration by optimizing data migration strategy and provide rapid expansion and contraction capabilities of Kafka cluster.

[0043] It is worth noting that in the embodiments of the present application, Figure 1As shown in the figure, a Kafka layered storage architecture is built to reduce the space requirements for the Broker local disk, reduce storage costs and local data storage time, and significantly improve the migration of Topics between Brokers, achieve data migration in minutes, and provide the ability for Kafka clusters to quickly expand and shrink.

[0044] Specifically, Figure 1 As shown in the figure, Kafka's layered storage architecture includes ReplicaManager module, LogManager module, RemoteLogManager module, Local Disks, RemoteCacheManager module, RemoteStorageManager module, RemoteLogMetadataManger module, etc. It also includes LogSegmentStore and LogMetadata Store.

[0045] ReplicaManager is the replica management module in Kafka and is the entry point for reading and writing data. It includes LogManager and RemoteLogManager modules.

[0046] LogManager is a built-in Kafka tool that manages data on local disks and is responsible for reading and writing local disks.

[0047] RemoteLogManager is a module introduced in the hierarchical storage in the embodiment of the present application, and is used to offload data to the cloud;

[0048] Local Disks is local disk storage, used for data storage;

[0049] RemoteCacheManager is used to cache data read from object storage to speed up reading;

[0050] RemoteStorageManager is a module used to interact with object storage and is responsible for uploading and downloading data;

[0051] RemoteLogMetadataManger is a metadata management module for object storage data, which is used to manage metadata in Kafka, such as topics, partitions, consumer groups, etc.

[0052] LogSegment Store is used to persistently store messages in Kafka. According to the above description, each partition consists of one or more log segments. Each log segment is a file on the disk that is used to store messages within a certain time range.

[0053] LogMetadata Store is used to store metadata in Kafka, including information about topics, partitions, consumer groups, etc.

[0054] On this basis, the data processing method in the embodiment of the present application can be applied to the first node in the local storage layer of Kafka (hereinafter also referred to as the master node, representing the same meaning). It can be understood that, according to the above description, there are multiple partitions under each Toptic, and each Partition can include a master node (leader) and multiple slave nodes (Follower). When the producer writes a message to a partition under Toptic, it is first written to the master node, and then the message in the master node is asynchronously copied to the slave node. Only when the message is copied to all nodes in the current partition will the producer receive a confirmation, indicating that the message has been successfully written to Toptic.

[0055] Specifically, the data processing method in this embodiment is as follows: Figure 2 As shown, the following steps may be specifically included:

[0056] S10, receiving a message synchronization request sent by a newly connected second node in the target partition, and obtaining a starting offset of a first node in the target partition;

[0057] The second node in this embodiment is the above-mentioned slave node, and may also be referred to as a slave node hereinafter, and the meanings represented are consistent.

[0058] It should be noted that in this embodiment, the message producer refers to the component or application responsible for generating (or publishing) messages in Kafka. In addition, there are message consumers. The two work together to form the basis of distributed messaging. Among them, the message producer is responsible for creating and generating messages, which may contain information about events, data updates, notifications, etc. The generated messages will be sent to a specific target of the messaging system, usually a topic (Topic) or queue (Queue). Message consumers can subscribe to the same topic to receive the same message. The queue is a point-to-point communication method, and each message can only be received by one consumer.

[0059] On this basis, in this embodiment, the master node can store the target message stream in the target partition (Partition) where the master node is located in the local storage layer in advance. Among them, the local storage layer in this embodiment can include the above-mentioned LocalDisks, and correspondingly, the cloud storage layer in this embodiment can be understood as a database distributed in the cloud, which does not occupy local storage space. According to the above description, the slave nodes in the target partition can copy the messages in the master node for data backup.

[0060] Compared with the existing Kafka that directly stores data in the local disk, this embodiment constructs a Kafka hierarchical storage structure, that is, while storing the target message stream published on the distributed stream processing platform in the target partition where the master node is located in the local storage layer, the master node can also upload the target message stream from the local storage layer to the cloud storage layer.

[0061] Specifically, for example, Figure 3 As shown, blue (including dark blue and light blue parts) represents the target information flow stored in the local storage layer, and purple represents the target information flow stored in the cloud storage layer. It can be seen that there is some overlap between local and cloud data. This data overlap may be caused by the cache mechanism, that is, the local cache can be used to improve performance and reduce the number of accesses to the remote storage system. When the data is accessed for the first time, the system may cache it locally. If the same data is requested again later, the system may first obtain it from the local cache instead of accessing the remote storage again.

[0062] On this basis, this embodiment predefines:

[0063] LogStartOffset represents the global start offset of the target partition; LogEndOffset represents the global end offset of the target partition; RemoteStartOffset represents the start offset of the target partition in the cloud, which is equal to the above LogStartOffset; RemoteEndOffset represents the end offset of the Partition in the cloud; LocalLogStartOffset represents the local start offset of the Partition; LocalLogEndOffset represents the local end offset of the Partition, which is equal to the above LogEndOffset.

[0064] Therefore, if Figure 3As shown, for the blue area, Lx=LocalLogStartOffset, Ly=Last stableoffset, Lz=LocalLogEndOffset, where the Last stable offset represents the offset of the last message confirmed as replicated in the Kafka partition.

[0065] In addition, for the purple area, Rx=RemoteStartOffset, Ry=RemoteEndOffset.

[0066] It can be seen that Lz>=Ly>=Lx, and Ly>=Ry>=Rx.

[0067] On this basis, the master node can receive the message synchronization request sent by the newly connected second node in the target partition, and obtain the starting offset Lx of the target partition (that is, the local starting offset LocalLogStartOffset of the above-mentioned Partition).

[0068] S20, determining a target offset according to the starting offset and the global message offset of the target partition, wherein the target offset includes a first offset and a second offset; the area between the starting offset and the first offset includes the full amount of data stored by the first node, the area between the starting offset and the second offset includes the cloud data uploaded to the cloud by the first node, and the area between the first offset and the second offset includes the target data not uploaded to the cloud by the first node;

[0069] In this embodiment, according to the above description, the slave node of the target partition can copy data from the master node for data backup. On this basis, if there is a new slave node communicating with the master node in the target partition, the slave node can copy the message of the master node.

[0070] It is worth noting that "cold data" of more than three days can be stored in the cloud, and "hot data" of one or two hours can be stored locally. When a replica needs to be migrated, the new replica will start copying data from LocalLogStartOffset, that is, consuming the "hot data" stored locally. However, for Topics with very large traffic, even if only "hot data" is consumed, it will take a long time to synchronize.

[0071] Therefore, in this embodiment, the master node can determine the target offset based on the starting offset in the target partition and the preset global message offset, where each partition has a global offset (Global Offset), which is a number representing the order of messages within the partition, and each message has a unique global offset value, which increases in the order in which the messages are written to the partition.

[0072] The target offset may include a first offset and a second offset. The first offset may be the local end offset LogEndOffset (i.e., the above-mentioned Lz) of the Partition, and the second offset may be the synchronization offset Li, so that the slave node may copy the target data from the master node according to the synchronization offset Li.

[0073] It is understandable that if Figure 4 As shown, the data between the starting offset Lx and the local end offset Lz (i.e., the first offset) includes the full data stored by the first node, the data between the starting offset Lx and the synchronization offset Li (i.e., the second offset in this embodiment) includes the cloud data uploaded to the cloud by the first node (i.e., the overlapping part of the blue area and the purple area), and the target data not uploaded to the cloud by the first node is included between the end offset Lz and the synchronization offset Li. It can be seen that in this embodiment, only the target data not uploaded to the cloud between the end offset Lz and the synchronization offset Li is copied to the slave node.

[0074] S30: Synchronize the target data between the first offset and the second offset to the second node.

[0075] In this embodiment, after obtaining the end offset Lz and synchronization offset Li of the target partition, the master node can obtain the target data between the end offset Lz and the synchronization offset Li that has not been uploaded to the cloud, and synchronize the target data to the newly connected slave node.

[0076] In another embodiment, after obtaining the end offset Lz and the synchronization offset Li of the target partition, the master node may also send the synchronization offset Li to the slave node.

[0077] After the slave node obtains the synchronization offset Li sent by the master node, it can use the synchronization offset Li as the copy starting point, and use the data between the synchronization offset Li in the master node and the local starting offset Lx as the target data, and copy the target data from the master node. This can not only back up and store the data of the master node, but also avoid duplicate backup of the data that has been uploaded to the cloud.

[0078] Therefore, in this embodiment, the first node can receive a message synchronization request sent by the newly connected second node in the target partition, obtain the starting offset of the target partition, and then determine the target offset including the first offset and the second offset based on the above starting offset and the global message offset of the target partition, wherein the area between the starting offset and the first offset includes the full data stored by the first node, the area between the starting offset and the second offset includes the cloud data uploaded to the cloud by the first node, and the area between the first offset and the second offset includes the target data not uploaded to the cloud by the first node. On this basis, the target data not uploaded to the cloud can be synchronized to the second node, avoiding the prior art of directly synchronizing the full data of the first node to the second node, but synchronizing the target data not uploaded to the cloud at the second node. This embodiment can not only realize data synchronization between nodes in the partition during the expansion of the distributed platform, but also reduce the storage space requirements of the partition during the expansion of the distributed platform, reduce storage costs, and effectively improve the efficiency of subsequent local data migration.

[0079] In one embodiment, in the above 20, “determining the target offset according to the starting offset and the global message offset of the target partition” may include:

[0080] S201: If the starting offset is greater than or equal to the global earliest offset in the global message offset, first error offset information is sent to the second node, so that the second node can send an offset query request to the first node when receiving the first error offset information;

[0081] S202, receiving the offset query request sent by the second node, obtaining the first offset of the first node in the target partition and the third offset of the cloud data, and adding the third offset to the preset offset increment to obtain the second offset, wherein the third offset represents the end offset of the cloud data.

[0082] It should be noted that, in this embodiment, Figure 5 As shown, after the new slave node accesses the target partition, the slave node can query the master node whether part or all of the data has been uploaded to the cloud, and synchronize the target data according to the synchronization offset Li returned by the master node.

[0083] Specifically, for example, Figure 5As shown, after the master node obtains the starting offset Lx of the target partition, it can determine that the global earliest offset in the global message offset (i.e., the above-mentioned logStartOffset) is less than the starting offset Lx. If the global earliest offset is less than the starting offset Lx, it means that the message corresponding to the global earliest offset has been uploaded to the cloud. At this time, the master node rejects the request of the slave node to synchronize data starting from the global earliest offset, and reports the error offset information to the slave node.

[0084] After receiving the error offset information, the slave node enters a new error processing state, and sends an offset query request (ListOffsetRequest) to the master node, and specifies the request type as -3 to obtain new offset and message version information and other data from the master node.

[0085] The master node receives the above offset query request and obtains the third offset of the cloud data (i.e. Figure 4 The target partition in the cloud has an end offset Ry), and the target offset Li can be calculated based on the end offset Ry and the preset offset increment.

[0086] Specifically, for example, the preset offset increment can be 1, so that the master node can add 1 to the end offset Ry to obtain the target offset Li=Ry+1, and return the version information of the message corresponding to the target offset Li to the slave node, so that the slave node starts to copy the target data from the target offset specified by the master node through a series of operations, including building an auxiliary state, etc. This position excludes all data that has been uploaded to the cloud, reducing the total amount of data copied by the slave node from the master node. It can be understood that the process of copying data from the slave node to the master node can refer to the data synchronization strategy between the master node and the slave node in the existing Kafka, which will not be repeated here.

[0087] Furthermore, before the above S201, the following steps may also be included:

[0088] S203, receiving a specified offset sent by the second node;

[0089] S204: If the specified offset is less than the global earliest offset, send second error offset information to the second node, so that the second node can send a global earliest offset query request to the first node when receiving the second error offset information;

[0090] S205, receiving the global earliest offset query request, and sending the global earliest offset to the second node, so that the second node, when receiving the global earliest offset, sends a synchronization request for data synchronization from the global earliest offset to the first node;

[0091] S206, receiving the synchronization request, and determining whether the starting offset is greater than or equal to the global earliest offset in the global message offset;

[0092] S207, if the starting offset is greater than or equal to the global earliest offset in the global message offset, execute: sending first error offset information to the second node.

[0093] It should be noted that in this embodiment, when the slave node is synchronized with the master node, it is impossible to determine whether the data uploaded to the cloud already exists in the master node, and it is also impossible to determine the offset of the data already uploaded to the cloud. Therefore, the slave node needs to send offset requests to the master node multiple times to query the data in the master node that has not been uploaded to the cloud until the target offset (i.e. the above-mentioned synchronization offset Li) is determined.

[0094] Specifically, for example, Figure 5 As shown, the slave node sends a request for obtaining a message to the master node (the request carries a specified offset, that is, an offset of 0), requesting to synchronize data starting from the position where the offset is 0.

[0095] After receiving the above-mentioned specified offset, the master node can detect the specified offset and determine whether the specified offset is less than the above-mentioned global earliest offset. If it is determined that the specified offset is less than the above-mentioned global earliest offset, a second error offset information is sent to the slave node, indicating that the offset is out of range.

[0096] After receiving the second error offset information, the slave node may enter an error processing state, send a global earliest offset query request (ListOffsetRequest) to the master node, and specify the request type as -2 to obtain the global earliest offset.

[0097] After receiving the global earliest offset query request, the master node may send the global earliest offset to the second node.

[0098] After receiving the global earliest offset, the slave node can send a synchronization request to the master node to synchronize data from the global earliest offset, requesting to synchronize data starting from the position of the global earliest offset.

[0099] After the master node obtains the above-mentioned bit synchronization data, according to the description of the above-mentioned embodiment, it can determine whether the global earliest offset is less than the starting offset Lx. If it is determined that the global earliest offset is less than the starting offset Lx, the first error offset information is sent to the slave node, so that when the slave node receives the first error offset information, it sends an offset query request to the master node to obtain the target offset Li. Please refer to the description of the above-mentioned embodiment and will not repeat it here.

[0100] Therefore, in this embodiment, when expanding the replica capacity, the log data can be copied directly from IncrementedRemoteLogEndOffset (i.e., the above-mentioned synchronization offset Li) to ensure that only the logs that have not been uploaded to the cloud are copied, thereby reducing the amount of data that needs to be copied from the node, reducing the time required for expansion, and saving local disk storage space. This greatly improves the data migration efficiency and effectively shortens the time required for data migration during subsequent local data migration.

[0101] In one embodiment, in the above S10, before "receiving a message synchronization request sent by a newly connected second node in the target partition, and obtaining a starting offset of the target partition", the following may also be included:

[0102] S40, the target topic corresponding to the target partition, and monitoring the target message flow published under the target topic;

[0103] S50, obtaining the access frequency of each message in the target message flow in the target partition;

[0104] S60, obtaining a target message under the target topic whose access frequency is lower than a preset access frequency threshold;

[0105] S70, uploading the target message from the first node to a cloud database associated with the target topic.

[0106] In this embodiment, according to the above description, the improved Kafka adopts a combination of local storage and cloud storage for data hierarchical storage. On this basis, the master node can obtain the target topic corresponding to the target partition and monitor the target message flow published under the target topic.

[0107] According to the above description, 'cold data' of more than three days can be stored in the cloud, and 'hot data' of one or two hours can be stored locally. Therefore, the master node can obtain the access frequency of each message in the target message stream in the target partition. It can be understood that this embodiment can set the data with an access frequency greater than or equal to the preset access frequency threshold as hot data, and set the data with an access frequency less than the preset access frequency threshold as cold data.

[0108] Furthermore, the master node obtains a target message whose access frequency under the target topic in the target partition is lower than a preset access frequency threshold, and uploads the target message to a cloud database associated with the target topic.

[0109] It is understandable that, in this embodiment, in addition to determining the messages to be uploaded to the cloud based on the access frequency as described above, the data to be uploaded to the cloud may also be determined based on parameters such as message distribution time.

[0110] Furthermore, before the above S30, “synchronizing the target data between the first offset and the second offset to the second node”, the following may also be included:

[0111] S80, querying offset metadata corresponding to the second node from a preset metadata database according to the node identifier of the second node;

[0112] S90. Construct a data synchronization auxiliary state of the second node based on the offset metadata, wherein the data synchronization auxiliary state includes at least one of a synchronization state between the first node and the second node, a data load state of the second node, and node information of the second node.

[0113] On this basis, in the above S30, “synchronizing the target data between the first offset and the second offset to the second node” may include:

[0114] S301, in the data synchronization auxiliary state, synchronizing target data between the first offset and the second offset to the second node.

[0115] In this embodiment, if Figure 5 As shown, after the slave node determines the target offset Li according to the starting offset and the global message offset of the target partition, it can query the offset metadata corresponding to the slave node from the preset metadata database according to the node identifier of the node. It can be understood that the auxiliary state construction in this embodiment can be constructed by the slave node itself or by the master node, and synchronized to the slave node after the construction is completed.

[0116] This embodiment is described by taking the construction of an auxiliary state from a node as an example.

[0117] According to the above description of this embodiment, the Kafka layered storage architecture in this embodiment includes the RemoteStorageManager module (i.e. Figure 5 RSM in ) and RemoteLogMetadataManger module (ie Figure 5 On this basis, the slave node can query the offset metadata corresponding to the slave node through the RemoteLogMetadataManger module according to the node identifier of the slave node, where the offset metadata can include cluster information (such as basic information such as cluster ID and version number, detailed information of all nodes in the cluster), topic information (such as topic name, topic configuration information), partition information (such as partition ID, master node, replica list, ISR list, etc.) and producer and consumer information.

[0118] On this basis, the slave node can construct a data synchronization auxiliary state of the slave node according to the above-mentioned offset metadata, wherein the data synchronization auxiliary state includes at least one of the synchronization state between the master node and the slave node, the data load state of the slave node (such as whether it is overloaded), and the node information of the slave node. The data synchronization auxiliary state in this embodiment is used to monitor data synchronization between nodes, support redundancy and fault tolerance, monitor the health status of replicas, etc.

[0119] On this basis, the master node can obtain the target data between the above-mentioned tail offset Lz and the synchronization offset Li that has not been uploaded to the cloud in the above-mentioned data synchronization auxiliary state, and synchronize the target data to the slave node, thereby ensuring the accuracy of data synchronization between nodes and avoiding data omissions, repeated synchronization, etc. caused by data synchronization failure.

[0120] Further, in this embodiment, after the above S30, "synchronizing the target data between the first offset and the second offset to the second node", the following may also be included:

[0121] Step A, receiving a request for reducing the capacity of the target partition, and obtaining a corresponding failed node in the target partition;

[0122] Step B: if the failed node is the first node, cancel the failed node, and determine a new first node based on at least one of the performance index, data load, node fault tolerance rate of the second node in the target partition and version information of the data stored in the second node;

[0123] Step C: if the failed node is the second node, revoke the failed node and obtain the node data load of the target partition after revoking the failed node. If the node data load is lower than the preset load threshold, output the remaining storage space information of the target partition.

[0124] It should be noted that, in this embodiment, the newly added slave node in Kafka is called capacity expansion, and the deletion of the node from the partition is called capacity reduction.

[0125] On this basis, in scenarios such as changes in business requirements, cost optimization, or hardware upgrades and replacements, a corresponding request to scale down the target partition is triggered. After receiving the scale-down request, the master node can replace the failed nodes in the target partition.

[0126] Furthermore, if the failed node is the first node, it means that there is no master node in the target partition at this time, and a new master node needs to be elected. Therefore, the master node can determine the new first node based on at least one of the performance indicators, data load, node fault tolerance rate and version information of the slave node stored data in the target partition, to ensure that there is a data storage architecture with one master node and several slave nodes in the target partition, providing data redundancy and fault tolerance for each partition.

[0127] If the above-mentioned failed node is the second node, the failed node can be directly revoked, and then the node data load of the target partition after the revocation of the failed node can be obtained. If the node data load is lower than the preset load threshold, it means that the storage of the target partition is not fully utilized at this time. At this time, the remaining storage space information of the target partition can be output, so that the user can reconnect to the new second node according to the remaining storage space information, adjust the load within the target partition, and ensure load balance of each partition.

[0128] Furthermore, after the above S30, “synchronizing the target data between the first offset and the second offset to the second node”, the following may also be included:

[0129] Step D, receiving a data migration request, interrupting the message writing operation of the subject to be migrated, and detecting the data synchronization status between the nodes in each target partition under the subject to be migrated after the interruption;

[0130] Step E: If the data synchronization state is the synchronization completed state, a target container whose data load in the preset cluster is lower than a preset load threshold is obtained, and all data in the subject to be migrated is migrated to the target container.

[0131] It should be noted that in this embodiment, according to the above description, in scenarios such as load balancing or node failure, if a new group of Broker machines needs to be opened and the Topic is migrated to the new Broker, a data migration request can be triggered at this time.

[0132] The master node can receive the data migration request, interrupt the message writing operation of the subject to be migrated, and detect the data synchronization status between the nodes in each target partition under the subject to be migrated after the interruption, wherein the data synchronization status can include the unsynchronized state, the synchronizing state and the synchronization end state between the master node and the slave node.

[0133] Furthermore, if the master node detects that the data synchronization status is the synchronization completed state, it can detect the target container in the Kafka cluster whose load is lower than the preset load threshold to ensure load balancing between containers and make full use of the storage space of each container. The master node in each target partition can migrate all data in the topic to be migrated to the above target container.

[0134] It is worth noting that the Kafka layered storage architecture in this embodiment makes it unnecessary for slave nodes in each partition to synchronously copy the full data of the master node. It only needs to synchronize local data that has not been uploaded to the cloud by the master node. Therefore, when performing data migration in this embodiment, the amount of data migrated is greatly reduced, which effectively improves the data migration efficiency and can solve the problems of time-consuming and high-cost big data migration in the prior art.

[0135] This embodiment also provides a data processing device, which can be integrated in a terminal device, for example, Figure 6 As shown, including:

[0136] The acquisition module 1001 is used to receive a message synchronization request sent by a newly connected second node in a target partition, and acquire a starting offset of a first node in the target partition;

[0137] A determination module 1002 is used to determine a target offset according to the starting offset and the global message offset of the target partition, wherein the target offset includes a first offset and a second offset; the area between the starting offset and the first offset includes the full amount of data stored by the first node, the area between the starting offset and the second offset includes the cloud data uploaded to the cloud by the first node, and the area between the first offset and the second offset includes the target data not uploaded to the cloud by the first node;

[0138] The synchronization module 1003 is used to synchronize the target data between the first offset and the second offset to the second node.

[0139] Optionally, the determining module 1002 includes:

[0140] a first sending unit, configured to send first error offset information to the second node if the global earliest offset in the global message offset is less than the starting offset, so that the second node sends an offset query request to the first node when receiving the first error offset information;

[0141] An accumulation unit is used to receive the offset query request sent by the second node, obtain the first offset of the first node in the target partition and the third offset of the cloud data, and accumulate the third offset with a preset offset increment to obtain a second offset, wherein the third offset represents the end offset of the cloud data.

[0142] Optionally, the determining module 1002 includes:

[0143] A first receiving unit, configured to receive a specified offset sent by the second node;

[0144] a second sending unit, configured to send second error offset information to the second node if the specified offset is less than the global earliest offset, so that the second node sends a global earliest offset query request to the first node when receiving the second error offset information;

[0145] a third sending unit, configured to receive the global earliest offset query request, and send the global earliest offset to the second node, so that the second node, when receiving the global earliest offset, sends a synchronization request for data synchronization from the global earliest offset to the first node;

[0146] A judging unit, configured to receive the synchronization request and judge whether the starting offset is greater than or equal to the global earliest offset in the global message offset;

[0147] An execution unit, configured to execute, if the global earliest offset is smaller than the starting offset: sending first error offset information to the second node.

[0148] Optionally, the data processing device in this embodiment further includes:

[0149] A monitoring module, used to obtain a target topic corresponding to the target partition and monitor a target message flow published under the target topic;

[0150] A second acquisition module, used to acquire the access frequency of each message in the target message flow in the target partition;

[0151] A third acquisition module is used to acquire target messages under the target topic whose access frequency is lower than a preset access frequency threshold;

[0152] An uploading module is used to upload the target message from the first node to a database in the cloud associated with the target topic.

[0153] Optionally, the data processing device in this embodiment further includes:

[0154] A query module, configured to query the offset metadata corresponding to the second node from a preset metadata database according to the node identifier of the second node;

[0155] A construction module is used to construct a data synchronization auxiliary state of the second node based on the offset metadata, wherein the data synchronization auxiliary state includes at least one of a synchronization state between the first node and the second node, a data load state of the second node, and node information of the second node.

[0156] The synchronization module 1003 includes:

[0157] A synchronization unit is used to synchronize the target data between the first offset and the second offset to the second node in the data synchronization auxiliary state.

[0158] Optionally, the data processing device in this embodiment further includes:

[0159] A fourth acquisition module, configured to receive a request for reducing the capacity of the target partition, and acquire a corresponding failed node in the target partition;

[0160] A first revocation module is configured to revoke the failed node if the failed node is a first node, and determine a new first node according to at least one of a performance indicator, data load, node fault tolerance rate of a second node in the target partition, and version information of data stored by the second node;

[0161] The second revocation module is used to revoke the failed node if the failed node is the second node, and obtain the node data load of the target partition after revoking the failed node; if the node data load is lower than a preset load threshold, output the remaining storage space information of the target partition, and adjust the data load of the target partition according to the remaining storage space information.

[0162] Optionally, the data processing device in this embodiment further includes:

[0163] A detection module, used to receive a data migration request, interrupt the message writing operation of the subject to be migrated, and detect the data synchronization status between the nodes in each target partition under the subject to be migrated after the interruption;

[0164] The migration module is used to obtain a target container in a preset cluster whose data load is lower than a preset load threshold if the data synchronization state is a synchronization completed state, and migrate all data in the subject to be migrated to the target container.

[0165] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0166] Accordingly, an embodiment of the present application further provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Alternatively, the electronic device may be a server.

[0167] like Figure 7 As shown, Figure 7A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 1100 includes a processor 1101 having one or more processing cores, a memory 1102 having one or more computer-readable storage media, and a computer program stored in the memory 1102 and executable on the processor. The processor 1101 is electrically connected to the memory 1102. It will be understood by those skilled in the art that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0168] The processor 1101 is the control center of the electronic device 1100, and uses various interfaces and lines to connect various parts of the entire electronic device 1100. By running or loading software programs and / or units stored in the memory 1102, and calling data stored in the memory 1102, the processor 1101 executes various functions of the electronic device 1100 and processes data, thereby monitoring the electronic device 1100 as a whole. The processor 1101 can be a processor CPU, a graphics processor GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0169] In the embodiment of the present application, the processor 1101 in the electronic device 1100 will load instructions corresponding to the processes of one or more application programs into the memory 1102 according to the following steps, and the processor 1101 will run the application programs stored in the memory 1102 to implement various functions, such as:

[0170] Receive a message synchronization request sent by a newly connected second node in the target partition, and obtain a starting offset of the target partition;

[0171] Determine a target offset according to the starting offset and the global message offset of the target partition, wherein the target offset includes a first offset and a second offset; the area between the starting offset and the first offset includes the full amount of data stored by the first node, the area between the starting offset and the second offset includes the cloud data uploaded to the cloud by the first node, and the area between the first offset and the second offset includes the target data not uploaded to the cloud by the first node;

[0172] The target data between the first offset and the second offset is synchronized to the second node.

[0173] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0174] Optional, such as Figure 7As shown, the electronic device 1100 further includes: a touch screen 1103, a radio frequency circuit 1104, an audio circuit 1105, an input unit 1106, and a power supply 1107. The processor 1101 is electrically connected to the touch screen 1103, the radio frequency circuit 1104, the audio circuit 1105, the input unit 1106, and the power supply 1107, respectively. Those skilled in the art can understand that Figure 7 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0175] The touch display screen 1103 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 1103 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-EmittingDiode) and the like. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts: a touch detection system and a touch controller. Among them, the touch detection system detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection system, converts it into the touch point coordinates, and then sends it to the processor 1101, and can receive the command sent by the processor 1101 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 1101 to determine the type of touch event, and then the processor 1101 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 1103 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 1103 can also be used as a part of the input unit 1106 to realize the input function.

[0176] The radio frequency circuit 1104 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals between the network device or other electronic devices.

[0177] The audio circuit 1105 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 1105 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 1105 and converted into audio data, and then the audio data is output to the processor 1101 for processing, and then sent to another electronic device through the radio frequency circuit 1104, or the audio data is output to the memory 1102 for further processing. The audio circuit 1105 may also include an earplug jack to provide communication between an external headset and an electronic device.

[0178] The input unit 1106 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0179] The power supply 1107 is used to supply power to various components of the electronic device 1100. Optionally, the power supply 1107 can be logically connected to the processor 1101 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 1107 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0180] although Figure 7 Not shown, the electronic device 1100 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0181] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0182] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0183] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored. The computer program can be loaded by a processor to execute any data processing method provided in the embodiment of the present application. The computer program can execute the steps of the following data processing method:

[0184] Receive a message synchronization request sent by a newly connected second node in the target partition, and obtain a starting offset of the target partition;

[0185] Determine a target offset according to the starting offset and the global message offset of the target partition, wherein the target offset includes a first offset and a second offset; the area between the starting offset and the first offset includes the full amount of data stored by the first node, the area between the starting offset and the second offset includes the cloud data uploaded to the cloud by the first node, and the area between the first offset and the second offset includes the target data not uploaded to the cloud by the first node;

[0186] The target data between the first offset and the second offset is synchronized to the second node.

[0187] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0188] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0189] Since the computer program stored in the computer-readable storage medium can execute any data processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any data processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0190] In the above-mentioned data processing device, computer-readable storage medium, and electronic device, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the above-described data processing device, computer-readable storage medium, computer program product, electronic device and its corresponding units can refer to the description of the data processing method in the above embodiment, and will not be repeated here.

[0191] The above is a detailed introduction to a data processing method, device, electronic device, and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data processing method, characterized in that: The method is applied to a first node in a distributed platform, comprising: Receive a message synchronization request sent by a newly connected second node in the target partition, and obtain a starting offset of a first node in the target partition; Determine a target offset according to the starting offset and the global message offset of the target partition, wherein the target offset includes a first offset and a second offset; the area between the starting offset and the first offset includes the full amount of data stored by the first node, the area between the starting offset and the second offset includes the cloud data uploaded to the cloud by the first node, and the area between the first offset and the second offset includes the target data not uploaded to the cloud by the first node; The target data between the first offset and the second offset is synchronized to the second node.

2. The data processing method according to claim 1, characterized in that: Determining the target offset according to the starting offset and the global message offset includes: If the global earliest offset in the global message offset is less than the starting offset, sending first error offset information to the second node, so that the second node can send an offset query request to the first node when receiving the first error offset information; Receive the offset query request sent by the second node, obtain the first offset of the first node in the target partition and the third offset of the cloud data, and add the third offset and the preset offset increment to obtain the second offset, wherein the third offset represents the end offset of the cloud data.

3. The data processing method according to claim 2, characterized in that: If the starting offset is greater than or equal to the global earliest offset in the global message offset, before sending the first error offset information to the second node, the method includes: receiving a specified offset sent by the second node; If the specified offset is less than the global earliest offset, sending second error offset information to the second node, so that the second node can send a global earliest offset query request to the first node when receiving the second error offset information; receiving the global earliest offset query request, and sending the global earliest offset to the second node, so that the second node, when receiving the global earliest offset, sends a synchronization request for data synchronization from the global earliest offset to the first node; Receive the synchronization request, and determine whether the starting offset is greater than or equal to the global earliest offset in the global message offset; If the global earliest offset is smaller than the starting offset, executing: sending first error offset information to the second node.

4. The data processing method according to claim 1, characterized in that: The receiving of the message synchronization request sent by the newly connected second node in the target partition and obtaining the starting offset of the target partition includes: Obtain a target topic corresponding to the target partition, and monitor a target message stream published under the target topic; Obtaining the access frequency of each message in the target message stream in the target partition; Acquire target messages under the target topic whose access frequency is lower than a preset access frequency threshold; The target message is uploaded from the first node to a database in the cloud associated with the target topic.

5. The data processing method according to claim 1, characterized in that: Before synchronizing the target data between the first offset and the second offset to the second node, the method includes: According to the node identifier of the second node, querying the offset metadata corresponding to the second node from a preset metadata database; Constructing a data synchronization auxiliary state of the second node according to the offset metadata, wherein the data synchronization auxiliary state includes at least one of a synchronization state between the first node and the second node, a data load state of the second node, and node information of the second node; The step of synchronizing the target data between the first offset and the second offset to the second node includes: In the data synchronization auxiliary state, the target data between the first offset and the second offset is synchronized to the second node.

6. The data processing method according to claim 5, characterized in that: After synchronizing the target data between the first offset and the second offset to the second node, the method further comprises: Receiving a request for reducing the capacity of the target partition, and obtaining a corresponding failed node in the target partition; If the failed node is the first node, the failed node is revoked, and a new first node is determined according to at least one of a performance indicator, data load, node fault tolerance rate of a second node in the target partition, and version information of data stored by the second node; If the failed node is the second node, the failed node is revoked, and the node data load of the target partition after the failed node is revoked is obtained. If the node data load is lower than the preset load threshold, the remaining storage space information of the target partition is output, and the data load of the target partition is adjusted according to the remaining storage space information.

7. The data processing method according to any one of claims 1 to 6, characterized in that: After synchronizing the target data between the first offset and the second offset to the second node, the method further comprises: Receive a data migration request, interrupt the message writing operation of the subject to be migrated, and detect the data synchronization status between the nodes in each target partition under the subject to be migrated after the interruption; If the data synchronization state is the synchronization completed state, a target container whose data load in the preset cluster is lower than a preset load threshold is obtained, and all data in the subject to be migrated is migrated to the target container.

8. A data processing device, characterized in that: include: An acquisition module, configured to receive a message synchronization request sent by a newly connected second node in a target partition, and acquire a starting offset of a first node in the target partition; A determination module, configured to determine a target offset according to the starting offset and the global message offset of the target partition, wherein the target offset includes a first offset and a second offset; the area between the starting offset and the first offset includes the full amount of data stored by the first node, the area between the starting offset and the second offset includes the cloud data uploaded to the cloud by the first node, and the area between the first offset and the second offset includes the target data not uploaded to the cloud by the first node; A synchronization module is used to synchronize the target data between the first offset and the second offset to the second node.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the data processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the data processing method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Distributed block storage system performance optimization method and system

    CN120803377A