Data migration method and device, equipment and storage medium

By migrating data in the distributed storage system, the problem of OSS offline caused by NVMe or SSD failure is solved, the data migration is efficient and reliable, and the impact on the business is reduced.

CN118605804APending Publication Date: 2024-09-06JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410705629.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-06

Smart Images

  • Figure CN118605804A
    Figure CN118605804A
Patent Text Reader

Abstract

According to the data migration method provided by the embodiment of the invention, the source equipment and the target equipment corresponding to the data migration request are determined, the compressed data in the source equipment are migrated into the target equipment, new compressed data are stopped from being stored into the first area in the source equipment, and the first pointer pointing to the first area in the source equipment points to the target equipment. And storing the new compressed data to a first area in the target device through the first pointer, migrating the bottom layer data in the source device to the target device, stopping storing the new bottom layer data to the source device, and pointing a second pointer pointing to a second area in the source device to a second area in the target device, and storing the new underlying data to the second region in the target device through the second pointer, and storing the log data in the log region in the source device to the second region of the target device. The data content of the source device is gradually migrated to the target device without influencing data writing, so that the data writing efficiency is improved, and the user experience is improved. And the influence on customer businesses is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data migration method, device, equipment and storage medium. Background Art

[0002] Distributed storage systems can easily manage hundreds or thousands of nodes and build large-scale clusters with storage capacity of PB (Petabyte) or above. Distributed storage systems are increasingly used in daily life and production. As the running time increases, various electronic components face the risk of aging and failure, a typical example of which is disk damage, including NVMe (Non-Volatile Memory Express, solid-state storage) and SSD (Solid State Disk or Solid State Drive, solid-state hard disk) damage.

[0003] OSS (Object Storage Service) is a data storage service in a distributed storage system. OSS divides the data in the storage system into two parts: business data and metadata. The metadata includes index information, additional information, and extended information of the business data.

[0004] In actual applications, the amount of metadata is much smaller than that of business data, but the read and write performance requirements for metadata are higher, and NVMe or SSD are usually used to store metadata. Due to the large capacity of NVMe or SSD, one NVMe or SSD is generally used to deploy multiple OSSs. It can be seen that if NVMe or SSD fails, it will affect many OSSs, causing a large number of OSSs to go offline and exit the cluster, causing irreparable losses to customers. Summary of the invention

[0005] In view of the above problems, a data migration method, device, equipment, and storage medium are proposed to overcome the above problems or at least partially solve the above problems, including:

[0006] In a first aspect of the implementation of the present invention, a data migration method is first provided, which is applied to a distributed storage system, wherein the storage area of ​​a device in the distributed storage system includes a log area, a first area, and a second area, wherein the log area is used to store log data, the first area is used to store compressed data, and the second area is used to store underlying data. The method includes:

[0007] Obtaining a data migration request, determining a source device corresponding to the data migration request, and determining a target device matching the source device in the distributed storage system;

[0008] In response to the data migration request, migrate the compressed data in the first area of ​​the source device to the first area of ​​the target device, and during the compressed data migration, stop storing new compressed data in the first area of ​​the source device;

[0009] Obtaining a first pointer pointing to a first area in the source device, pointing the first pointer to a first area in the target device, and storing new compressed data in the first area in the target device through the first pointer;

[0010] Migrating the underlying data in the second area of ​​the source device to the second area of ​​the target device, and during the migration of the underlying data, stopping storing new underlying data in the second area of ​​the source device;

[0011] Obtaining a second pointer pointing to the second area in the source device, pointing the second pointer to the second area in the target device, and storing new underlying data in the second area in the target device through the second pointer;

[0012] The log data in the log area of ​​the source device is stored in the second area of ​​the target device to complete the data migration.

[0013] Optionally, before responding to the data migration request, the step includes:

[0014] Obtaining device partition information of the source device;

[0015] Partition the target device according to the device partition information.

[0016] Optionally, the migrating the compressed data in the first area of ​​the source device to the first area of ​​the target device, and stopping storing new compressed data in the first area of ​​the source device during the compressed data migration process, includes:

[0017] Obtaining compressed data of each level in the first region, and calculating a first total amount of the compressed data, wherein the first region includes compressed data of several levels;

[0018] Obtaining a preset migration threshold and a single migration rule, wherein the migration threshold is used to indicate a maximum amount of data for a single migration of the compressed data, and the single migration rule includes a single migration time interval and a single migration data amount;

[0019] When the first data total amount is greater than the first data migration threshold, migrating the compressed data to the first area in the target device according to the single migration rule;

[0020] When the first data amount is less than or equal to the first data migration threshold, migrating the compressed data to a first area in the target device;

[0021] During the compressed data migration process, stopping the data compression process for the first area in the source device to stop storing new compressed data in the first area in the source device;

[0022] Pointing the first pointer to the first area in the target device includes:

[0023] After determining that the compressed data in the first area in the source device is migrated to the first area in the target device, the pointing position of the first pointer is modified to the first area in the target device.

[0024] Optionally, during the migration of the underlying data, stopping storing new underlying data in the second area of ​​the source device includes:

[0025] During the migration of the underlying data, stopping the data flushing process for the second area in the source device to stop storing new underlying data in the second area in the source device;

[0026] Pointing the second pointer to the second area in the target device includes:

[0027] After the underlying data in the second area in the source device is migrated to the second area in the target device, the pointing position of the second pointer is modified to the second area in the target device.

[0028] Optionally, before storing the log data in the log area of ​​the source device to the second area of ​​the target device, the step includes:

[0029] Adding a log pointer to the log area of ​​the target device;

[0030] The new log data is stored in the log area of ​​the target device through the log pointer.

[0031] Optionally, the method further includes:

[0032] Get the migration query instruction;

[0033] In response to the migration query instruction, when the compressed data in the first area of ​​the source device is migrated to the first area of ​​the target device, a first migration data volume corresponding to the migrated data in the compressed data is obtained, and a first migration progress is calculated according to the first migration data volume;

[0034] When the underlying data in the second area in the source device is migrated to the second area in the target device, setting the second migration progress to completion;

