Pause and resume method, device and medium in heterogeneous database migration process

CN121092520BActive Publication Date: 2026-08-11HIGHGO SOFTWARE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511202266.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2026-08-11
Estimated Expiration
2045-08-26

AI Technical Summary

Technical Problem

[0004]本申请实施例提供了一种异构数据库迁移过程中的暂停与恢复方法、设备及介质,用于解决如下技术问题:在数据量较大的情况下,重启迁移需重新执行全量数据扫描、校验及传输,大幅延长迁移周期,以致迁移效率低下

Benefits of technology

[0016]本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:通过响应暂停迁移请求,并对暂停迁移任务进行暂停处理,既保证了当前任务的完整性,又避免了资源长期占用导致的泄漏。将暂停迁移任务对应的执行阶段信息进行存储,持久化记录暂停时的具体执行阶段,确保恢复时能直接定位到暂停节点,无需重新执行前期已完成阶段,提升恢复效率,尤其在海量数据迁移场景中,减少了冗余操作带来的时间成本。执行不同的继续迁移逻辑,恢复时根据存储的迁移数据精准申请所需资源,并基于暂停阶段信息跳过已完成任务,直接从断点开始迁移。不仅保证了资源的按需分配,避免浪费,还确保了迁移过程的连续性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121092520B_ABST
    Figure CN121092520B_ABST
Patent Text Reader

Abstract

This application discloses a method, device, and medium for pausing and resuming heterogeneous database migration, belonging to the field of database migration technology. It addresses the problem that restarting migration when dealing with large amounts of data requires re-executing a full data scan and transmission, leading to low migration efficiency. The method involves receiving and storing real-time status information corresponding to the migration task; responding to a pause migration request and pausing the migration task based on the pause completion signal from the migration service node; storing the execution stage information corresponding to the paused migration task; responding to a resume migration request and executing different continue migration logic based on the closed state of the system service; determining the resources required for the resumed migration task and the execution stage information of the resumed migration task at the time of pause based on the different continue migration logic, and then resuming the migration process based on the execution stage corresponding to the required migration resources at the time of pause.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database migration technology, and in particular to a method, device and medium for pausing and resuming during heterogeneous database migration. Background Technology

[0002] In today's context of accelerated digital transformation, enterprise business systems are undergoing increasingly frequent iterations and upgrades, making the migration of heterogeneous databases a core aspect of operations and maintenance. Database products from different vendors differ significantly in data models, storage structures, and interaction protocols, necessitating complex format conversions, compatibility adaptations, and consistency checks during the migration process.

[0003] In actual migration operations, users often have to pause the current migration task due to temporary business needs or uncontrollable external factors. However, most migration tools, once the migration process is interrupted, especially when system services are shut down, can usually only terminate the current task and restart the entire migration process. When dealing with large amounts of data, restarting the migration requires re-executing a full data scan, verification, and transmission, significantly extending the migration cycle and resulting in low migration efficiency. Summary of the Invention

[0004] This application provides a method, device, and medium for pausing and resuming heterogeneous database migration, which solves the following technical problem: when the data volume is large, restarting the migration requires re-executing a full data scan, verification, and transmission, which greatly prolongs the migration cycle and results in low migration efficiency.

[0005] The embodiments of this application adopt the following technical solutions:

[0006] This application provides a method for pausing and resuming a heterogeneous database migration process. The method includes: receiving and storing real-time status information corresponding to a migration task; responding to a pause migration request, determining the migration service node corresponding to the paused migration task, and pausing the paused migration task based on a pause completion signal fed back by the migration service node; storing the execution stage information corresponding to the paused migration task; responding to a resume migration request, executing different continue migration logic based on the closed state of the system service; and determining the migration resources required for the resumed migration task based on the stored migration data, and determining the execution stage information of the resumed migration task at the time of pause, so as to start the resumed migration process based on the execution stage corresponding to the migration resources at the time of pause.

