CN105095016A - Disk snapshot roll-back method and device - Google Patents

Disk snapshot roll-back method and device Download PDF

Info

Publication number
CN105095016A
CN105095016A CN201410207333.1A CN201410207333A CN105095016A CN 105095016 A CN105095016 A CN 105095016A CN 201410207333 A CN201410207333 A CN 201410207333A CN 105095016 A CN105095016 A CN 105095016A
Authority
CN
China
Prior art keywords
snapshot
secondary table
rollback
data block
disk
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410207333.1A
Other languages
Chinese (zh)
Other versions
CN105095016B (en
Inventor
杨耀敏
董世宁
马龙飞
杨效振
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yun Chao Artery Science And Technology Ltd
Original Assignee
Beijing Yun Chao Artery Science And Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yun Chao Artery Science And Technology Ltd filed Critical Beijing Yun Chao Artery Science And Technology Ltd
Priority to CN201410207333.1A priority Critical patent/CN105095016B/en
Publication of CN105095016A publication Critical patent/CN105095016A/en
Application granted granted Critical
Publication of CN105095016B publication Critical patent/CN105095016B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a disk snapshot roll-back method and device. The method comprises the following steps of establishing a global snapshot number as a global variable, valuing the global snapshot number according to the snapshot establishment frequency, establishing a local number for each data block managed by the current secondary table, and valuing the local number according to the value of the global snapshot number; receiving a snapshot establishment command, and copying the current primary table and the current secondary table as a snapshot primary table and a snapshot secondary table according to the snapshot establishment command, wherein the local number of each data block managed by the snapshot secondary table is used for representing an edition of the snapshot secondary table; and receiving a snapshot roll-back command carrying a roll-back snapshot edition number, and searching the corresponding snapshot primary table and snapshot secondary table according to the roll-back snapshot edition number in order to point the current snapshot primary table to the snapshot secondary table corresponding to the roll-back snapshot edition number. The method and the device do not need to search the snapshot primary table during roll-back and subtract one from a reference count of each data block managed by the snapshot secondary table, so that the elapsed time is greatly reduced.

Description

A kind of disk snapshot rollback method and device
Technical field
The present invention relates to technical field of data backup, particularly relate to a kind of disk snapshot rollback method and device.
Background technology
Snapshot is a kind of data copy technology based on time point, is a key concept in data backup field.The object setting up snapshot is to preserve disk data message at a time, if state when recovering disk data can be set up to snapshot by snapshot by disk failures in the future.
In prior art, the method for building up of snapshot comprises two kinds, and one is physical copy, and one is logical copy.Physical copy refers to and copies completely the raw data in disk, takies the storage space equal with raw data, and required storage space is excessive.Logical copy refers to and only copies for the data occurring to change, and carries out logical copy in prior art by Copy on write (CopyOnWrite is called for short COW) technology.Concrete grammar is as follows:
COW technology adopts the storage administration mechanism of two-stage table (one-level table L1 and secondary table L2), and wherein one-level table L1 comprises multiple list item, and the address information of each list item record secondary table L2, can find secondary table L2 by one-level table L1; Secondary table L2 comprises multiple list item, and the address mapping relation of each list item record data block, this address mapping relation is the mapping relations of metadata and physical address in this data block.
When snapshot is set up, what copy whole disk works as previous stage table L1 and current secondary table L2 as snapshot one-level table L1 and snapshot secondary table L2, traversal snapshot one-level table L1 and all snapshot secondary table L2, receive the reference count of all data blocks pointed by snapshot secondary table L2, when wherein reference count is greater than 1, represent that the number of times of Copy on write has occurred this data block.When there is data write operation, first judge whether the reference count of the data block corresponding to this write operation is greater than 1.If be greater than 1, in the address information write snapshot one-level table L1 of the secondary table L2 of the address mapping relation before this data block of storage is rewritten, the address information of the secondary table L2 storing the revised address mapping relation of this data block is write in the source one-level table L1 of this disk.
When snapshot rollback, first find the snapshot one-level table L1 that rollback version is corresponding, find corresponding snapshot secondary table L2 by snapshot one-level table.Replaced as previous stage table L1 and current secondary table L2 by snapshot one-level table L1 and snapshot secondary table L2, and the reference count of the data block managed by snapshot secondary table L2 is carried out subtracting 1 operation.
Because existing snapshot rollback technology carries out rollback by snapshot one-level table L1, and need during rollback to subtract 1 operation to the reference count of the data block that snapshot secondary table L2 manages, consuming time very long.
Summary of the invention
The object of the present invention is to provide a kind of disk snapshot rollback method and device, thus solve the foregoing problems existed in prior art.
To achieve these goals, the technical solution used in the present invention is as follows:
A kind of disk snapshot rollback method, comprising:
Set up overall snapshot number as global variable, the number of times that described overall snapshot number is set up according to snapshot carries out value, sets up local number to each data block that current secondary table manages, and described local number carries out value according to the value of described overall snapshot number;
Receive snapshot and set up order, set up order copy according to described snapshot described when previous stage table and described current secondary table are as snapshot one-level table and snapshot secondary table, the local number of each data block of described snapshot secondary table management is for characterizing the version of described snapshot secondary table;
Receive snapshot rollback order, rollback snapshot version number is carried in described snapshot rollback order, search corresponding described snapshot one-level table and described snapshot secondary table according to described rollback snapshot version number, make described previous stage table of working as point to described snapshot secondary table corresponding to described rollback snapshot version number.
Preferably, described reception snapshot rollback order, rollback snapshot version number is carried in described snapshot rollback order, corresponding described snapshot one-level table and described snapshot secondary table is searched according to described rollback snapshot version number, make described after previous stage table points to described snapshot secondary table corresponding to described rollback snapshot version number, also comprise:
Obtain at rear snapshot one-level table with in rear snapshot secondary table, described at rear snapshot one-level table with refer in rear snapshot secondary table and be later than described snapshot one-level table after described snapshot secondary table corresponding to described rollback snapshot version number and described snapshot secondary table Time Created;
Delete described at rear snapshot one-level table and described in rear snapshot secondary table.
Preferably, the described local number in rear snapshot secondary table is greater than the local number of described snapshot secondary table corresponding to described rollback snapshot version number.
Preferably, at rear snapshot one-level table and described in rear snapshot secondary table described in described deletion, comprising:
The entry of described each correspondence in described snapshot secondary table corresponding to rear snapshot secondary table and described rollback snapshot version number of contrast;
If there is different entries, then delete described data block in rear snapshot secondary table corresponding to this entry;
Until described after after all entries contrasts in snapshot secondary table, in rear snapshot secondary table described in release;
Until all described after the release of snapshot secondary table complete after, release is described at rear stage table.
The invention has the beneficial effects as follows: by setting up overall snapshot number and setting up local number to storage object data block, record the version of snapshot.When snapshot rollback, find corresponding snapshot one-level table and snapshot secondary table by rollback snapshot version number, make again to point to snapshot secondary table corresponding to rollback snapshot version number when previous stage table.Without the need to carrying out rollback by snapshot one-level table, and do without the need to the reference count of the data block managed snapshot secondary table during rollback and subtract 1 operation, consuming timely to greatly reduce.
A kind of disk snapshot rollback device, comprising:
Variable sets up module, for setting up overall snapshot number as global variable, the number of times that described overall snapshot number is set up according to snapshot carries out value, sets up local number to each data block that current secondary table manages, and described local number carries out value according to the value of described overall snapshot number;
Snapshot sets up module, order is set up for receiving snapshot, set up order copy according to described snapshot described when previous stage table and described current secondary table are as snapshot one-level table and snapshot secondary table, the local number of each data block of described snapshot secondary table management is for characterizing the version of described snapshot secondary table;
Snapshot roll-back module, for receiving snapshot rollback order, rollback snapshot version number is carried in described snapshot rollback order, search corresponding described snapshot one-level table and described snapshot secondary table according to described rollback snapshot version number, make described previous stage table of working as point to described snapshot secondary table corresponding to described rollback snapshot version number.
Preferably, described device also comprises:
Snapshot searches module, for obtaining at rear snapshot one-level table with in rear snapshot secondary table, described at rear snapshot one-level table with refer in rear snapshot secondary table and be later than described snapshot one-level table after described snapshot secondary table corresponding to described rollback snapshot version number and described snapshot secondary table Time Created;
Snapshot removing module, described at rear snapshot one-level table and described in rear snapshot secondary table for deleting.
Preferably, the described local number in rear snapshot secondary table is greater than the local number of described snapshot secondary table corresponding to described rollback snapshot version number.
Preferably, described snapshot removing module comprises:
Entry contrast unit, for contrasting the entry of described each correspondence in described snapshot secondary table corresponding to rear snapshot secondary table and described rollback snapshot version number;
Entry delete cells, if for there is different entries, then deletes described data block in rear snapshot secondary table corresponding to this entry;
First releasing unit, for until described after after all entries contrasts in snapshot secondary table, in rear snapshot secondary table described in release;
Second releasing unit, for until all described after the release of snapshot secondary table complete after, release is described at rear stage table.
The invention has the beneficial effects as follows: by setting up overall snapshot number and setting up local number to storage object data block, record the version of snapshot.When snapshot rollback, find corresponding snapshot one-level table and snapshot secondary table by rollback snapshot version number, make again to point to snapshot secondary table corresponding to rollback snapshot version number when previous stage table.Without the need to carrying out rollback by snapshot one-level table, and do without the need to the reference count of the data block managed snapshot secondary table during rollback and subtract 1 operation, consuming timely to greatly reduce.
Accompanying drawing explanation
Fig. 1 is inventive disk snapshot rollback method first embodiment process flow diagram;
Fig. 2 is inventive disk snapshot rollback method second embodiment process flow diagram;
Fig. 3 is inventive disk snapshot rollback method the 3rd embodiment process flow diagram;
Fig. 4 is inventive disk snapshot rollback device first example structure figure.
embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with accompanying drawing, the present invention is further elaborated.Should be appreciated that embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Fig. 1 is inventive disk snapshot rollback method first embodiment process flow diagram, and as shown in Figure 1, the disk snapshot rollback method that the embodiment of the present invention provides is performed by disk snapshot rollback device, and disk snapshot rollback device can be realized by software/hardware.Wherein when disk snapshot rollback device adopts software simulating, can be integrated in virtual machine.The method comprises:
Step S100, set up overall snapshot number as global variable, the number of times that described overall snapshot number is set up according to snapshot carries out value, sets up local number to each data block that current secondary table manages, and described local number carries out value according to the value of described overall snapshot number.
Step S102, receive snapshot and set up order, set up order copy according to described snapshot described when previous stage table and described current secondary table are as snapshot one-level table and snapshot secondary table, the local number of each data block of described snapshot secondary table management is for characterizing the version of described snapshot secondary table.
Particularly, the snapshot rollback method in the present embodiment builds on the basis of following snapshot establishing techniques, and concrete snapshot establishing techniques comprises:
Set up overall snapshot number as global variable, initial value is 1.When first time snapshot set up by disk, overall snapshot value is 1; When second time snapshot set up by disk, overall snapshot value is 2, by that analogy.Set up local number to the data block that each current secondary table manages, initial value is 0.When first time snapshot set up by disk, overall snapshot value is 1, and the local number of the data block that current secondary table manages is 1; When second time snapshot set up by disk, overall snapshot value is 2, and the local number of the data block that current secondary table manages is 2.Simultaneously, when setting up snapshot, copy is when previous stage table and all current secondary table are as snapshot one-level table and snapshot secondary table, and wherein the local number of data block that manages of snapshot secondary table is identical with the local number of the data block that current secondary table when setting up snapshot manages.Namely, when first time snapshot set up by disk, the local number of the data block that first snapshot secondary table manages is 1; When second time snapshot set up by disk, the local number of the data block that first snapshot secondary table manages is still the local number of 1, second data block that snapshot secondary table manages is 2.
Receive write operation order, obtain the address of carrying data block to be operated in write operation order.From working as the local number searching this data block to be operated previous stage table and current secondary table.
When carrying out write operation owing to presetting for metadata in disk, preserve this metadata in former data block, then copy this metadata to another target data block, and the memory address of this metadata is changed into this target data block of sensing.After setting up snapshot, if there is write operation, due in the disk read-write mechanism that presets, directly preserving in original data block metadata, therefore can directly rewriting this metadata, without the need to carrying out Copy on write.If namely suppose originally have data in a certain data block, after setting up snapshot to this data block, the local number of this data block in current secondary table should equal overall snapshot number.Now to carry out write operation to this data block, according to the disk read-write mechanism preset, after write operation is carried out to this data block, automatically the data content in this data block can be preserved, and amended data content is copied in new data block, therefore can directly perform write operation and without the need to carrying out Copy on write.
In disk use procedure, the data in disk can constantly change, and namely constantly can perform write operation order to data in magnetic disk block.If now receive snapshot to set up order, then overall snapshot number can add 1, and the local number of the data block that current secondary table manages remains the value before snapshot is set up.Now the local number of data block that manages of current secondary table and overall snapshot number can be unequal.Therefore now need to carry out Copy on write.
Step S104, receive snapshot rollback order, rollback snapshot version number is carried in described snapshot rollback order, search corresponding described snapshot one-level table and described snapshot secondary table according to described rollback snapshot version number, make described previous stage table of working as point to described snapshot secondary table corresponding to described rollback snapshot version number.
By adopting technique scheme disclosed by the invention, obtain effect useful as follows: by setting up overall snapshot number and setting up local number to storage object data block, record the version of snapshot.When snapshot rollback, find corresponding snapshot one-level table and snapshot secondary table by rollback snapshot version number, make again to point to snapshot secondary table corresponding to rollback snapshot version number when previous stage table.Without the need to carrying out rollback by snapshot one-level table, and do without the need to the reference count of the data block managed snapshot secondary table during rollback and subtract 1 operation, consuming timely to greatly reduce.
Fig. 2 is inventive disk snapshot rollback method first embodiment process flow diagram, and as shown in Figure 2, the disk snapshot rollback method that the embodiment of the present invention provides is performed by disk snapshot rollback device, and disk snapshot rollback device can be realized by software/hardware.Wherein when disk snapshot rollback device adopts software simulating, can be integrated in virtual machine.The method comprises:
Step S200, set up overall snapshot number as global variable, the number of times that described overall snapshot number is set up according to snapshot carries out value, sets up local number to each data block that current secondary table manages, and described local number carries out value according to the value of described overall snapshot number.
Step S202, receive snapshot and set up order, set up order copy according to described snapshot described when previous stage table and described current secondary table are as snapshot one-level table and snapshot secondary table, the local number of each data block of described snapshot secondary table management is for characterizing the version of described snapshot secondary table.
Step S204, receive snapshot rollback order, rollback snapshot version number is carried in described snapshot rollback order, search corresponding described snapshot one-level table and described snapshot secondary table according to described rollback snapshot version number, make described previous stage table of working as point to described snapshot secondary table corresponding to described rollback snapshot version number.
Step S206, obtain at rear snapshot one-level table with in rear snapshot secondary table, described at rear snapshot one-level table with refer in rear snapshot secondary table and be later than described snapshot one-level table after described snapshot secondary table corresponding to described rollback snapshot version number and described snapshot secondary table Time Created;
Particularly, the local number of described snapshot secondary table corresponding to described rollback snapshot version number is greater than at the local number of rear snapshot secondary table.
Step S208, deletes described at rear snapshot one-level table and described in rear snapshot secondary table.
Particularly, the entry of each correspondence in snapshot secondary table corresponding to rear snapshot secondary table and rollback snapshot version number is contrasted; If there is different entries, then delete the data block corresponding to this entry in rear snapshot secondary table; Until after after all entries have contrasted in snapshot secondary table, be released in rear snapshot secondary table; Until all after snapshot secondary table release complete after, be released in rear stage table.
By adopting technique scheme disclosed by the invention, obtain effect useful as follows: by setting up overall snapshot number and setting up local number to storage object data block, record the version of snapshot.When snapshot rollback, find corresponding snapshot one-level table and snapshot secondary table by rollback snapshot version number, make again to point to snapshot secondary table corresponding to rollback snapshot version number when previous stage table.Without the need to carrying out rollback by snapshot one-level table, and do without the need to the reference count of the data block managed snapshot secondary table during rollback and subtract 1 operation, consuming timely to greatly reduce.
Fig. 3 is inventive disk snapshot rollback device first example structure figure, and as shown in Figure 3, the disk snapshot rollback device that the embodiment of the present invention provides can be realized by software/hardware.Wherein when disk snapshot rollback device adopts software simulating, can be integrated in virtual machine.This device comprises:
Variable sets up module 10, for setting up overall snapshot number as global variable, the number of times that described overall snapshot number is set up according to snapshot carries out value, sets up local number to each data block that current secondary table manages, and described local number carries out value according to the value of described overall snapshot number;
Snapshot sets up module 12, order is set up for receiving snapshot, set up order copy according to described snapshot described when previous stage table and described current secondary table are as snapshot one-level table and snapshot secondary table, the local number of each data block of described snapshot secondary table management is for characterizing the version of described snapshot secondary table;
Snapshot roll-back module 14, for receiving snapshot rollback order, rollback snapshot version number is carried in described snapshot rollback order, search corresponding described snapshot one-level table and described snapshot secondary table according to described rollback snapshot version number, make described previous stage table of working as point to described snapshot secondary table corresponding to described rollback snapshot version number.
Particularly, the snapshot rollback method in the present embodiment builds on the basis of following snapshot establishing techniques, and concrete snapshot establishing techniques comprises:
Set up overall snapshot number as global variable, initial value is 1.When first time snapshot set up by disk, overall snapshot value is 1; When second time snapshot set up by disk, overall snapshot value is 2, by that analogy.Set up local number to the data block that each current secondary table manages, initial value is 0.When first time snapshot set up by disk, overall snapshot value is 1, and the local number of the data block that current secondary table manages is 1; When second time snapshot set up by disk, overall snapshot value is 2, and the local number of the data block that current secondary table manages is 2.Simultaneously, when setting up snapshot, copy is when previous stage table and all current secondary table are as snapshot one-level table and snapshot secondary table, and wherein the local number of data block that manages of snapshot secondary table is identical with the local number of the data block that current secondary table when setting up snapshot manages.Namely, when first time snapshot set up by disk, the local number of the data block that first snapshot secondary table manages is 1; When second time snapshot set up by disk, the local number of the data block that first snapshot secondary table manages is still the local number of 1, second data block that snapshot secondary table manages is 2.
Receive write operation order, obtain the address of carrying data block to be operated in write operation order.From working as the local number searching this data block to be operated previous stage table and current secondary table.
When carrying out write operation owing to presetting for metadata in disk, preserve this metadata in former data block, then copy this metadata to another target data block, and the memory address of this metadata is changed into this target data block of sensing.After setting up snapshot, if there is write operation, due in the disk read-write mechanism that presets, directly preserving in original data block metadata, therefore can directly rewriting this metadata, without the need to carrying out Copy on write.If namely suppose originally have data in a certain data block, after setting up snapshot to this data block, the local number of this data block in current secondary table should equal overall snapshot number.Now to carry out write operation to this data block, according to the disk read-write mechanism preset, after write operation is carried out to this data block, automatically the data content in this data block can be preserved, and amended data content is copied in new data block, therefore can directly perform write operation and without the need to carrying out Copy on write.
In disk use procedure, the data in disk can constantly change, and namely constantly can perform write operation order to data in magnetic disk block.If now receive snapshot to set up order, then overall snapshot number can add 1, and the local number of the data block that current secondary table manages remains the value before snapshot is set up.Now the local number of data block that manages of current secondary table and overall snapshot number can be unequal.Therefore now need to carry out Copy on write.
In the present embodiment, disk snapshot rollback device is for performing above-mentioned disk snapshot rollback method, has identical functional module, does not repeat them here.
By adopting technique scheme disclosed by the invention, obtain effect useful as follows: by setting up overall snapshot number and setting up local number to storage object data block, record the version of snapshot.When snapshot rollback, find corresponding snapshot one-level table and snapshot secondary table by rollback snapshot version number, make again to point to snapshot secondary table corresponding to rollback snapshot version number when previous stage table.Without the need to carrying out rollback by snapshot one-level table, and do without the need to the reference count of the data block managed snapshot secondary table during rollback and subtract 1 operation, consuming timely to greatly reduce.
Fig. 4 is inventive disk snapshot rollback device second example structure figure, and as shown in Figure 4, the disk snapshot rollback device that the embodiment of the present invention provides can be realized by software/hardware.Wherein when disk snapshot rollback device adopts software simulating, can be integrated in virtual machine.This device comprises:
Variable sets up module 20, for setting up overall snapshot number as global variable, the number of times that described overall snapshot number is set up according to snapshot carries out value, sets up local number to each data block that current secondary table manages, and described local number carries out value according to the value of described overall snapshot number;
Snapshot sets up module 22, order is set up for receiving snapshot, set up order copy according to described snapshot described when previous stage table and described current secondary table are as snapshot one-level table and snapshot secondary table, the local number of each data block of described snapshot secondary table management is for characterizing the version of described snapshot secondary table;
Snapshot roll-back module 24, for receiving snapshot rollback order, rollback snapshot version number is carried in described snapshot rollback order, search corresponding described snapshot one-level table and described snapshot secondary table according to described rollback snapshot version number, make described previous stage table of working as point to described snapshot secondary table corresponding to described rollback snapshot version number.
Snapshot searches module 26, for obtaining at rear snapshot one-level table with in rear snapshot secondary table, described at rear snapshot one-level table with refer in rear snapshot secondary table and be later than described snapshot one-level table after described snapshot secondary table corresponding to described rollback snapshot version number and described snapshot secondary table Time Created;
Snapshot removing module 28, described at rear snapshot one-level table and described in rear snapshot secondary table for deleting.
Wherein, the local number of described snapshot secondary table corresponding to described rollback snapshot version number is greater than at the local number of rear snapshot secondary table.
Wherein, snapshot removing module 28 comprises:
Entry contrast unit 281, for contrasting the entry of described each correspondence in described snapshot secondary table corresponding to rear snapshot secondary table and described rollback snapshot version number;
Entry delete cells 282, if for there is different entries, then deletes described data block in rear snapshot secondary table corresponding to this entry;
First releasing unit 283, for until described after after all entries contrasts in snapshot secondary table, in rear snapshot secondary table described in release;
Second releasing unit 284, for until all described after the release of snapshot secondary table complete after, release is described at rear stage table.
By adopting technique scheme disclosed by the invention, obtain effect useful as follows: by setting up overall snapshot number and setting up local number to storage object data block, record the version of snapshot.When snapshot rollback, find corresponding snapshot one-level table and snapshot secondary table by rollback snapshot version number, make again to point to snapshot secondary table corresponding to rollback snapshot version number when previous stage table.Without the need to carrying out rollback by snapshot one-level table, and do without the need to the reference count of the data block managed snapshot secondary table during rollback and subtract 1 operation, consuming timely to greatly reduce.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (8)

1. a disk snapshot rollback method, is characterized in that, comprising:
Set up overall snapshot number as global variable, the number of times that described overall snapshot number is set up according to snapshot carries out value, sets up local number to each data block that current secondary table manages, and described local number carries out value according to the value of described overall snapshot number;
Receive snapshot and set up order, set up order copy according to described snapshot described when previous stage table and described current secondary table are as snapshot one-level table and snapshot secondary table, the local number of each data block of described snapshot secondary table management is for characterizing the version of described snapshot secondary table;
Receive snapshot rollback order, rollback snapshot version number is carried in described snapshot rollback order, search corresponding described snapshot one-level table and described snapshot secondary table according to described rollback snapshot version number, make described previous stage table of working as point to described snapshot secondary table corresponding to described rollback snapshot version number.
2. disk snapshot rollback method according to claim 1, it is characterized in that, described reception snapshot rollback order, rollback snapshot version number is carried in described snapshot rollback order, corresponding described snapshot one-level table and described snapshot secondary table is searched according to described rollback snapshot version number, make described after previous stage table points to described snapshot secondary table corresponding to described rollback snapshot version number, also comprise:
Obtain at rear snapshot one-level table with in rear snapshot secondary table, described at rear snapshot one-level table with refer in rear snapshot secondary table and be later than described snapshot one-level table after described snapshot secondary table corresponding to described rollback snapshot version number and described snapshot secondary table Time Created;
Delete described at rear snapshot one-level table and described in rear snapshot secondary table.
3. disk snapshot rollback method according to claim 2, is characterized in that, the described local number in rear snapshot secondary table is greater than the local number of described snapshot secondary table corresponding to described rollback snapshot version number.
4. disk snapshot rollback method according to claim 2, is characterized in that, at rear snapshot one-level table and described in rear snapshot secondary table described in described deletion, comprising:
The entry of described each correspondence in described snapshot secondary table corresponding to rear snapshot secondary table and described rollback snapshot version number of contrast;
If there is different entries, then delete described data block in rear snapshot secondary table corresponding to this entry;
Until described after after all entries contrasts in snapshot secondary table, in rear snapshot secondary table described in release;
Until all described after the release of snapshot secondary table complete after, release is described at rear stage table.
5. a disk snapshot rollback device, is characterized in that, comprising:
Variable sets up module, for setting up overall snapshot number as global variable, the number of times that described overall snapshot number is set up according to snapshot carries out value, sets up local number to each data block that current secondary table manages, and described local number carries out value according to the value of described overall snapshot number;
Snapshot sets up module, order is set up for receiving snapshot, set up order copy according to described snapshot described when previous stage table and described current secondary table are as snapshot one-level table and snapshot secondary table, the local number of each data block of described snapshot secondary table management is for characterizing the version of described snapshot secondary table;
Snapshot roll-back module, for receiving snapshot rollback order, rollback snapshot version number is carried in described snapshot rollback order, search corresponding described snapshot one-level table and described snapshot secondary table according to described rollback snapshot version number, make described previous stage table of working as point to described snapshot secondary table corresponding to described rollback snapshot version number.
6. disk snapshot rollback device according to claim 5, it is characterized in that, described device also comprises:
Snapshot searches module, for obtaining at rear snapshot one-level table with in rear snapshot secondary table, described at rear snapshot one-level table with refer in rear snapshot secondary table and be later than described snapshot one-level table after described snapshot secondary table corresponding to described rollback snapshot version number and described snapshot secondary table Time Created;
Snapshot removing module, described at rear snapshot one-level table and described in rear snapshot secondary table for deleting.
7. disk snapshot rollback device according to claim 6, is characterized in that, the described local number in rear snapshot secondary table is greater than the local number of described snapshot secondary table corresponding to described rollback snapshot version number.
8. disk snapshot rollback device according to claim 6, is characterized in that, described snapshot removing module comprises:
Entry contrast unit, for contrasting the entry of described each correspondence in described snapshot secondary table corresponding to rear snapshot secondary table and described rollback snapshot version number;
Entry delete cells, if for there is different entries, then deletes described data block in rear snapshot secondary table corresponding to this entry;
First releasing unit, for until described after after all entries contrasts in snapshot secondary table, in rear snapshot secondary table described in release;
Second releasing unit, for until all described after the release of snapshot secondary table complete after, release is described at rear stage table.
CN201410207333.1A 2014-05-16 2014-05-16 A kind of disk snapshot rollback method and device Expired - Fee Related CN105095016B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410207333.1A CN105095016B (en) 2014-05-16 2014-05-16 A kind of disk snapshot rollback method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410207333.1A CN105095016B (en) 2014-05-16 2014-05-16 A kind of disk snapshot rollback method and device

Publications (2)

Publication Number Publication Date
CN105095016A true CN105095016A (en) 2015-11-25
CN105095016B CN105095016B (en) 2018-05-18

Family

ID=54575517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410207333.1A Expired - Fee Related CN105095016B (en) 2014-05-16 2014-05-16 A kind of disk snapshot rollback method and device

Country Status (1)

Country Link
CN (1) CN105095016B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106814972A (en) * 2016-12-22 2017-06-09 北京华云网际科技有限公司 The rollback method and device of the snapshot node of distributed block storage
CN106909514A (en) * 2017-03-01 2017-06-30 郑州云海信息技术有限公司 A kind of localization method and device of snapshot disk address
WO2018119998A1 (en) * 2016-12-30 2018-07-05 华为技术有限公司 Snapshot rollback method, apparatus, storage controller, and system
WO2019080717A1 (en) * 2017-10-23 2019-05-02 阿里巴巴集团控股有限公司 Method and device for processing data of disk snapshot
CN110515543A (en) * 2019-08-02 2019-11-29 星辰天合(北京)数据科技有限公司 Object bucket-based snapshot method, device and system
CN111857602A (en) * 2020-07-31 2020-10-30 重庆紫光华山智安科技有限公司 Data processing method, data processing device, data node and storage medium
WO2024087426A1 (en) * 2022-10-26 2024-05-02 上海爱数信息技术股份有限公司 Full snapshot rapid generation method and apparatus, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050065986A1 (en) * 2003-09-23 2005-03-24 Peter Bixby Maintenance of a file version set including read-only and read-write snapshot copies of a production file
CN101178677A (en) * 2007-11-09 2008-05-14 中国科学院计算技术研究所 Computer system for protecting software and method for protecting software
CN102971698A (en) * 2012-06-29 2013-03-13 华为技术有限公司 Snapshot data-processing method and system, storage system and snapshot agency
CN103092673A (en) * 2012-11-27 2013-05-08 北京航空航天大学 Snapshot processing method and device for virtual machine
CN103699681A (en) * 2013-12-31 2014-04-02 华为技术有限公司 Data rollback processing method and data rollback processing device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050065986A1 (en) * 2003-09-23 2005-03-24 Peter Bixby Maintenance of a file version set including read-only and read-write snapshot copies of a production file
CN101178677A (en) * 2007-11-09 2008-05-14 中国科学院计算技术研究所 Computer system for protecting software and method for protecting software
CN102971698A (en) * 2012-06-29 2013-03-13 华为技术有限公司 Snapshot data-processing method and system, storage system and snapshot agency
CN103092673A (en) * 2012-11-27 2013-05-08 北京航空航天大学 Snapshot processing method and device for virtual machine
CN103699681A (en) * 2013-12-31 2014-04-02 华为技术有限公司 Data rollback processing method and data rollback processing device

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106814972A (en) * 2016-12-22 2017-06-09 北京华云网际科技有限公司 The rollback method and device of the snapshot node of distributed block storage
WO2018119998A1 (en) * 2016-12-30 2018-07-05 华为技术有限公司 Snapshot rollback method, apparatus, storage controller, and system
CN108604201A (en) * 2016-12-30 2018-09-28 华为技术有限公司 A kind of snapshot rollback method, device, storage control and system
CN108604201B (en) * 2016-12-30 2022-02-25 华为技术有限公司 Snapshot rollback method, device, storage controller and system
CN106909514A (en) * 2017-03-01 2017-06-30 郑州云海信息技术有限公司 A kind of localization method and device of snapshot disk address
WO2019080717A1 (en) * 2017-10-23 2019-05-02 阿里巴巴集团控股有限公司 Method and device for processing data of disk snapshot
CN110515543A (en) * 2019-08-02 2019-11-29 星辰天合(北京)数据科技有限公司 Object bucket-based snapshot method, device and system
CN110515543B (en) * 2019-08-02 2021-02-19 星辰天合(北京)数据科技有限公司 Object bucket-based snapshot method, device and system
CN111857602A (en) * 2020-07-31 2020-10-30 重庆紫光华山智安科技有限公司 Data processing method, data processing device, data node and storage medium
WO2024087426A1 (en) * 2022-10-26 2024-05-02 上海爱数信息技术股份有限公司 Full snapshot rapid generation method and apparatus, electronic device and storage medium

Also Published As

Publication number Publication date
CN105095016B (en) 2018-05-18

Similar Documents

Publication Publication Date Title
CN105095016A (en) Disk snapshot roll-back method and device
US20230117542A1 (en) Remote Data Replication Method and System
US10628378B2 (en) Replication of snapshots and clones
US10649897B2 (en) Access request processing method and apparatus, and computer device
US20180046553A1 (en) Storage control device and storage system
US10789131B2 (en) Transportable backups for pluggable database relocation
US8738883B2 (en) Snapshot creation from block lists
WO2020207010A1 (en) Data backup method and device, and computer-readable storage medium
CN106951345B (en) Consistency test method and device for disk data of virtual machine
CN104657382A (en) Method and device for detecting consistency of data of MySQL master and slave servers
CN108205560B (en) Data synchronization method and device
CN107203331B (en) Method and device for writing data
US11030092B2 (en) Access request processing method and apparatus, and computer system
CN106528071A (en) Selection method and device for target code
US10509767B2 (en) Systems and methods for managing snapshots of a file system volume
WO2020119709A1 (en) Data merging implementation method, device, system, and storage medium
CN111143231B (en) Method, apparatus and computer program product for data processing
US11099946B1 (en) Differential restore using block-based backups
US11163799B2 (en) Automatic rollback to target for synchronous replication
CN104951370A (en) Memory management method and device
US9009430B2 (en) Restoration of data from a backup storage volume
US9547651B1 (en) Establishing file relationships based on file operations
KR20140121013A (en) Method, system for dual buffering file management with non-volatile memory and mass storage device using the same
CN105760456A (en) Method and device for maintaining data consistency
US20130262804A1 (en) Data duplication system, data duplication method, and program thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180518

Termination date: 20190516