[0035] When storing the log data in the log area of ​​the source device to the second area of ​​the target device, obtaining the remaining log data amount in the log area of ​​the source device, and calculating a third migration progress according to the remaining log data amount;

[0036] Output migration progress, the migration progress including at least one of a first migration progress, a second migration progress and a third migration progress, wherein the first migration progress is used to represent the migration progress of the compressed data, the second migration progress is used to represent the migration progress of the underlying data, and the third migration progress is used to represent the migration progress of the log data.

[0037] Optionally, during the compressed data migration process, stopping storing new compressed data in the first area of ​​the source device includes:

[0038] During the compressed data migration process, the compressed data is verified according to a cyclic redundancy check algorithm and new compressed data is stopped from being stored in the first area of ​​the source device;

[0039] During the migration of the underlying data, stopping storing new underlying data in the second area of ​​the source device includes:

[0040] During the migration of the underlying data, the underlying data is verified according to a cyclic redundancy check algorithm and storage of new underlying data in the second area of ​​the source device is stopped.

[0041] In a second aspect of the present invention, a data migration device is provided, which includes:

[0042] a request acquisition module, configured to acquire a data migration request, determine a source device corresponding to the data migration request, and determine a target device matching the source device in the distributed storage system;

[0043] a request response first module, configured to migrate the compressed data in the first area of ​​the source device to the first area of ​​the target device in response to the data migration request, and to stop storing new compressed data in the first area of ​​the source device during the compressed data migration process;

[0044] A first pointer modification module, used for obtaining a first pointer pointing to a first area in the source device, pointing the first pointer to the first area in the target device, and storing new compressed data in the first area in the target device through the first pointer;

[0045] The request response second module is used to migrate the underlying data in the second area of ​​the source device to the second area of ​​the target device, and during the migration of the underlying data, stop storing new underlying data in the second area of ​​the source device;

[0046] A second pointer modification module is used to obtain a second pointer pointing to the second area in the source device, point the second pointer to the second area in the target device, and store new underlying data in the second area in the target device through the second pointer;

[0047] The log migration module is used to store the log data in the log area of ​​the source device to the second area of ​​the target device to complete the data migration.

[0048] In the third aspect of the implementation of the present invention, there is also provided an electronic device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, it implements any of the above-mentioned data migration methods.

[0049] In a fourth aspect of the implementation of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored, and when the computer program is executed by a processor, any of the above-mentioned data migration methods is implemented.

[0050] The embodiments of the present invention have the following advantages:

[0051] The data migration method provided by the embodiment of the present invention obtains a data migration request, determines a source device corresponding to the data migration request, and determines a target device matching the source device in a distributed storage system. In response to the data migration request, the compressed data in the first area of ​​the source device is migrated to the first area of ​​the target device. During the compressed data migration process, the new compressed data is stopped from being stored in the first area of ​​the source device. A first pointer pointing to the first area of ​​the source device is obtained, and the first pointer is pointed to the first area of ​​the target device. Through the first pointer, the new compressed data is stored in the first area of ​​the target device. The underlying data of the second area of ​​the source device is migrated to the second area of ​​the target device. During the underlying data migration process, the new underlying data is stopped from being stored in the second area of ​​the source device. A second pointer pointing to the second area of ​​the source device is obtained, and the second pointer is pointed to the second area of ​​the target device. Through the second pointer, the new underlying data is stored in the second area of ​​the target device. The log data of the log area of ​​the source device is stored in the second area of ​​the target device to complete the data migration. The embodiment of the present invention realizes the gradual migration of the data content of the source device to the target device without affecting data writing, thereby reducing the impact on customer services. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0053] Figure 1 is a flowchart of the steps of a data migration method provided by some embodiments of the present invention;

[0054] Figure 2 is a diagram of the structure of an object storage service provided by some embodiments of the present invention;

[0055] Figure 3 is an object storage service deployment diagram provided by some embodiments of the present invention;

[0056] Figure 4 is a disk management layer structure diagram provided by some embodiments of the present invention;

[0057] Figure 5 is a schematic diagram of data writing provided by an embodiment of the present invention;

[0058] Figure 6 is a schematic diagram of data reading provided by an embodiment of the present invention;

[0059] Figure 7 It is a structural schematic diagram of a data migration device provided in some embodiments of the present invention. DETAILED DESCRIPTION

[0060] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0061] Reference Figure 1 , shows a flowchart of the steps of a data migration method provided by some embodiments of the present invention, which may specifically include the following steps:

[0062] Step 101: Obtain a data migration request, determine a source device corresponding to the data migration request, and determine a target device matching the source device in the distributed storage system.

[0063] Data migration is the process of moving data from one storage device or storage system to another. In the process of data migration, the source device is the starting point of the data migration process. It is the device that currently stores data and contains all the data that needs to be migrated. The source device can be a physical server, virtual machine, storage array, tape library, cloud storage service or any other form of storage medium. The target device is the end point of the data migration process. It will receive the data migrated from the source device. The target device can be new hardware, upgraded system, cloud platform, backup system or any other form of storage medium. The target device must have enough storage space to accommodate the migrated data.

[0064] After receiving a data migration request, you first need to determine the source device corresponding to the data migration request, that is, determine which device's data needs to be migrated, and you need to determine the target device that matches the source device. The target device needs to be compatible with the source device to ensure that the data can be correctly migrated and used.

[0065] In some embodiments of the present invention, the data in the storage system is divided into a business data area and a metadata area through OSS. Figure 2 This is a diagram of the object storage service structure provided by some embodiments of the present invention. In practical applications, the business data area generally uses a HDD (Hard Disk Drive) with a capacity of more than TB (Terabyte, a unit of data storage capacity of terabyte); the amount of data in the metadata area is much less than that of the business data, usually 35G to 50G capacity is sufficient, but the data in the metadata area has higher requirements for read and write performance, and generally uses NVMe or SSD, but NVMe or SSD has a large capacity, and usually one NVMe or SSD corresponds to multiple OSS deployment methods, such as Figure 3 It is an object storage service deployment diagram provided by some embodiments of the present invention, which shows a typical deployment method of OSS. It can be seen that if NVMe or SSD fails, a large number of OSS will be offline, affecting business performance and data security. In the most serious cases, data loss may occur due to cluster abnormalities, causing irreparable losses to users. Therefore, when migrating the metadata corresponding to the OSS object storage service, it is necessary to be extremely cautious. After obtaining the data migration request for the OSS metadata, the device model of the migrated device is determined. Assuming that the source device is an NVMe device, a new NVMe device is inserted into the redundant interface of the distributed storage system as a target device that matches the source device for data migration. The new NVMe device is as consistent as possible with the model and size of the migrated NVMe device.