[0007] In one implementation of this application, receiving and storing real-time status information corresponding to a migration task specifically includes: receiving real-time status information corresponding to a migration task sent by a migration service node; wherein the real-time status information includes at least one of the following corresponding to the migration task: migration service node information, start-read status information, start-write status information, end-read status information, end-write status information, Finish status information, and Error status information; and storing the received real-time status information in a database through a system service node.

[0008] In one implementation of this application, responding to a pause migration request and determining the migration service node corresponding to the paused migration task specifically includes: determining the paused migration task based on the pause migration request and changing the status of the paused migration task to a paused state; determining the task dispatcher corresponding to the paused migration task and marking the task dispatcher as paused; determining the migration service node corresponding to the paused migration task in the database based on the task identifier corresponding to the paused migration task, and sending a task pause signal to the migration service node.

[0009] In one implementation of this application, the paused migration task is paused based on the pause completion signal fed back by the migration service node. Specifically, this includes: if the migration service node does not have a task currently being executed, receiving the pause completion signal fed back by the migration service node; if the migration service node has a task currently being executed, receiving the pause completion signal fed back by the migration service node after the migration service node has completed executing the task; and if all migration service nodes corresponding to the paused migration task have sent pause completion signals, changing the paused migration task to a paused state and releasing the migration resources corresponding to the paused migration task.

[0010] In one implementation of this application, in response to a recovery migration request, different continuation migration logic is executed based on the shutdown state of the system service. Specifically, this includes: determining a recovery migration task based on the recovery migration request; if the system service is not shut down, querying the recovery migration task in memory and executing memory-based continuation migration logic; if the system service is shut down, querying the task-related information corresponding to the recovery migration task in the database and executing database-based continuation migration logic.

[0011] In one implementation of this application, the execution of memory-based continued migration logic specifically includes: marking the recovery migration task as being in a recovery state; determining the relevant resources corresponding to the recovery migration task when it was paused, and sending a signal to the corresponding migration service node to resume the migration task; wherein, the relevant resources include at least one of the following corresponding to the recovery migration task before it was paused: connection pool, thread pool, task dispatch thread, monitoring thread, and work queue; restarting the blocked waiting thread, and marking the recovery migration task as being in a progress state.

[0012] In one implementation of this application, task-related information corresponding to the recovery migration task is determined based on stored migration data, and database-based continuation migration logic is executed. Specifically, this includes: querying the database for task-related information corresponding to the recovery migration task based on the identifier corresponding to the recovery migration task; determining the currently suspended execution phase recorded when the task was suspended based on the task-related information; skipping the execution phases before that phase, resuming the tasks not yet executed in the current execution phase, and starting the migration.

[0013] In one implementation of this application, after responding to a migration recovery request and executing different migration continuation logic based on the shutdown state of the system service, the method further includes: performing task load detection on the migration task; and dynamically scaling up or down the migration service node based on the changed task load if the migration task changes.

[0014] This application provides a pause and resume device for heterogeneous database migration, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: receive real-time status information corresponding to a migration task and store the real-time status information; respond to a pause migration request, determine the migration service node corresponding to the pause migration task, and pause the pause migration task based on the pause completion signal fed back by the migration service node; store the execution stage information corresponding to the pause migration task; respond to a resume migration request, and execute different continue migration logic based on the closed state of the system service; according to the different continue migration logic, determine the migration resources required for the resume migration task based on the stored migration data, and determine the execution stage information corresponding to the resume migration task when it was paused, so as to start the resume migration process based on the execution stage corresponding to the migration resources when it was paused.

[0015] This application provides a non-volatile computer storage medium storing computer-executable instructions. The computer-executable instructions are configured to: receive real-time status information corresponding to a migration task and store the real-time status information; respond to a pause migration request, determine the migration service node corresponding to the paused migration task, and pause the paused migration task based on the pause completion signal fed back by the migration service node; store the execution stage information corresponding to the paused migration task; respond to a resume migration request, and execute different continue migration logic based on the closed state of the system service; and, based on the stored migration data, determine the migration resources required for the resumed migration task and the execution stage information corresponding to the resumed migration task at the time of pause, so as to start the resumed migration process based on the execution stage corresponding to the migration resources at the time of pause.

