A data adjustment method, system, storage medium and device based on snapshots
By introducing an asynchronous processing process of background replication in ROW snapshot technology, the problem of slow read performance caused by source volume redirection is solved, and the balance between high write performance and read performance is achieved, avoiding data discreteness.
Patent Information
- Application Number
- CN202111237033.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-24
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-10-24
AI Technical Summary
In ROW snapshot technology, source volume modification leads to redirection dispersion, resulting in slow read performance problems.
By adding the asynchronous processing flow of background replication, the redirected source volume data is read and copied back to the source volume, and at the same time write the snapshot data back to the snapshot volume, adjust the pointer table pointing to ensure data order.
It not only retains the high write performance of ROW snapshots, but also solves the problem of slow read performance, avoiding discrete source volume data.
Smart Images

Figure CN114116303B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular, to a data adjustment method, system, storage medium and device based on snapshots. Background Art
[0002] Snapshots are mainly used for rapid data backup and recovery. A snapshot is a fully available copy of a specified data set, which includes the image of the corresponding data at a certain point in time (the time point when the copy starts). A snapshot can be a copy of the data it represents or a replica of the data. Currently, storage snapshot technologies can generally be divided into two categories: full snapshots and incremental snapshots. Incremental snapshot technologies mainly include COW (Copy-On-Write) and ROW (Redirect-On-Write). COW has a fast creation speed and small space occupation. The snapshot volume depends on the source volume data. When the source volume data is changed for the first time, it requires one read and two write operations, which affects the write performance of the source data volume. For ROW, the write operations after creating a snapshot on the source data volume will be redirected, and all write IOs (Input / Output) are redirected to the new volume, while all snapshot volume data (old data) remains in the read-only source data volume. Because the data pointed to by the source volume data pointer will be quickly redirected and scattered, another main disadvantage of ROW is that it reduces the read performance. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a data adjustment method, system, storage medium and device based on snapshots to solve the problem that the read performance is slow due to the redirection and scattering of ROW snapshots when the source volume is modified in the prior art.
[0004] Based on the above purpose, the present invention provides a data adjustment method based on snapshots, including the following steps:
[0005] Create a snapshot of the original data in the source volume to obtain snapshot data;
[0006] Copy the first pointer table of the original data to obtain the second pointer table of the snapshot data;
[0007] In response to some data in the original data being updated to new data, write the new data into the snapshot volume corresponding to the source volume, and change the pointers of some data in the first pointer table to the pointers of the new data;
[0008] Trigger a background copy task, and through the background copy task, copy the new data to the original position of the part of the data in the source volume, and copy the corresponding part of the snapshot data of the part of the data to the original position of the new data in the snapshot volume, and respectively change the pointers pointed to by the pointers of the new data in the first pointer table and the pointers pointed to by the pointers of the part of the snapshot data in the second pointer table.
[0009] In some embodiments, changing the pointers of the new data in the first pointer table and the pointers of some snapshot data in the second pointer table respectively includes:
[0010] Pointing the pointer of the new data in the first pointer table to its location in the source volume, and pointing the pointer of some snapshot data in the second pointer table to its location in the snapshot volume.
[0011] In some embodiments, changing the pointer of some data in the first pointer table to the pointer of the new data includes:
[0012] Changing the pointer of some data in the first pointer table to the pointer of the new data, where the pointer of the some data points to its location in the source volume, and the pointer of the new data points to its location in the snapshot volume.
[0013] In some embodiments, copying the first pointer table of the original data to obtain the second pointer table of the snapshot data includes:
[0014] Copying the first pointer table of the original data to obtain the second pointer table of the snapshot data, and in the second pointer table, the pointer of the snapshot data points to the location of the original data in the source volume.
[0015] In some embodiments, triggering a background copy task includes:
[0016] Triggering a background copy task that is asynchronous with the new data writing process.
[0017] In some embodiments, the method further includes:
[0018] In response to completing the creation of a snapshot of the original data in the source volume, applying for new storage space as the snapshot volume.
[0019] On the other hand, the present invention further provides a snapshot-based data adjustment system, including:
[0020] A snapshot creation module configured to create a snapshot of the original data in the source volume to obtain snapshot data;
[0021] A pointer table copying module configured to copy the first pointer table of the original data to obtain the second pointer table of the snapshot data;
[0022] A pointer changing module configured to, in response to some data in the original data being updated to new data, write the new data into the snapshot volume corresponding to the source volume, and change the pointer of some data in the first pointer table to the pointer of the new data; and
[0023] A data adjustment module, configured to trigger a background copy task, and through the background copy task, copy new data to the original location of the partial data in the source volume, and copy the partial snapshot data corresponding to the partial data to the original location of the new data in the snapshot volume, and respectively change the pointers of the new data in the first pointer table and the pointers of the partial snapshot data in the second pointer table.
[0024] In some embodiments, the data adjustment module includes a pointer pointing change module, configured to point the pointer of the new data in the first pointer table to the location where it is in the source volume, and point the pointer of the partial snapshot data in the second pointer table to the location where it is in the snapshot volume.
[0025] In some embodiments, the pointer change module includes a pointing change module, configured to change the pointer of the partial data in the first pointer table to the pointer of the new data, where the pointer of the partial data points to the location where it is in the source volume, and the pointer of the new data points to the location where it is in the snapshot volume.
[0026] In some embodiments, the pointer table copying module is further configured to copy the first pointer table of the original data to obtain the second pointer table of the snapshot data, and in the second pointer table, the pointer of the snapshot data points to the location where the original data is in the source volume.
[0027] In some embodiments, the data adjustment module includes a background copy task triggering module, configured to trigger a background copy task that is asynchronous with the new data writing process.
[0028] In some embodiments, the system further includes a storage space application module, configured to apply for a new storage space as a snapshot volume in response to creating a snapshot of the original data in the source volume.
[0029] In another aspect of the present invention, there is also provided a computer-readable storage medium storing computer program instructions, and when the computer program instructions are executed by a processor, the above method is implemented.
[0030] In still another aspect of the present invention, there is also provided a computer device, including a memory and a processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, the above method is executed.
[0031] The present invention has at least the following beneficial technical effects:
[0032] In view of the problem that the read performance of the ROW snapshot technology is slow due to the redirection and dispersion of the modified source volume, by adding an asynchronous processing process for background replication, the redirected source volume data and the corresponding snapshot data are read, the redirected source volume data is copied back to the source volume, and the snapshot data is written back to the snapshot volume. Thus, not only the advantage of high write performance of the ROW snapshot is retained, but also the problem of slow read performance caused by the redirection and dispersion of the ROW snapshot source volume is solved, and the data dispersion of the ROW snapshot source volume due to multiple writes is avoided. Brief Description of the Drawings
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other embodiments can be obtained based on these drawings.
[0034] Figure 1 Schematic diagram of a snapshot-based data adjustment method provided according to an embodiment of the present invention;
[0035] Figure 2 Schematic diagram of taking a ROW snapshot of the source volume S at time T provided according to an embodiment of the present invention;
[0036] Figure 3 Schematic diagram of writing new data after taking a ROW snapshot provided according to an embodiment of the present invention;
[0037] Figure 4 Schematic diagram of triggering a background asynchronous replication task after writing new data provided according to an embodiment of the present invention;
[0038] Figure 5 Schematic diagram of a snapshot-based data adjustment system provided according to an embodiment of the present invention;
[0039] Figure 6 Schematic diagram of a computer-readable storage medium for implementing a snapshot-based data adjustment method provided according to an embodiment of the present invention;
[0040] Figure 7 Schematic diagram of the hardware structure of a computer device for executing a snapshot-based data adjustment method provided according to an embodiment of the present invention. Detailed Embodiments
[0041] To make the objectives, technical solutions, and advantages of the present invention clearer, the following further elaborates on the embodiments of the present invention in detail with reference to specific embodiments and the accompanying drawings.
[0042] It should be noted that in the embodiments of the present invention, all expressions using "first" and "second" are for distinguishing two non-identical entities or non-identical parameters with the same name. It can be seen that "first" and "second" are only for the convenience of expression and should not be construed as a limitation on the embodiments of the present invention. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units inherently includes other steps or units.
[0043] Based on the above purpose, in the first aspect of the embodiments of the present invention, an embodiment of a data adjustment method based on snapshots is proposed. Figure 1 Shown is a schematic diagram of an embodiment of the data adjustment method based on snapshots provided by the present invention. As Figure 1 shown, the embodiments of the present invention include the following steps:
[0044] Step S10: Create a snapshot of the original data in the source volume to obtain snapshot data;
[0045] Step S20: Copy the first pointer table of the original data to obtain the second pointer table of the snapshot data;
[0046] Step S30: In response to some data in the original data being updated to new data, write the new data into the snapshot volume corresponding to the source volume, and change the pointers of some data in the first pointer table to the pointers of the new data;
[0047] Step S40: Trigger a background copy task, and through the background copy task, copy the new data to the original position of the part of the data in the source volume, and copy the part of the snapshot data corresponding to the part of the data to the original position of the new data in the snapshot volume, and respectively change the pointers of the new data in the first pointer table and the pointers of the part of the snapshot data in the second pointer table.
[0048] In the embodiments of the present invention, aiming at the problem that the ROW snapshot technology has slow read performance due to the redirection and dispersion caused by the modification of the source volume, by adding an asynchronous processing process for background copying, reading the redirected source volume data and the corresponding snapshot data, copying the modified and redirected source volume data back to the source volume, and writing the snapshot data back to the snapshot volume, thus not only retaining the advantage of high write performance of the ROW snapshot, but also solving the problem of slow read performance caused by the redirection and dispersion of the ROW snapshot source volume, and avoiding the data dispersion of the ROW snapshot source volume due to multiple writes.
[0049] ROW (Redirect-On-Write), also known as write-time redirection. The implementation principle of ROW is very similar to that of COW (Copy-On-Write, that is, copy-on-write snapshot technology). The difference is that for the first write operation on the original data volume, ROW redirects the new data to the reserved snapshot volume, rather than COW, which generally overwrites the original data with the new data. Therefore, the original data in the ROW snapshot still remains in the source data volume, and in order to ensure the integrity of the snapshot data, when creating the snapshot, the state of the source data volume will change from read-write to read-only. The biggest difference between ROW and COW is that the snapshot volume of COW stores the original data, while the snapshot volume of ROW stores the new data.
[0050] In some embodiments, copying the first pointer table of the original data to obtain the second pointer table of the snapshot data includes: copying the first pointer table of the original data to obtain the second pointer table of the snapshot data, and in the second pointer table, the pointer of the snapshot data points to the position where the original data is located in the source volume.
[0051] In this embodiment, after taking a snapshot of the original data in the source volume, the snapshot data still points to the position of the original data in the source volume, rather than in the snapshot volume.
[0052] In some embodiments, changing the pointers of some data in the first pointer table to the pointers of the new data includes: changing the pointers of some data in the first pointer table to the pointers of the new data, where the pointers of some data point to the position where they are located in the source volume, and the pointers of the new data point to the position where they are located in the snapshot volume.
[0053] In this embodiment, when some data in the original data is updated, the new data will be written into the snapshot volume. Therefore, the pointer pointing of some data also changes from originally pointing to the position in the source volume to pointing to the position in the snapshot volume. Writing the new data into the snapshot volume is beneficial to the write performance of the snapshot.
[0054] In some embodiments, changing the pointers of the new data in the first pointer table and the pointers of some snapshot data in the second pointer table respectively includes: changing the pointer of the new data in the first pointer table to point to the position where it is located in the source volume, and changing the pointers of some snapshot data in the second pointer table to point to the position where they are located in the snapshot volume.
[0055] In some embodiments, triggering a background copy task includes: triggering a background copy task that is asynchronous with the new data writing process.
[0056] In the above embodiment, by setting an asynchronous background copy task to copy the new data back to its original location in the source volume, the order of the data can be guaranteed when reading the data in the source volume, and the read data will not be chaotic. Since the operation is performed asynchronously, it does not affect the writing of new data into the snapshot volume, so it does not affect the write performance of the source volume, and improves the read performance of the source volume.
[0057] In some embodiments, the method further includes: in response to completing the creation of the snapshot of the original data in the source volume, applying for new storage space as the snapshot volume.
[0058] In this embodiment, the snapshot volume can be used as a buffer for adjusting the data position.
[0059] Figure 2 A schematic diagram showing a ROW snapshot of a source volume S at time T is shown; Figure 3 A schematic diagram showing writing new data after a ROW snapshot; Figure 4 FIG. 4 shows a schematic diagram of triggering a background asynchronous replication task after new data is written. Figure 2 , Figure 3 and Figure 4 As shown, an exemplary embodiment of the snapshot-based data adjustment method of the present invention is as follows:
[0060] like Figure 2 As shown, when creating a snapshot, the source volume data pointer table (ie, the first pointer table) is copied as the snapshot data pointer table (ie, the second pointer table) of the snapshot volume, the snapshot data also points to the four original data, and storage space is allocated as the snapshot volume.
[0061] like Figure 3 As shown, after the snapshot is created, when new data is written to the source volume (that is, part of the original data is updated to new data), the new data is directly written to the snapshot volume according to the ROW rule, and the pointer of the source volume data is modified to point to the new data, while the pointer of the snapshot data remains unchanged.
[0062] like Figure 4 As shown, when new data is written to the source volume, an asynchronous background copy task (i.e., background replication task) is automatically triggered to copy the redirected source volume data A' (i.e., new data) back to the source volume, and copy the snapshot volume data A back to the snapshot volume. At the same time, the source volume data pointer table and the snapshot data pointer table are modified to point to the new source volume data and snapshot data.
[0063] Since the background copy task is asynchronous and is automatically triggered when new data is written to the source volume after the ROW snapshot, it does not affect the write performance of the source volume, and there will be no missed data that is not copied. The redirected source volume data is moved back to the source volume through the background copy, ensuring that the source volume data will not be discrete, thereby solving the problem of low sequential read performance.
[0064] In the second aspect of the embodiments of the present invention, a snapshot-based data adjustment system is further provided. Figure 5 The following is a schematic diagram of an embodiment of the snapshot-based data adjustment system provided by the present invention. As Figure 5 shown, a snapshot-based data adjustment system includes: a snapshot creation module 10 configured to create a snapshot of the original data in the source volume to obtain snapshot data; a pointer table copying module 20 configured to copy the first pointer table of the original data to obtain the second pointer table of the snapshot data; a pointer change module 30 configured to, in response to some data in the original data being updated to new data, write the new data into the snapshot volume corresponding to the source volume, and change the pointers of some data in the first pointer table to the pointers of the new data; and a data adjustment module 40 configured to trigger a background copying task, and copy the new data to the original position of the some data in the source volume through the background copying task, and copy the corresponding partial snapshot data of the some data to the original position of the new data in the snapshot volume, and change the pointers of the new data in the first pointer table and the pointers of the partial snapshot data in the second pointer table respectively.
[0065] In some embodiments, the data adjustment module 40 includes a pointer pointing change module configured to point the pointer of the new data in the first pointer table to its position in the source volume, and point the pointer of the partial snapshot data in the second pointer table to its position in the snapshot volume.
[0066] In some embodiments, the pointer change module 30 includes a pointing change module configured to change the pointer of some data in the first pointer table to the pointer of the new data, wherein the pointer of the some data points to its position in the source volume, and the pointer of the new data points to its position in the snapshot volume.
[0067] In some embodiments, the pointer table copying module 20 is further configured to copy the first pointer table of the original data to obtain the second pointer table of the snapshot data, and in the second pointer table, the pointer of the snapshot data points to the position of the original data in the source volume.
[0068] In some embodiments, the data adjustment module 40 includes a background copying task triggering module configured to trigger a background copying task that is asynchronous with the process of writing new data.
[0069] In some embodiments, the system further includes a storage space application module configured to apply for new storage space as a snapshot volume in response to completing the creation of a snapshot of the original data in the source volume.
[0070] In the data adjustment system based on snapshots according to the embodiments of the present invention, in view of the problem that the read performance is slow due to the redirection and dispersion of the ROW snapshot technology when the source volume is modified, by adding an asynchronous processing process for background replication, the redirected source volume data and the corresponding snapshot data are read, the modified redirected source volume data is copied back to the source volume, and the snapshot data is written back to the snapshot volume, thereby not only retaining the advantage of high write performance of the ROW snapshot, but also solving the problem of slow read performance caused by the redirection and dispersion of the ROW snapshot source volume, and avoiding the data dispersion of the ROW snapshot source volume due to multiple writes.
[0071] In a third aspect of the embodiments of the present invention, a computer-readable storage medium is further provided. Figure 6 The schematic diagram of the computer-readable storage medium for implementing the data adjustment method based on snapshots according to the embodiments of the present invention is shown. As Figure 6 shown, the computer-readable storage medium 3 stores computer program instructions 31. When the computer program instructions 31 are executed by a processor, the following steps are implemented:
[0072] Create a snapshot of the original data in the source volume to obtain snapshot data;
[0073] Copy the first pointer table of the original data to obtain the second pointer table of the snapshot data;
[0074] In response to some data in the original data being updated to new data, write the new data into the snapshot volume corresponding to the source volume, and change the pointers of some data in the first pointer table to the pointers of the new data;
[0075] Trigger a background replication task, and through the background replication task, copy the new data to the original position of the part of the data in the source volume, and copy the corresponding part of the snapshot data of the part of the data to the original position of the new data in the snapshot volume, and change the pointers of the new data in the first pointer table and the pointers of the part of the snapshot data in the second pointer table respectively.
[0076] In some embodiments, changing the pointers of the new data in the first pointer table and the pointers of the part of the snapshot data in the second pointer table respectively includes: changing the pointer of the new data in the first pointer table to the position where it is located in the source volume, and changing the pointer of the part of the snapshot data in the second pointer table to the position where it is located in the snapshot volume.
[0077] In some embodiments, changing the pointers of some data in the first pointer table to the pointers of the new data includes: changing the pointers of some data in the first pointer table to the pointers of the new data, where the pointers of the part of the data point to the position where it is located in the source volume, and the pointers of the new data point to the position where it is located in the snapshot volume.
[0078] In some embodiments, copying the first pointer table of the original data to obtain the second pointer table of the snapshot data includes: copying the first pointer table of the original data to obtain the second pointer table of the snapshot data, and in the second pointer table, the pointer of the snapshot data points to the position where the original data is located in the source volume.
[0079] In some embodiments, triggering a background copy task includes: triggering a background copy task that is asynchronous with the new data writing process.
[0080] In some embodiments, the step further includes: in response to completing the creation of a snapshot of the original data in the source volume, applying for a new storage space as the snapshot volume.
[0081] It should be understood that, without conflict, all the embodiments, features, and advantages described above for the snapshot-based data adjustment method according to the present invention equally apply to the snapshot-based data adjustment system and storage medium according to the present invention.
[0082] In a fourth aspect of the embodiments of the present invention, there is also provided a computer device, including a memory 402 and a processor 401 as shown in Figure 7 The memory 402 stores a computer program, and when the computer program is executed by the processor 401, the method of any one of the above embodiments is implemented.
[0083] As shown in Figure 7 is a schematic hardware structure diagram of an embodiment of a computer device for performing the snapshot-based data adjustment method provided by the present invention. Taking the computer device shown in Figure 7 as an example, in this computer device, there is a processor 401 and a memory 402, and may further include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403, and the output device 404 can be connected through a bus or other means. Figure 7 Taking the connection through the bus as an example. The input device 403 can receive input digital or character information, and generate key signal inputs related to user settings and function controls of the snapshot-based data adjustment system. The output device 404 may include a display device such as a display screen.
[0084] The memory 402, being a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the snapshot-based data adjustment method in the embodiments of the present application. The memory 402 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created for the use of the snapshot-based data adjustment method, etc. In addition, the memory 402 can include high-speed random access memory and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 402 optionally includes memories remotely located relative to the processor 401, and these remote memories can be connected to the local module through a network. Examples of the above network include but are not limited to the Internet, intranet, local area network, mobile communication network, and combinations thereof.
[0085] By running the non-volatile software programs, instructions, and modules stored in the memory 402, the processor 401 executes various functional applications and data processing of the server, that is, implements the snapshot-based data adjustment method in the above method embodiments.
[0086] Finally, it should be noted that the computer-readable storage medium herein (e.g., memory) can be volatile memory or non-volatile memory, or can include both volatile memory and non-volatile memory. By way of example and not limitation, non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), and this RAM can serve as an external cache memory. By way of example and not limitation, RAM can be obtained in various forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include but are not limited to these and other suitable types of memory.
[0087] Those skilled in the art will also understand that the various exemplary logical blocks, modules, circuits, and algorithmic steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. The functionality that can be implemented in various ways for each particular application by those skilled in the art, but such implementation decisions should not be construed as causing a departure from the scope of the disclosure of the embodiments of the present invention.
[0088] The various exemplary logical blocks, modules, and circuits described in connection with the disclosure herein can be implemented or performed using the following components designed to perform the functions herein: a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP and / or any other such configuration.
[0089] The above are exemplary embodiments of the disclosure of the present invention, but it should be noted that various changes and modifications can be made without departing from the scope of the disclosure of the embodiments of the present invention as defined by the claims. The functions, steps, and / or actions of the method claims according to the disclosed embodiments herein need not be performed in any particular order. In addition, although the elements of the disclosure of the embodiments of the present invention may be described or claimed in individual form, they may also be understood as plural unless explicitly limited to the singular.
[0090] It should be understood that, as used herein, unless the context clearly supports the contrary, the singular form "a" is intended to also include the plural form. It should also be understood that the "and / or" used herein refers to any and all possible combinations of one or more of the associated listed items. The serial numbers of the disclosed embodiments of the present invention above are merely for description and do not represent the superiority or inferiority of the embodiments.
[0091] Those of ordinary skill in the art should understand that any discussion of the above embodiments is merely exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other variations in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present invention shall be included within the protection scope of the embodiments of the present invention.
Claims
1. A data adjustment method based on snapshots, characterized in that Including the following steps: Create a snapshot of the original data in the source volume to obtain snapshot data; Copy the first pointer table of the original data to obtain the second pointer table of the snapshot data; In response to part of the original data being updated to new data, write the new data into the snapshot volume corresponding to the source volume, and change the pointer of the part of the data in the first pointer table to the pointer of the new data; Trigger a background copy task, and through the background copy task, copy the new data to the original position of the part of the data in the source volume, and copy the part of the snapshot data corresponding to the part of the data to the original position of the new data in the snapshot volume, and respectively change the pointing of the pointer of the new data in the first pointer table and the pointing of the pointer of the part of the snapshot data in the second pointer table; Among them, changing the pointing of the pointer of the new data in the first pointer table and the pointing of the pointer of the part of the snapshot data in the second pointer table respectively includes: changing the pointer of the new data in the first pointer table to the position where it is located in the source volume, and changing the pointer of the part of the snapshot data in the second pointer table to the position where it is located in the snapshot volume.
2. The method according to claim 1, wherein Changing the pointer of the part of the data in the first pointer table to the pointer of the new data includes: Changing the pointer of the part of the data in the first pointer table to the pointer of the new data, where the pointer of the part of the data points to the position where it is located in the source volume, and the pointer of the new data points to the position where it is located in the snapshot volume.
3. The method according to claim 1, wherein Copying the first pointer table of the original data to obtain the second pointer table of the snapshot data includes: Copying the first pointer table of the original data to obtain the second pointer table of the snapshot data, and in the second pointer table, the pointer of the snapshot data points to the position where the original data is located in the source volume.
4. The method according to claim 1, characterized in that, Triggering a background copy task includes: Triggering a background copy task that is asynchronous with the process of writing new data.
5. The method according to claim 1, wherein It also includes: In response to completing the creation of a snapshot of the original data in the source volume, apply for new storage space as a snapshot volume.
6. A snapshot-based data adjustment system, characterized in that Including: A snapshot creation module configured to create a snapshot of the original data in the source volume to obtain snapshot data; A pointer table copying module configured to copy the first pointer table of the original data to obtain the second pointer table of the snapshot data; A pointer changing module configured to, in response to part of the original data being updated to new data, write the new data into the snapshot volume corresponding to the source volume, and change the pointer of the part of the data in the first pointer table to the pointer of the new data; And The data adjustment module is configured to trigger a background copy task, and copy the new data to the original position of the partial data in the source volume through the background copy task, and copy the partial snapshot data corresponding to the partial data to the original position of the new data in the snapshot volume, and change the pointers of the new data in the first pointer table and the pointers of the partial snapshot data in the second pointer table respectively; Among them, changing the pointers of the new data in the first pointer table and the pointers of the partial snapshot data in the second pointer table respectively includes: pointing the pointer of the new data in the first pointer table to its position in the source volume, and pointing the pointer of the partial snapshot data in the second pointer table to its position in the snapshot volume.
7. The system according to claim 6, wherein The data adjustment module includes a pointer pointing change module configured to point the pointer of the new data in the first pointer table to its position in the source volume, and point the pointer of the partial snapshot data in the second pointer table to its position in the snapshot volume.
8. A computer-readable storage medium, characterized in that, Stores computer program instructions that, when executed by a processor, implement the method according to any one of claims 1-5.
9. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program that, when executed by the processor, executes the method according to any one of claims 1-5.
Citation Information
Patent Citations
Method and system for improving backup efficiency based on multiple snapshots in COW mode
CN111338850A
ROW snapshot implementation method for distributed storage system and related components
CN111722800A