[0066] Step 102: In response to the data migration request, migrate the compressed data in the first area of ​​the source device to the first area of ​​the target device, and during the compressed data migration process, stop storing new compressed data in the first area of ​​the source device.

[0067] The first area refers to the area used to store compressed data. When writing data, it will first be written into the memory table, and then reach the disk storage device through the memory table. At this time, the data will be compressed again. Compression here can also be understood as merging. In the compression process, duplicate data is deleted to obtain compressed data, which is then stored in the first area, thereby reducing the use of storage space and improving reading efficiency.

[0068] During the data migration process, it is necessary to ensure that all data can be accurately transmitted to the target device. Therefore, during the compressed data migration process, by stopping storing new compressed data in the first area in the source device, the content of the first area in the source device no longer changes, thereby ensuring that the compressed data in the first area is all accurately migrated to the target device.

[0069] In some embodiments of the present invention, a disk management layer may be provided between the database and the disk to control the process of writing data to or reading data from various types of disks, such as Figure 4 The disk management layer generally includes the following functions: cache management, the disk management layer can implement an efficient cache strategy to cache frequently accessed data in the memory to reduce the read and write operations on the physical disk, thereby improving the response speed of the database; data stratification, by stratifying data between storage media with different performances, the disk management layer can automatically adjust the storage location of the data according to the access frequency and importance of the data to optimize cost and performance; data compression and deduplication, through compression and deduplication technology, the disk management layer can reduce the storage space occupied and improve storage efficiency; in addition, the disk management layer can monitor the performance indicators of the storage system and provide analysis tools to help administrators optimize storage configuration and database performance. The disk management layer can optimize the performance of data storage and access, and facilitate data management.

[0070] Specifically, RocksDB can be used as a disk management layer between the database and the disk, such as Figure 5It is a data writing schematic diagram provided by an embodiment of the present invention, specifically, it is a data writing process when RocksDB is used as a disk management layer. When writing data, the data is first written to the log area through the write interface; the second step is to write the data to the active memory table through the write interface after confirming that the data is written to the log area. The third step is that when the active memory table receives a certain amount of data, the active memory table will switch its state to become an immutable memory table. The immutable memory table is still stored in the memory, but it is in a read-only state and no longer accepts new write operation changes, which means that its data will not be modified or deleted. The fourth step is that when the immutable memory table reaches a certain number, the underlying data is written to the table file at the 0th level through the flushing process, and the related content of the log data written in the early stage is deleted. After the underlying data in the first area reaches a certain number, it will be compressed into compressed data through a compression or merging process (compaction) and written from the first level to the lower layers. As shown in the figure Figure 5 As shown, in some embodiments of the present invention, the first area refers to the first level to the nth level of the data area. Therefore, the compression process of RocksDB is firstly paused to ensure that there will be no new writing of compressed data of the first level and higher levels. At the same time, the compressed data of the first area in the source device is migrated to the first area in the target device.

[0071] In some embodiments of the present invention, migrating the compressed data in the first area of ​​the source device to the first area of ​​the target device, and stopping storing new compressed data in the first area of ​​the source device during the data migration process, includes the following sub-steps:

[0072] Sub-step 11: Obtain compressed data of each level in the first region, and calculate a first total amount of the compressed data, wherein the first region includes compressed data of several levels.

[0073] from Figure 5 It can be seen that there are multiple levels of compressed data in the first area. During the migration process, the amount of data to be migrated needs to be determined. Therefore, the compressed data of each level in the first area needs to be calculated to obtain the total amount of first data.

[0074] In some embodiments of the present invention, all levels in the first region are traversed, from level 1 to level n, to determine the total amount of compressed data of all levels in the first region. For example, if there are 10 levels, the total amount of compressed data from level 1 to level 10 is calculated.

[0075] Sub-step 12: Obtain a preset migration threshold and a single migration rule, wherein the migration threshold is used to indicate a maximum data volume of a single migration of the compressed data, and the single migration rule includes a single migration time interval and a single migration data volume.

[0076] The migration threshold refers to the maximum amount of data that can be migrated. The single migration rule is used to specify the rules that need to be followed for a single data migration. The time interval for a single migration refers to the time interval between two migrations. If the amount of data is too large, the data will be migrated in batches. However, each single migration is not necessarily continuous. In this case, the time interval for a single migration is used to set the time interval between two migrations. The single migration data volume refers to the amount of data migrated in one time.

[0077] After calculating the first total amount of compressed data, it is necessary to obtain a preset migration threshold and a single migration rule, so as to migrate the compressed data according to the rule.

[0078] In some embodiments of the present invention, the total amount of compressed data of all levels is traversed and calculated to obtain the total amount of first data. If the total amount of first data is too large, it needs to be migrated in batches. For example, if the total amount of compressed data is 100 files and the preset migration threshold is 10 files, it means that the compressed data cannot be migrated at one time.

[0079] Sub-step 13: When the first data total amount is greater than the first data migration threshold, migrate the compressed data to the first area in the target device according to the single migration rule.

[0080] When the first total amount of compressed data is greater than the first data migration threshold, it indicates that the data amount is too large. At this time, the data can be migrated in batches, that is, the compressed data is migrated to the first area in the target device according to a single migration rule.

[0081] In some embodiments of the present invention, when the first total amount of compressed data is greater than the first data migration threshold, migration can be performed in batches according to preset migration rules. For example, 10 files are migrated each time and the migration is performed 10 times. In addition, the 10 migrations can also be processed discontinuously. After one migration, the second migration can be performed after a fixed time. The time interval of a single migration and the amount of data migrated in a single migration can be adjusted according to actual conditions. With the development of storage technology, the amount of data migrated in a single migration can be increased, and the time interval of a single migration can be shortened, thereby improving the efficiency of migration.