[0016] The at least one technical solution adopted in this application embodiment can achieve the following beneficial effects: By responding to the pause migration request and pausing the paused migration task, the integrity of the current task is ensured, and leakage caused by long-term resource occupation is avoided. Storing the execution stage information corresponding to the paused migration task and persistently recording the specific execution stage at the time of pause ensures that the paused node can be directly located upon recovery, without re-executing previously completed stages, thus improving recovery efficiency. Especially in massive data migration scenarios, this reduces the time cost caused by redundant operations. Executing different continue migration logics, upon recovery, the required resources are accurately requested based on the stored migration data, and completed tasks are skipped based on the paused stage information, directly starting the migration from the breakpoint. This not only ensures on-demand resource allocation and avoids waste but also ensures the continuity of the migration process. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0018] Figure 1 A flowchart illustrating a pause and resume method during heterogeneous database migration, provided in an embodiment of this application;

[0019] Figure 2 This application provides a migration task status update diagram as an embodiment.

[0020] Figure 3 A flowchart illustrating the process of pausing a migration task is provided in this application embodiment;

[0021] Figure 4 A flowchart of a continued migration task is provided in an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of a pause and resume device during a heterogeneous database migration process, provided as an embodiment of this application.

[0023] Figure label:

[0024] 200: Pause and resume device during heterogeneous database migration; 201: Processor; 202: Memory. Detailed Implementation

[0025] This application provides a method, device, and medium for pausing and resuming during heterogeneous database migration.

[0026] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0027] The technical solutions proposed in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0028] Figure 1 A flowchart illustrating a pause and resume method during heterogeneous database migration, as provided in this application embodiment, is shown below. Figure 1 As shown, the pause and resume methods during heterogeneous database migration include the following steps:

[0029] Step 101: Receive the real-time status information corresponding to the migration task and store the real-time status information.

[0030] In one implementation of this application, real-time status information corresponding to a migration task sent by a migration service node is received. This real-time status information includes at least one of the following: migration service node information, start-read status information, start-write status information, end-read status information, end-write status information, Finish status information, and Error status information corresponding to the migration task. The received real-time status information is stored in a database through a system service node.

[0031] The Finish status indicates that a single execution task has successfully completed the migration. In this state, basic information necessary for task completion is saved as a record of task completion. The Error status indicates that a single execution task encountered an error during the migration process, causing the migration to fail. This state saves information such as the Java exception stack trace, which can be used to troubleshoot the cause of the migration failure.

[0032] Specifically, in heterogeneous database migration, a single execution task refers to the migration of a single database object, such as a table object or view object, or a single table data shard. When a system service node sends a single execution task to a migration service node for execution, the migration service node asynchronously returns multiple status messages as it processes the task, such as: Start Read, Start Write, End Read, End Write, Finish, and Error. It also saves some basic information needed for each status. For example, in the table data migration, the End Read phase records the number of rows read, the End Write phase records the number of rows actually migrated, and Error saves information such as the Java exception stack trace. By updating the status of completed tasks in the database, it facilitates status determination during subsequent recovery.

[0033] Figure 2 A migration task status update graph provided in this application embodiment, such as Figure 2 As shown, the system service sends an execution task to the migration service. The migration service returns a start read signal to the system service, which the system service stores. The migration service then returns a start write signal to the system service, which the system service stores. Finally, the migration service returns a finish read signal to the system service, which the system service stores. The migration service also returns a finish write signal to the system service, which the system service stores. Additionally, the migration service also returns either a Finish or Error signal to the system service.

[0034] This application embodiment records the entire process status of a single execution task in real time and persistently stores key data. This provides a precise basis for subsequent resumption after a pause, ensuring that the boundaries between completed and incomplete tasks can be clearly defined during resumption, avoiding duplicate migrations or data omissions, and guaranteeing the accuracy of the migration.

[0035] Step 102: Respond to the pause migration request, determine the migration service node corresponding to the pause migration task, and pause the pause migration task based on the pause completion signal fed back by the migration service node.