[0082] Sub-step 14: When the first data total amount is less than or equal to the first data migration threshold, migrate the compressed data to the first area in the target device.

[0083] When the first total amount of compressed data is less than or equal to the first data migration threshold, it indicates that the data amount is relatively small and can be migrated at one time. In this case, the compressed data is directly migrated to the first area in the target device.

[0084] In some embodiments of the present invention, if the first total amount of compressed data is less than or equal to the first data migration threshold, assuming that the migration threshold is 10 files, and there are only 9 files that need to be migrated, then there is no need to perform multiple migrations according to the migration rules, and the compressed data can be migrated to the target device at one time, thereby realizing a migration process that is more suitable for the actual situation and is planned based on the actual amount of data.

[0085] Sub-step 15: During the compressed data migration process, stop the data compression process for the first area in the source device to stop storing new compressed data in the first area in the source device.

[0086] From the foregoing content, it can be seen that the data writing process includes a log writing process, a process in which memory data is flushed to obtain underlying data and flushed into the second area, and a process in which underlying data is compressed to become compressed data and compressed to the first area. Therefore, during the data migration process, it is necessary to stop the data compression process in the first area of ​​the source device, thereby stopping the storage of new compressed data in the first area of ​​the source device.

[0087] In some embodiments of the present invention, RocksDB is used as a disk management layer to control the data compression process for the first area of ​​the source device to be paused or stopped, so as to migrate the metadata targeted by OSS. Moreover, since only the data compression process is stopped, the OSS does not need to be stopped to migrate the compressed data in the metadata.

[0088] In some embodiments of the present invention, during the compressed data migration process, stopping storing new compressed data in the first area of ​​the source device includes:

[0089] During the compressed data migration process, the compressed data is verified according to a cyclic redundancy check algorithm and storage of new compressed data in the first area of ​​the source device is stopped.

[0090] Among them, Cyclic Redundancy Check (CRC) is a data transmission error detection function that can determine whether the data has been changed or whether an error has occurred during the transmission process. The CRC algorithm works by generating a short, fixed-length data block (called a checksum or CRC value) that is a mathematical function of the original data. The CRC algorithm is fast and can detect most common transmission errors.

[0091] In some embodiments of the present invention, during the data migration process, the compressed data is verified according to the CRC algorithm. If the verification is successful, it means that the compressed data migration is successful. Through data consistency and data integrity verification, the availability of the compressed data before and after migration is guaranteed, ensuring that the compressed data after migration can be used normally and with high reliability.

[0092] In some embodiments of the present invention, before step 102, the following sub-steps are included:

[0093] Sub-step 21: Obtain device partition information of the source device.

[0094] Dividing storage devices into different areas is a common management strategy that helps improve the efficiency and security of data management. The areas into which a storage device is divided and what data each area is used to store are called device partition information.

[0095] In order to migrate the data in the source device more reasonably, it is necessary to obtain the device partition information of the source device.

[0096] In some embodiments of the present invention, since the storage area of ​​the source device includes the log area, the first area, and the second area, by obtaining the device partition information of the source device, the partition sizes of the log area, the first area, and the second area, as well as the type of data stored in each partition can be obtained.

[0097] Sub-step 22: partitioning the target device according to the device partition information.

[0098] Before data migration, the target device is partitioned according to the partition information of the source device.

[0099] In some embodiments of the present invention, after obtaining the partition information of the source device, the target device can be partitioned and set in the same or similar manner according to the size of each area and the type of data stored in each partition, so that the partitions of the target device are consistent with the source device, thereby improving the success rate of data migration.

[0100] Step 103: Obtain a first pointer pointing to the first area in the source device, point the first pointer to the first area in the target device, and store new compressed data in the first area in the target device through the first pointer.

[0101] After the compressed data is migrated to the target device, it is also necessary to guide the subsequent new data to be written to the target device instead of the source device. Therefore, it is necessary to modify the pointer originally pointing to the first area of ​​the source device and point the pointer to the first area of ​​the target device so that the new data can be accurately written to the target device.

[0102] Therefore, it is necessary to obtain a first pointer pointing to the first area in the source device and point the first pointer to the first area in the target device. The newly received compressed data can be stored in the first area in the target device through the first pointer pointing to the first area in the target device.

[0103] In some embodiments of the present invention, the step of pointing the first pointer to the first area in the target device includes the following sub-steps:

[0104] Sub-step 31: after determining that the compressed data in the first area in the source device is migrated to the first area in the target device, modify the pointing position of the first pointer to the first area in the target device.

[0105] In some embodiments of the present invention, to ensure that the compressed data in the first area is completely migrated, after determining that all data in the first area in the source device is migrated to the first area in the target device, the position pointed to by the first pointer is modified to the first area in the target device.

[0106] Step 104: Migrate the underlying data in the second area of ​​the source device to the second area of ​​the target device, and during the migration of the underlying data, stop storing new underlying data in the second area of ​​the source device.

[0107] The second area refers to an area for storing underlying data. External data is first written into a memory table before being written into the disk, and then reaches the first level of the disk storage device through the memory table and is stored as underlying data.

[0108] like Figure 5 As shown, in some embodiments of the present invention, the second area refers to the 0th level of the data area. During the data migration process, it is necessary to ensure that all data can be accurately transmitted to the target device. Therefore, during the migration of the underlying data of the second area, that is, the underlying data of the 0th level, by stopping storing new underlying data in the second area in the source device, the content of the second area in the source device no longer changes, thereby ensuring that the underlying data of the second area is all accurately migrated to the target device.

[0109] In some embodiments of the present invention, Figure 5 As shown in the figure, when the immutable memory table reaches a certain number, the underlying data is written into the first-level table file through the flushing process. At this time, RocksDB is used as the disk management layer to control the data flushing process for the second area of ​​the source device to pause or stop. This ensures that no new underlying data will be written to the second area of ​​the source device. At the same time, the underlying data in the second area of ​​the source device is migrated to the second area of ​​the target device.

[0110] In some embodiments of the present invention, during the process of migrating the underlying data, stopping storing new underlying data in the second area of ​​the source device includes:

[0111] During the migration of the underlying data, the underlying data is verified according to a cyclic redundancy check algorithm and storage of new underlying data in the second area of ​​the source device is stopped.

[0112] In some embodiments of the present invention, the underlying data is verified according to the CRC algorithm during the data migration process. If the verification is successful, it indicates that the underlying data migration is successful. Through data consistency and data integrity verification, it is ensured that the migrated underlying data can be used normally and has high reliability.

[0113] In some embodiments of the present invention, during the process of migrating the underlying data, stopping storing new underlying data into the second area in the source device includes the following sub-steps:

[0114] Sub-step 41: During the migration of the underlying data, stop the data flushing process for the second area in the source device to stop storing new underlying data in the second area in the source device.

[0115] In the process of migrating the underlying data in the second area of ​​the source device to the second area of ​​the target device, in order to ensure the accuracy of data migration, it is necessary to stop the data flushing process for the second area of ​​the source device, thereby stopping storing new underlying data in the second area of ​​the source device.

[0116] In some embodiments of the present invention, by stopping the data flushing process for the second area of ​​the source device, the underlying data in the metadata targeted by the OSS is further migrated, and because only the data flushing process is stopped, the OSS does not need to be stopped to migrate the underlying data in the metadata.

[0117] Step 105: Obtain a second pointer pointing to the second area in the source device, point the second pointer to the second area in the target device, and store new underlying data in the second area in the target device through the second pointer.

[0118] After the underlying data is migrated to the target device, it is also necessary to guide subsequent new data to be written to the target device instead of the source device. Therefore, it is necessary to modify the pointer originally pointing to the second area of ​​the source device and point the pointer to the second area of ​​the target device so that the new underlying data can be accurately written to the target device.

[0119] Therefore, it is necessary to obtain a second pointer pointing to the second area in the source device, and point the second pointer to the second area in the target device. The new underlying data can be stored in the second area in the target device through the second pointer pointing to the second area in the target device.

[0120] In some embodiments of the present invention, the step of pointing the second pointer to the second area in the target device includes the following sub-steps:

[0121] Sub-step 51: After the underlying data in the second area in the source device is migrated to the second area in the target device, modify the pointing position of the second pointer to the second area in the target device.

[0122] In some embodiments of the present invention, in order to ensure that the underlying data of the second area is completely migrated, after determining that all data in the second area in the source device is migrated to the second area in the target device, the position pointed to by the second pointer is modified to the second area in the target device.

[0123] Step 106: Store the log data in the log area of ​​the source device to the second area of ​​the target device to complete data migration.

[0124] After completing the migration of compressed data and underlying data, the source device may still store some log data that has not been written to the disk. Therefore, it is necessary to migrate the log data in the log area of ​​the source device.

[0125] Storing the log data in the log area of ​​the source device in the second area of ​​the target device indicates that all the data in the source device has been successfully migrated, thereby completing the data migration.

[0126] In some embodiments of the present invention, before step 106, the following sub-steps are included:

[0127] Sub-step 61: Add a log pointer pointing to the log area of ​​the target device.

[0128] From the above steps, it can be seen that the compressed data, underlying data and log data of the source device are all migrated to the corresponding area of ​​the target device, but new log data from the outside world also needs to be written to the target device. In order to guide the new log data to be written to the target device, a new log pointer pointing to the log area of ​​the target device needs to be added.

[0129] In some embodiments of the present invention, a pointer to the log area of ​​the target device is added to write the new log to the log area of ​​the target device. At this time, the pointer to the log area of ​​the source device is not recovered to ensure that the data in the log area of ​​the source device is written to the level 1 of the second area of ​​the target device through the active memory table and the active table is converted into an immutable memory table, and then the relevant content is deleted at the same time. Therefore, after all the log data in the source device falls into the target device, the content of the old space will be empty. At this time, the pointer to the log area of ​​the source device is deleted. Once the pointer is deleted, it indicates that all the data in the source device has been migrated and the source device can be recycled.

[0130] Sub-step 62: storing new log data in the log area of ​​the target device through the log pointer.

[0131] Through the guidance of the log pointer, new log data can be stored in the log area of ​​the target device, so that the target device can serve as a new receiving device to receive data written by the outside world.

[0132] It can be seen from the foregoing that the OSS service in the present invention is not stopped, but only the three stages of writing data to the source device are paused respectively, and the data in different areas of the source device are migrated to the target device respectively. It is possible to migrate the metadata targeted by the OSS without stopping the OSS service, and the customer business is hardly affected. Since the present invention no longer affects the operation of the OSS, it is possible to achieve data migration of metadata corresponding to multiple OSSs at the same time, and concurrency is greatly improved.

[0133] In some embodiments of the present invention, the following steps are also included:

[0134] Get the migration query instruction.

[0135] The migration query instruction refers to an instruction used to query the migration progress during the data migration process. In some embodiments of the present invention, the progress of data migration is monitored through the migration query instruction.

[0136] In response to the migration query instruction, when the compressed data in the first area of ​​the source device is migrated to the first area of ​​the target device, a first migration data volume corresponding to the migrated data in the compressed data is obtained, and a first migration progress is calculated based on the first migration data volume.

[0137] In some embodiments of the present invention, in response to a migration query instruction, a migration progress query is provided. Since the amount of compressed data to be migrated may be large, this part uses the amount of data that has been migrated to calculate the migration progress of this stage. For example, if the compressed data in the first area of ​​the source device is 100G, and the amount of data that has been migrated is 10G, then the first migration progress is 10%.

[0138] When the underlying data in the second area in the source device is migrated to the second area in the target device, the second migration progress is set to completion.

[0139] Depend on Figure 5 It can be seen that the underlying data is stored in level 1, so the data volume is usually small. That is, the data volume of the underlying data in the second area of ​​the source device is small, so the migration can be completed in one time. In some embodiments of the present invention, the second migration progress is directly set to complete.

[0140] When storing the log data in the log area of ​​the source device to the second area of ​​the target device, the remaining log data amount in the log area of ​​the source device is obtained, and a third migration progress is calculated according to the remaining log data amount.