[0036] In one implementation of this application, based on the pause migration request, a pause migration task is identified, and the status of the paused migration task is changed to a paused state. The task dispatcher corresponding to the paused migration task is identified, and the task dispatcher is marked as paused. Based on the task identifier corresponding to the paused migration task, the migration service node corresponding to the paused migration task is identified in the database, and a task pause signal is sent to the migration service node.

[0037] When pause is clicked, if the system service process is not closed, the system service will block the assignment status of the migration task and wait for the assigned task to complete before sending a resource release signal to the migration service.

[0038] Specifically, after the system service receives a task that needs to be paused, it changes the task status to "pausing" and marks the task dispatcher corresponding to that task as paused, thus preventing new tasks from being sent to the migration service node. A pause signal is sent to the migration service node currently in use, as recorded in the current migration task context, and the system waits for the migration service to return a signal indicating that the pause is complete.

[0039] Furthermore, upon receiving a task pause signal, if the migration service node does not have any tasks currently being executed, it receives a pause completion signal from the migration service node. If the migration service node has a task currently being executed, it receives a pause completion signal from the migration service node after the currently executing task has been completed. If all migration service nodes corresponding to the paused migration task have sent pause completion signals, the paused migration task is changed to a paused state, and the migration resources corresponding to the paused migration task are released.

[0040] In other words, when a migration service node receives a task pause signal, it may have an ongoing task. Upon receiving the pause signal, the migration service node completes its current task and returns a pause completion signal to the system service node. It then releases the resources such as the connection pool and thread pool requested by the migration task. Once the system service node receives pause completion signals from all migration service nodes, the current migration task is considered paused, and it releases the resources requested by the migration task on the system service node.

[0041] In this embodiment, when a migration task is paused, the task dispatcher is marked as paused, and the sending of new tasks to the migration service node is stopped. Simultaneously, the system waits for the migration service node to complete its current task and return a pause completion signal before releasing resources such as the thread pool and connection pool of the system service and the migration service. This ensures the integrity of the current task, reduces system pressure, and makes the pause operation more controllable, adapting to the needs of temporary business interruptions.

[0042] Figure 3A flowchart for pausing a migration task is provided as an embodiment of this application, such as... Figure 3 As shown, pausing the migration task includes the following process:

[0043] The system service node obtains the task identifier that needs to be paused;

[0044] The system service node changes the status of the task to paused and marks the task dispatcher corresponding to the task as paused to stop sending new execution tasks to the migration service node;

[0045] The system service node sends a pause signal to the migration service node that is currently in use and recorded in the context corresponding to the current migration task;

[0046] The system service nodes are waiting for all migration service nodes to return a pause completion signal;

[0047] Once all migration service nodes return a paused completion signal, the system service node changes the status of the migration task to paused.

[0048] The system service node releases the thread pool, connection pool, and other resources that the migration task requested on its own node.

[0049] Step 103: Store the execution phase information corresponding to the paused migration task.

[0050] In one implementation of this application, during a paused process, a set of information about the current execution stage is persisted. This includes the currently executing DB stage (the migration stage at the database level), the SCHEMA stage (the migration stage at the database schema level), the SCHEMA stage currently being executed (the specific operation stage currently in progress during the database schema migration process), and the SCHEMA completed objects (database objects that have successfully completed migration during the database schema migration stage).

[0051] Step 104: Respond to the recovery migration request and execute different continuation migration logic based on the shutdown status of the system service.

[0052] In one implementation of this application, a recovery migration task is determined based on the recovery migration request. If the system service is not shut down, the recovery migration task is retrieved from memory, and memory-based continuation migration logic is executed. If the system service is shut down, the task-related information corresponding to the recovery migration task is retrieved from the database, and database-based continuation migration logic is executed.

[0053] Specifically, there are two scenarios for continuing the migration operation: one is that the system service process is not shut down after the pause, and the other is that the system service is shut down after the pause, and then the migration continues after the system service is restarted.