[0141] When external data is written to the disk, log data will be written accordingly. Usually, the amount of log data is not large, but since it may be impossible to control when the log can be completely flushed to the target device, the remaining amount of log data on the source device can be used to mark the progress of the third migration. For example, the amount of log data on the source device before migration is 100M. After a period of migration, there are still 10M of log data on the source device that have not been deleted. The third migration progress is calculated based on the remaining amount of log data, and the third migration progress is 90% at this time.

[0142] Output migration progress, the migration progress including at least one of a first migration progress, a second migration progress and a third migration progress, wherein the first migration progress is used to represent the migration progress of the compressed data, the second migration progress is used to represent the migration progress of the underlying data, and the third migration progress is used to represent the migration progress of the log data.

[0143] After obtaining the migration progress including at least one of the first migration progress, the second migration progress and the third migration progress, the migration progress is output. For example, if the output migration progress is 90% of the third migration progress, it means that the compressed data and the underlying data in the source device have been migrated, but 10% of the log data has not been migrated. If the output migration progress is 100% of the third migration progress, it means that the compressed data, the underlying data and the log data in the source device have all been migrated, so that the user can intuitively understand the stage of the current data migration and the progress of each stage.

[0144] Figure 6 This is a schematic diagram of the data reading process of an embodiment of the present invention. When data needs to be read, it will first be searched from the active memory table. If it cannot be found, it will be searched from the immutable memory table. If it cannot be found, it will be searched from the block cache. If it cannot be found, it will be searched from the disk files of level 0 to level n. After finding the data, the data will be written to the block cache first, where the block cache is the cache area for reading data. After the data migration is completed, the data can be read from the target device through this process.

[0145] Depend on Figure 3 It can be seen that the object storage service corresponds to not only metadata, but also a large amount of business data corresponding to the metadata, which is stored in the business data disk. In some other embodiments of the present invention, the business data of OSS is migrated to other disks used to store business data before the business data disk corresponding to OSS fails through the same migration mechanism. In this way, the process of disk failure exit and new disk addition in OSS is further optimized, minimizing the impact on customer business.

[0146] The following are the detailed steps of some embodiments of the present invention:

[0147] First, obtain a data migration request. First, you need to obtain a clear data migration request from the system or user. This request can include the reason, target, time window, and any specific migration requirements.

[0148] Second, determine the source device. According to the migration request, determine the source device that needs to migrate data. This may involve identifying the unique identifier of the source device, storage path and other information;

[0149] Third, determine the target device. In the distributed storage system, select one or more target devices based on the migration request and the information of the source device. The target device should have sufficient storage space and performance to receive the migrated data, and may need to be compatible with the source device in terms of data type, format or protocol. Determine whether there are redundant interfaces in the server corresponding to the storage system. If there are redundant interfaces, insert a new NVMe device that is consistent with the model and size of the migrated device, and use this new NV Me device as the target device.

[0150] Fourth, get the source device partition information. Access the source device and get its partition information, which may include the size, type, file system, etc. of the partition. The partition information is crucial to ensure that the partition of the target device matches the source device.

[0151] Fifth, partition the target device. According to the partition information of the source device, partition the target device accordingly. Create new partitions for the target device, adjust the partition size, format the partition to match the file system of the source device, etc. to ensure that the partitions of the target device are logically consistent with the partitions of the source device so that the data can be migrated correctly. Partition the inserted NVMe device and keep the partitions consistent with the migrated device.

[0152] Sixth, stop writing new compressed data to the first area of ​​the source device. This can be achieved by disabling related write operations or changing the configuration of the application. In addition, you can also start the migration process after ensuring that all ongoing write operations are completed to avoid data inconsistency. After the compressed data migration is completed, modify the disk management layer related pointers so that after the data compression process is restarted, new data can be written to the target device or data can be obtained from the target device.

[0153] Seventh, perform the migration of underlying data. The steps are similar to the migration of compressed data in step 6. It is necessary to stop writing new underlying data to the second area of ​​the source device. This can be achieved by disabling related write operations or changing the configuration of the application. You can also start the migration process after ensuring that all ongoing write operations are completed to avoid data inconsistency. Get the second pointer pointing to the second area of ​​the source device and point it to the second area of ​​the target device. At this time, you need to ensure that the update of the second pointer is accurate to avoid data access errors. After confirming that the data migration is successful and the second pointer has been updated, resume the operation of writing new underlying data to the second area of ​​the target device to ensure that the service is restored to normal.

[0154] Finally, a new log pointer pointing to the log area of ​​the target device is added to the system. This pointer will be used to indicate the storage location of the log data. The system configuration or related software settings are updated to ensure that the new log pointer is correctly identified and used. At this time, there is still unmigrated log data in the source device, so it is migrated to the log area of ​​the target device. Since the newly added log pointer ensures the storage of new log data, it can be determined that the migration work is completed at this time, and the metadata targeted by OSS is migrated to the new disk.

[0155] When the migration is complete, the old NVMe device can be unplugged and the device can be recycled. During the entire data migration process, a migration progress query command is provided to query the migration progress.

[0156] In other embodiments of the present invention, in order to meet more practical situations, when the server corresponding to the storage system does not have extra disk interfaces, the metadata of the OSS can be migrated to a general mechanical hard disk HDD through a migration request. Then, the old NVMe device is replaced, a new NVMe device is inserted, and the metadata is migrated from the HDD back to the new NVMe device.

[0157] The data migration method provided by the embodiment of the present invention obtains a data migration request, determines a source device corresponding to the data migration request, and determines a target device matching the source device in a distributed storage system. In response to the data migration request, the compressed data in the first area of ​​the source device is migrated to the first area of ​​the target device. During the compressed data migration process, the new compressed data is stopped from being stored in the first area of ​​the source device. A first pointer pointing to the first area of ​​the source device is obtained, and the first pointer is pointed to the first area of ​​the target device. Through the first pointer, the new compressed data is stored in the first area of ​​the target device. The underlying data of the second area of ​​the source device is migrated to the second area of ​​the target device. During the underlying data migration process, the new underlying data is stopped from being stored in the second area of ​​the source device. A second pointer pointing to the second area of ​​the source device is obtained, and the second pointer is pointed to the second area of ​​the target device. Through the second pointer, the new underlying data is stored in the second area of ​​the target device. The log data of the log area of ​​the source device is stored in the second area of ​​the target device to complete the data migration. The embodiment of the present invention realizes the gradual migration of the data content of the source device to the target device without affecting data writing, thereby reducing the impact on customer services.

[0158] Reference Figure 7 , shows a schematic diagram of the structure of a data migration device provided by an embodiment of the present invention, such as Figure 7 As shown, the device may include:

[0159] The request acquisition module 701 is used to acquire a data migration request, determine a source device corresponding to the data migration request, and determine a target device matching the source device in the distributed storage system.

[0160] The request response first module 702 is used to respond to the data migration request, migrate the compressed data in the first area of ​​the source device to the first area of ​​the target device, and stop storing new compressed data in the first area of ​​the source device during the compressed data migration process.

[0161] The first pointer modification module 703 is used to obtain a first pointer pointing to the first area in the source device, point the first pointer to the first area in the target device, and store new compressed data in the first area in the target device through the first pointer.

[0162] The request response second module 704 is used to migrate the underlying data in the second area of ​​the source device to the second area of ​​the target device, and during the migration of the underlying data, stop storing new underlying data in the second area of ​​the source device.

[0163] The second pointer modification module 705 is used to obtain a second pointer pointing to the second area in the source device, point the second pointer to the second area in the target device, and store new underlying data in the second area in the target device through the second pointer.

[0164] The log migration module 706 is used to store the log data in the log area of ​​the source device to the second area of ​​the target device to complete the data migration.

[0165] In an optional embodiment of the present invention, the device further comprises:

[0166] The information acquisition module is used to acquire the device partition information of the source device.

[0167] The device partitioning module is used to partition the target device according to the device partitioning information.

[0168] In an optional embodiment of the present invention, the request response first module 702 includes:

[0169] The data volume calculation module is used to obtain compressed data of each level in the first area and calculate a first total data volume of the compressed data, wherein the first area includes compressed data of several levels.

[0170] The migration rule acquisition module is used to obtain a preset migration threshold and a single migration rule, wherein the migration threshold is used to represent the maximum data volume of the compressed data for a single migration, and the single migration rule includes a single migration time interval and a single migration data volume.

[0171] The first migration module is used to migrate the compressed data to the first area in the target device according to the single migration rule when the total amount of the first data is greater than the first data migration threshold.

[0172] The second migration module is used to migrate the compressed data to the first area in the target device when the total amount of the first data is less than or equal to the first data migration threshold.

[0173] The first stopping module is used to stop the data compression process for the first area in the source device during the compressed data migration process, so as to stop storing new compressed data in the first area in the source device.

[0174] The first pointer modification module 703 further includes:

[0175] The first pointer modification submodule is used to modify the pointing position of the first pointer to the first area in the target device after determining that the compressed data in the first area in the source device is migrated to the first area in the target device.

[0176] In an optional embodiment of the present invention, the request response second module 704 further includes:

[0177] The second stopping module is used to stop the data flushing process for the second area in the source device during the migration of the underlying data, so as to stop storing new underlying data in the second area in the source device.

[0178] The second pointer modification module 705 also includes:

[0179] The second pointer modification submodule is used to modify the pointing position of the second pointer to the second area in the target device after the underlying data of the second area in the source device is migrated to the second area in the target device.

[0180] In an optional embodiment of the present invention, the device further comprises:

[0181] The pointer adding module is used to add a log pointer pointing to the log area of ​​the target device.

[0182] The log storage module is used to store new log data in the log area of ​​the target device through the log pointer.

[0183] In an optional embodiment of the present invention, the device further comprises:

[0184] A query instruction acquisition module is used to acquire migration query instructions;

[0185] a first migration calculation module, configured to, in response to the migration query instruction, obtain a first migration data volume corresponding to migrated data in the compressed data when the compressed data in the first area of ​​the source device is migrated to the first area of ​​the target device, and calculate a first migration progress according to the first migration data volume;

[0186] A second migration calculation module, configured to set a second migration progress to completion when the underlying data of the second area in the source device is migrated to the second area in the target device;

[0187] a third migration calculation module, which, when storing the log data in the log area in the source device to the second area of ​​the target device, obtains the remaining log data amount in the log area in the source device, and calculates a third migration progress according to the remaining log data amount;

[0188] A migration output module is used to output a migration progress, wherein the migration progress includes at least one of a first migration progress, a second migration progress and a third migration progress, wherein the first migration progress is used to represent the migration progress of the compressed data, the second migration progress is used to represent the migration progress of the underlying data, and the third migration progress is used to represent the migration progress of the log data.

[0189] In an optional embodiment of the present invention, the request response first module includes:

[0190] The first check submodule is used to check the compressed data according to a cyclic redundancy check algorithm and stop storing new compressed data in the first area of ​​the source device during the compressed data migration process.

[0191] The request response second module includes:

[0192] The second check submodule is used to check the underlying data according to the cyclic redundancy check algorithm and stop storing new underlying data in the second area of ​​the source device during the underlying data migration process.

[0193] The data migration method provided by the embodiment of the present invention obtains a data migration request, determines a source device corresponding to the data migration request, and determines a target device matching the source device in a distributed storage system. In response to the data migration request, the compressed data in the first area of ​​the source device is migrated to the first area of ​​the target device. During the compressed data migration process, the new compressed data is stopped from being stored in the first area of ​​the source device. A first pointer pointing to the first area of ​​the source device is obtained, and the first pointer is pointed to the first area of ​​the target device. Through the first pointer, the new compressed data is stored in the first area of ​​the target device. The underlying data of the second area of ​​the source device is migrated to the second area of ​​the target device. During the underlying data migration process, the new underlying data is stopped from being stored in the second area of ​​the source device. A second pointer pointing to the second area of ​​the source device is obtained, and the second pointer is pointed to the second area of ​​the target device. Through the second pointer, the new underlying data is stored in the second area of ​​the target device. The log data of the log area of ​​the source device is stored in the second area of ​​the target device to complete the data migration. The embodiment of the present invention realizes the gradual migration of the data content of the source device to the target device without affecting data writing, thereby reducing the impact on customer services.

[0194] An embodiment of the present invention further provides an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and the computer program implements the above data migration method when executed by the processor.