[0054] After obtaining the task ID for resuming the migration, the system service node checks if the task exists in memory. If the task exists (meaning the system service process was not shut down after the pause), the memory-based migration continuation logic will be executed. If the task does not exist (meaning the system service was shut down after the pause), the task-related information stored in the database will be read, and the database-based migration continuation logic will be executed.

[0055] Step 105: Based on different migration continuation logics, determine the migration resources required for the recovery migration task based on the stored migration data, and determine the execution stage information corresponding to the recovery migration task when it is paused, so as to start the recovery migration process based on the execution stage corresponding to the migration resources required when it is paused.

[0056] This application's embodiments address two scenarios for continuing the migration operation. One scenario involves the system service process not shutting down after a pause, and the migration continuing. In this case, relevant resources (connection pools, thread pools, etc. on the system service node and migration service node) need to be restored first, and then the blocking in the system service node needs to be released to continue task allocation and migration. The other scenario involves the system service being shut down after a pause, and then restarting the system service to continue migration. In this case, the system service node needs to first restore to the execution phase at the time of the pause, then acquire the unexecuted tasks from that phase, restore it, and continue migration, migrating the tasks in subsequent execution phases.

[0057] In one implementation of this application, when executing memory-based continuation migration logic, the recovery migration task is marked as being in a recovery state. The relevant resources corresponding to the recovery migration task when it was paused are determined, and a signal to resume the migration task is sent to the corresponding migration service node. These relevant resources include at least one of the following: connection pool, thread pool, task dispatch thread, monitoring thread, and work queue, which were present before the recovery migration task was paused. The blocked waiting threads are restarted, and the recovery migration task is marked as being in progress.

[0058] Specifically, when executing the memory-based continuation migration logic, the migration task is marked as being resumed. First, resources are created, including a connection pool, thread pool, task dispatch thread, monitoring thread, and work queue. Then, a signal to resume the migration task is sent to all available migration service nodes. After the resources are restored, the blocked waiting threads are awakened, and the task is marked as running.

[0059] In one implementation of this application, when executing the database-based continuation migration logic, the task-related information corresponding to the recovery migration task is retrieved from the database based on the identifier corresponding to the recovery migration task. Based on the task-related information, the currently paused execution phase recorded when the task was paused is determined. Execution phases preceding this phase are skipped, and tasks not yet executed in the current execution phase are resumed, and migration begins.

[0060] Specifically, first, resources are created, including a connection pool, a thread pool, a task distribution thread, a monitoring thread, and a work queue. Then, a signal to resume the migration of the task is sent to all available migration service nodes. After that, based on the currently paused execution phase recorded at the time of the pause, the phases before the current pause are skipped, and then the execution tasks that have not yet been executed in the current phase are resumed for migration.

[0061] Figure 4 A flowchart of a continued migration task is provided for an embodiment of this application, such as... Figure 4 As shown, the continued migration task process includes the following steps:

[0062] The system service obtains the task identifier that needs to be restored from the migration.

[0063] The system service checks if information related to the migration task exists in memory;

[0064] If the task exists in memory, meaning the system service process was not shut down after the pause, then the memory-based continuation migration logic is executed:

[0065] First, request resources and create necessary resources such as connection pool, thread pool, task dispatch thread, monitoring thread, and work queue; send a signal to all available migration service nodes to resume the task; after resources are restored, wake up the blocked waiting threads; mark the migration task as RUNNING and persist this state; continue the allocation and execution of subsequent migration tasks directly from the breakpoint when it was paused.

[0066] If the task does not exist in memory, meaning the system service process has been shut down and restarted after the pause, the database-based continuation migration logic is executed: first, the task-related information stored in the database is read, and the migration context is initialized; resources are requested, and various migration-related resources are created; completed migration service phases are registered, and the completed DB and SCHEMA phases are skipped based on the execution phase information recorded at the time of the pause; the migration task is marked as RUNNING and the state is persisted; starting from the execution phase at the time of the pause, tasks that have not yet been executed in that phase are resumed, and the migration tasks of subsequent phases are executed in a loop.