[0195] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above data migration method is implemented.

[0196] Some embodiments of the present invention further provide a computer program product, including a computer program, which implements the above data migration method when executed by a processor.

[0197] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0198] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0199] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0200] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0201] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0202] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0203] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0204] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0205] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.

[0206] The data migration method and device, electronic device, and storage medium provided are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for general technical personnel in this field, according to the idea of ​​the present invention, 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 invention.

Claims

1. A data migration method, It is characterized in that Applied to a distributed storage system, the storage area of ​​a device in the distributed storage system includes a log area, a first area, and a second area, the log area is used to store log data, the first area is used to store compressed data, and the second area is used to store underlying data, the method includes: Obtaining a data migration request, determining a source device corresponding to the data migration request, and determining a target device matching the source device in the distributed storage system; In response to the data migration request, migrate the compressed data in the first area of ​​the source device to the first area of ​​the target device, and during the compressed data migration, stop storing new compressed data in the first area of ​​the source device; Obtaining a first pointer pointing to a first area in the source device, pointing the first pointer to a first area in the target device, and storing new compressed data in the first area in the target device through the first pointer; Migrating the underlying data in the second area of ​​the source device to the second area of ​​the target device, and during the migration of the underlying data, stopping storing new underlying data in the second area of ​​the source device; Obtaining a second pointer pointing to the second area in the source device, pointing the second pointer to the second area in the target device, and storing new underlying data in the second area in the target device through the second pointer; The log data in the log area of ​​the source device is stored in the second area of ​​the target device to complete the data migration.

2. The method according to claim 1, It is characterized in that Before responding to the data migration request, the method includes: Obtaining device partition information of the source device; Partition the target device according to the device partition information.

3. The method according to claim 1, It is characterized in that The step of migrating the compressed data in the first area of ​​the source device to the first area of ​​the target device, and stopping storing new compressed data in the first area of ​​the source device during the compressed data migration process, includes: Obtaining compressed data of each level in the first region, and calculating a first total amount of the compressed data, wherein the first region includes compressed data of several levels; Obtaining a preset migration threshold and a single migration rule, wherein the migration threshold is used to indicate a maximum amount of data for a single migration of the compressed data, and the single migration rule includes a single migration time interval and a single migration data amount; When the first data total amount is greater than the first data migration threshold, migrating the compressed data to the first area in the target device according to the single migration rule; When the first data amount is less than or equal to the first data migration threshold, migrating the compressed data to a first area in the target device; During the compressed data migration process, stopping the data compression process for the first area in the source device to stop storing new compressed data in the first area in the source device; Pointing the first pointer to the first area in the target device includes: After determining that the compressed data in the first area in the source device is migrated to the first area in the target device, the pointing position of the first pointer is modified to the first area in the target device.

4. The method according to claim 1, It is characterized in that During the migration of the underlying data, stopping storing new underlying data in the second area of ​​the source device includes: During the migration of the underlying data, stopping the data flushing process for the second area in the source device to stop storing new underlying data in the second area in the source device; Pointing the second pointer to the second area in the target device includes: After the underlying data in the second area in the source device is migrated to the second area in the target device, the pointing position of the second pointer is modified to the second area in the target device.

5. The method according to claim 1, It is characterized in that Before storing the log data in the log area of ​​the source device to the second area of ​​the target device, the method includes: Adding a log pointer to the log area of ​​the target device; The new log data is stored in the log area of ​​the target device through the log pointer.

6. The method according to claim 1, It is characterized in that The method further comprises: Get the migration query instruction; In response to the migration query instruction, when the compressed data in the first area of ​​the source device is migrated to the first area of ​​the target device, a first migration data volume corresponding to the migrated data in the compressed data is obtained, and a first migration progress is calculated according to the first migration data volume; When the underlying data in the second area in the source device is migrated to the second area in the target device, the second migration progress is set to complete: When storing the log data in the log area of ​​the source device to the second area of ​​the target device, obtaining the remaining log data amount in the log area of ​​the source device, and calculating a third migration progress according to the remaining log data amount; Output migration progress, the migration progress including at least one of a first migration progress, a second migration progress and a third migration progress, wherein the first migration progress is used to represent the migration progress of the compressed data, the second migration progress is used to represent the migration progress of the underlying data, and the third migration progress is used to represent the migration progress of the log data.

7. The method according to claim 1, It is characterized in that The step of stopping storing new compressed data in the first area of ​​the source device during the compressed data migration process includes: During the compressed data migration process, the compressed data is verified according to a cyclic redundancy check algorithm and new compressed data is stopped from being stored in the first area of ​​the source device; During the migration of the underlying data, stopping storing new underlying data in the second area of ​​the source device includes: During the migration of the underlying data, the underlying data is verified according to a cyclic redundancy check algorithm and storage of new underlying data in the second area of ​​the source device is stopped.

8. A data migration device, It is characterized in that Applied to a distributed storage system, the storage area of ​​a device in the distributed storage system includes a log area, a first area, and a second area, the log area is used to store log data, the first area is used to store compressed data, and the second area is used to store underlying data, the device includes: a request acquisition module, configured to acquire a data migration request, determine a source device corresponding to the data migration request, and determine a target device matching the source device in the distributed storage system; a request response first module, configured to migrate the compressed data in the first area of ​​the source device to the first area of ​​the target device in response to the data migration request, and to stop storing new compressed data in the first area of ​​the source device during the compressed data migration process; A first pointer modification module, used for obtaining a first pointer pointing to the first area in the source device, pointing the first pointer to the first area in the target device, and storing new compressed data in the first area in the target device through the first pointer; The request response second module is used to migrate the underlying data in the second area of ​​the source device to the second area of ​​the target device, and during the migration of the underlying data, stop storing new underlying data in the second area of ​​the source device; A second pointer modification module is used to obtain a second pointer pointing to the second area in the source device, point the second pointer to the second area in the target device, and store new underlying data in the second area in the target device through the second pointer; The log migration module is used to store the log data in the log area of ​​the source device to the second area of ​​the target device to complete the data migration.

9. An electronic device, It is characterized in that The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the data migration method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data migration method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Data migration method and device, storage medium and electronic equipment

    CN120045126A