[0067] Both logics ultimately return a result indicating that the migration has successfully started, ensuring that the migration task continues smoothly from the pause point.

[0068] In one implementation of this application, after responding to the recovery migration request, the workload of the migration task is detected, and if the migration task changes, the migration service node is dynamically expanded or reduced based on the changed workload.

[0069] Specifically, when a migration task is paused, in addition to recording execution phase information, a baseline snapshot of the task volume is generated. This snapshot may include: the original volume of incomplete tasks, the resource configuration of the migration service nodes at that time, and the task allocation status. After responding to a recovery request, before executing the continued migration logic, a task volume detection step involving baseline comparison and real-time probing is added. This includes: reading the baseline snapshot from the status database at the time of pause, comparing it with the current incomplete tasks, identifying explicit changes in task volume, and calculating the difference in changes; capturing implicit changes through source database log monitoring and table structure parsing, such as adding an index to a table that increases migration complexity, updating the task complexity weight, and synchronizing the detection results to the system service.

[0070] Furthermore, if the system is in the full data migration phase and the new tasks involve large table data, the system service will automatically trigger targeted scaling: it will call the preset large file migration dedicated nodes from the resource pool, proportionally split the new data volume across the new nodes, and maintain the task continuity of the original nodes. If the system is in the SCHEMA migration phase and a large number of new stored procedure tasks are added, CPU-intensive nodes will be prioritized during scaling, and the stored procedure dependencies of the source database will be automatically synchronized to the new nodes to avoid task failures due to missing environments.

[0071] Secondly, if the workload decreases during recovery, the system service first checks the current node load. Nodes with loads below a certain threshold, such as 30%, are marked for scaling down. Their unfinished tasks are migrated to other nodes, and node resources are released after the tasks are cleared. If the reduced tasks are originally high-resource-consuming tasks, one node is shut down first, and the processing speed of the remaining tasks is monitored. If there is no decrease in efficiency, another node is shut down after 3 minutes to avoid excessive scaling down affecting subsequent tasks.

[0072] When expanding or shrinking nodes, the node-task mapping relationship in the state database is updated synchronously to ensure that if a pause is triggered again, the task state of the new node can be fully recorded, and the breakpoint can be traced across nodes when resuming.

[0073] Figure 5 This is a schematic diagram of a pause and resume device during a heterogeneous database migration process, provided as an embodiment of this application. Figure 5As shown, a pause and resume device 200 for database migration includes: at least one processor 201; and a memory 202 communicatively connected to the at least one processor 201. The memory 202 stores instructions executable by the at least one processor 201. These instructions, when executed by the at least one processor 201, enable the at least one processor 201 to: receive real-time status information corresponding to a migration task and store the real-time status information; respond to a pause migration request, determine the migration service node corresponding to the paused migration task, and pause the paused migration task based on a pause completion signal fed back by the migration service node; store the execution stage information corresponding to the paused migration task; respond to a resume migration request, and execute different continue migration logics based on the closed state of the system service; and, based on the stored migration data, determine the migration resources required for the resumed migration task and the execution stage information corresponding to the resumed migration task during the pause, so as to start the resumed migration process based on the execution stage corresponding to the migration resources required during the pause.

[0074] This application provides a non-volatile computer storage medium storing computer-executable instructions. The computer-executable instructions are configured to: receive real-time status information corresponding to a migration task and store the real-time status information; respond to a pause migration request, determine the migration service node corresponding to the paused migration task, and pause the paused migration task based on the pause completion signal fed back by the migration service node; store the execution stage information corresponding to the paused migration task; respond to a resume migration request, and execute different continue migration logic based on the closed state of the system service; and, based on the stored migration data, determine the migration resources required for the resumed migration task and the execution stage information corresponding to the resumed migration task at the time of pause, so as to start the resumed migration process based on the execution stage corresponding to the migration resources at the time of pause.

[0075] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0076] The above descriptions are merely embodiments of this application and are not intended to limit the scope of this application. For those skilled in the art, various modifications and variations can be made to the embodiments of this application. These modifications or substitutions do not cause the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions in the embodiments of this application.

Claims

1. A method for pausing and resuming during migration of a heterogeneous database, characterized in that, The method includes: Receive real-time status information corresponding to the migration task and store the real-time status information; In response to the request to pause migration, the migration service node corresponding to the paused migration task is identified, and the paused migration task is paused based on the pause completion signal fed back by the migration service node. Store the execution phase information corresponding to the paused migration task; In response to a recovery migration request, different continuation migration logic is executed based on the shutdown status of the system service. Specifically, this includes: determining a recovery migration task based on the recovery migration request; if the system service is not shut down, retrieving the recovery migration task from memory and executing memory-based continuation migration logic; if the system service is shut down, retrieving the task-related information corresponding to the recovery migration task from the database and executing database-based continuation migration logic. Based on the different migration continuation logics, the migration resources required for the recovery migration task are determined based on the stored migration data, and the execution stage information corresponding to the recovery migration task when it is paused is determined, so as to start the recovery migration process based on the execution stage corresponding to the migration resources when it is paused. The execution of the memory-based continuation migration logic specifically includes: Mark the recovery migration task as being in a recovery state; The relevant resources corresponding to the resume migration task when it was paused are determined, and a signal to resume the migration task is sent to the corresponding migration service node; wherein, the relevant resources include at least one of the following: connection pool, thread pool, task distribution thread, monitoring thread and work queue corresponding to the resume migration task before it was paused; Restart the blocked and waiting thread, and mark the recovery migration task as in progress; The step of retrieving task-related information corresponding to the recovery migration task from the database and executing database-based continuation migration logic specifically includes: Based on the identifier corresponding to the recovery migration task, query the task-related information corresponding to the recovery migration task in the database; Based on the task-related information corresponding to the recovery migration task, the execution phase that was paused when the task was paused is determined; Skip the execution phases preceding this one, resume unexecuted tasks in the current execution phase, and begin the migration.

2. The method of suspension and resumption in heterogeneous database migration according to claim 1, wherein, The process of receiving and storing the real-time status information corresponding to the migration task specifically includes: Receive real-time status information corresponding to the migration task sent by the migration service node; wherein, the real-time status information includes at least one of the following corresponding to the migration task: migration service node information, start read status information, start write status information, end read status information, end write status information, finish status information, and error status information; The received real-time status information is stored in the database through the system service node.

3. The method for pausing and resuming during heterogeneous database migration according to claim 1, characterized in that, The response to the pause migration request determines the migration service node corresponding to the paused migration task, specifically including: Based on the request to pause migration, the migration task is determined to be paused, and the status of the paused migration task is changed to paused. Identify the task dispatcher corresponding to the paused migration task and mark the task dispatcher as paused; Based on the task identifier corresponding to the paused migration task, the migration service node corresponding to the paused migration task is determined in the database, and a task pause signal is sent to the migration service node.

4. The method for pausing and resuming during heterogeneous database migration according to claim 1, characterized in that, The process of pausing the paused migration task based on the pause completion signal fed back by the migration service node specifically includes: If the migration service node does not have any tasks being executed, receive the pause completion signal from the migration service node; If the migration service node has a task in progress, after the migration service node finishes executing the task, a pause completion signal is received from the migration service node. If all migration service nodes corresponding to the paused migration task send the pause completion signal, the paused migration task is changed to a paused state, and the migration resources corresponding to the paused migration task are released.

5. The method for pausing and resuming during heterogeneous database migration according to claim 1, characterized in that, The method further includes, after responding to the migration recovery request and executing different migration continuation logic based on the shutdown state of the system service, the method also includes: Perform workload detection on the migration task; If the migration task changes, the migration service nodes will be dynamically expanded or reduced based on the changed task volume.

6. A device for pausing and resuming operations during heterogeneous database migration, characterized in that: The device includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to perform the method described in any one of claims 1-5.

7. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are capable of performing the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Data processing method and device

    CN120315638A

  • Checkpoint methods and systems utilizing non-disk persistent memory

    US20050203974A1