CN105095016B - A kind of disk snapshot rollback method and device - Google Patents

A kind of disk snapshot rollback method and device Download PDF

Info

Publication number
CN105095016B
CN105095016B CN201410207333.1A CN201410207333A CN105095016B CN 105095016 B CN105095016 B CN 105095016B CN 201410207333 A CN201410207333 A CN 201410207333A CN 105095016 B CN105095016 B CN 105095016B
Authority
CN
China
Prior art keywords
snapshot
rollback
secondary table
level
data block
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.)
Expired - Fee Related
Application number
CN201410207333.1A
Other languages
Chinese (zh)
Other versions
CN105095016A (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

Abstract

The present invention provides a kind of disk snapshot rollback method and device, this method includes setting up global snapshot number as global variable, the number that global snapshot number is established according to snapshot carries out value, local number is set up to each data block of current secondary table management, local number carries out value according to the value of global snapshot number;Snapshot foundation order is received, order copy is established according to snapshot and works as previous stage table and current secondary table as snapshot level-one table and snapshot secondary table, the local number of each data block of snapshot secondary table management is used to characterize the version of snapshot secondary table;Snapshot rollback order is received, rollback snapshot version number is carried in snapshot rollback order, corresponding snapshot level-one table and snapshot secondary table are searched according to rollback snapshot version number, makes to be directed toward the corresponding snapshot secondary table of rollback snapshot version number when previous stage table.Subtract 1 without the reference count by snapshot level-one table search, and without the data block to snapshot secondary table management during due to rollback, take and greatly reduce.

Description

A kind of disk snapshot rollback method and device
Technical field
The present invention relates to technical field of data backup more particularly to a kind of disk snapshot rollback methods and device.
Background technology
Snapshot is a kind of data copy technology based on time point, is a key concept in data backup field.It establishes The purpose of snapshot is to preserve the data message of disk at a time, if disk failures can be incited somebody to action by snapshot in the future Recovering disk data to snapshot establish when state.
The method for building up of snapshot includes two kinds in the prior art, and one kind is physical copy, and one kind is logical copy.Physics is copied Shellfish refers to, to the initial data progress complete copy in disk, occupy the memory space equal with initial data, required storage is empty Between it is excessive.Logical copy refers to be copied just for the data for occurring to change, and passes through Copy on write (Copy in the prior art On Write, abbreviation COW) technology progress logical copy.Specific method is as follows:
COW technologies use the storage management mechanism of two-stage table (level-one table L1 and secondary table L2), and wherein level-one table L1 includes Multiple list items, each list item record the address information of a secondary table L2, secondary table L2 can be found by level-one table L1;Two Grade table L2 includes multiple list items, and each list item records the address mapping relation of a data block, which is the number According to metadata in block and the mapping relations of physical address.
When snapshot is established, copy entire disk works as previous stage table L1 and current secondary table L2 as snapshot level-one table L1 With snapshot secondary table L2, snapshot level-one table L1 and all snapshot secondary table L2 is traveled through, receives the institute pointed by snapshot secondary table L2 There is the reference count of data block, represent that the number of Copy on write has occurred for the data block when wherein reference count is more than 1.Work as generation During data write operation, first determine whether the reference count of the data block corresponding to the write operation is more than 1.It will be deposited if more than 1 It, should by storage in the address information write-in snapshot level-one table L1 for storing up the secondary table L2 of the address mapping relation before the data block is rewritten The address information of the secondary table L2 of the revised address mapping relation of data block is write in the source level-one table L1 of the disk.
When snapshot rollback, the corresponding snapshot level-one table L1 of rollback version is first looked for, passes through snapshot level-one table search To corresponding snapshot secondary table L2.It is replaced by snapshot level-one table L1 and snapshot secondary table L2 when previous stage table L1 and current two level Table L2, and the reference count of the snapshot secondary table L2 data blocks managed is carried out subtracting 1 operation.
Since existing snapshot rollback technology is by snapshot level-one table L1 progress rollbacks, and needed during rollback to snapshot secondary table The reference count for the data block that L2 is managed carries out subtracting 1 operation, takes very long.
The content of the invention
It is an object of the invention to provide a kind of disk snapshot rollback method and device, so as to solve to exist in the prior art Foregoing problems.
To achieve these goals, the technical solution adopted by the present invention is as follows:
A kind of disk snapshot rollback method, including:
Global snapshot number is set up as global variable, the number that the overall situation snapshot number is established according to snapshot carries out value, Set up local number to each data block of current secondary table management, the local number is according to the value of the global snapshot number Carry out value;
It receives snapshot and establishes order, work as previous stage table and the current two level according to the snapshot establishes order copy Table is used to characterize as snapshot level-one table and snapshot secondary table, the local number of each data block of the snapshot secondary table management The version of the snapshot secondary table;
Snapshot rollback order is received, rollback snapshot version number is carried in the snapshot rollback order, it is fast according to the rollback The corresponding snapshot level-one table and the snapshot secondary table are searched according to version number, is made described when previous stage table is directed toward the rollback The corresponding snapshot secondary table of snapshot version number.
Preferably, the reception snapshot rollback order, carries rollback snapshot version number in the snapshot rollback order, according to The corresponding snapshot level-one table and the snapshot secondary table are searched by the rollback snapshot version number, make described when previous stage table refers to After the corresponding snapshot secondary table of the rollback snapshot version number, further include:
It obtains in rear snapshot level-one table and in rear snapshot secondary table, it is described in rear snapshot level-one table and in rear snapshot secondary table Refer to the snapshot level-one table that settling time is later than after the corresponding snapshot secondary table of the rollback snapshot version number and The snapshot secondary table;
It deletes described in rear snapshot level-one table and described in rear snapshot secondary table.
Preferably, it is corresponding described fast to be more than the rollback snapshot version number for the local number in rear snapshot secondary table According to the local number of secondary table.
Preferably, described in the deletion in rear snapshot level-one table and described in rear snapshot secondary table, including:
Comparison is described each in the corresponding snapshot secondary table of rear snapshot secondary table and the rollback snapshot version number A corresponding entry;
If there are different entries, the data block in rear snapshot secondary table corresponding to the entry is deleted;
After all entries comparisons are completed in snapshot secondary table after described in, release is described in rear snapshot secondary table;
After all snapshot secondary tables after are discharged and finished, release is described in rear stage table.
The beneficial effects of the invention are as follows:By setting up global snapshot number and setting up local number to storage object data block, To record the version of snapshot.In snapshot rollback, corresponding snapshot level-one table and snapshot are found by rollback snapshot version number Secondary table so that when previous stage table is directed toward the corresponding snapshot secondary table of rollback snapshot version number again.Without passing through snapshot level-one Table carries out rollback, and the operation that subtracts 1 is done in the reference count of data block during rollback without being managed to snapshot secondary table, taken significantly It reduces.
A kind of disk snapshot rollback device, including:
Variable sets up module, and for setting up global snapshot number as global variable, the overall situation snapshot number is built according to snapshot Vertical number carries out value, sets up local number to each data block of current secondary table management, the local number is according to institute The value for stating global snapshot number carries out value;
Snapshot establishes module, order is established for receiving snapshot, when previous according to the snapshot establishes order copy Grade table and the current secondary table are as snapshot level-one table and snapshot secondary table, each data block of the snapshot secondary table management Local number be used to characterize the version of the snapshot secondary table;
Snapshot roll-back module for receiving snapshot rollback order, carries rollback snapshot version in the snapshot rollback order Number, the corresponding snapshot level-one table and the snapshot secondary table are searched according to the rollback snapshot version number, made described current Level-one table is directed toward the corresponding snapshot secondary table of the rollback snapshot version number.
Preferably, described device further includes:
Snapshot searching module, it is described in rear snapshot level-one for obtaining in rear snapshot level-one table and in rear snapshot secondary table Table refers to that settling time is later than after the corresponding snapshot secondary table of the rollback snapshot version number in rear snapshot secondary table The snapshot level-one table and the snapshot secondary table;
Snapshot removing module, it is described in rear snapshot level-one table and described in rear snapshot secondary table for deleting.
Preferably, it is corresponding described fast to be more than the rollback snapshot version number for the local number in rear snapshot secondary table According to the local number of secondary table.
Preferably, the snapshot removing module includes:
Entry comparison unit, it is described corresponding described in rear snapshot secondary table and the rollback snapshot version number for comparing The corresponding entry of each in snapshot secondary table;
Entry deletes unit, if for there are different entries, deleting described entry institute in rear snapshot secondary table Corresponding data block;
First releasing unit, after all entries comparisons are completed in snapshot secondary table after described in, described in release In rear snapshot secondary table;
Second releasing unit, after discharging and finishing after all snapshot secondary tables after, release is described latter Grade table.
The beneficial effects of the invention are as follows:By setting up global snapshot number and setting up local number to storage object data block, To record the version of snapshot.In snapshot rollback, corresponding snapshot level-one table and snapshot are found by rollback snapshot version number Secondary table so that when previous stage table is directed toward the corresponding snapshot secondary table of rollback snapshot version number again.Without passing through snapshot level-one Table carries out rollback, and the operation that subtracts 1 is done in the reference count of data block during rollback without being managed to snapshot secondary table, taken significantly It reduces.
Description of the drawings
Fig. 1 is inventive disk snapshot rollback method first embodiment flow chart;
Fig. 2 is inventive disk snapshot rollback method second embodiment flow chart;
Fig. 3 is inventive disk snapshot rollback method 3rd embodiment flow chart;
Fig. 4 is inventive disk snapshot rollback device first embodiment structure chart.
Specific embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, below in conjunction with attached drawing, to the present invention into Row is further described.It should be appreciated that the specific embodiments described herein are only used to explain the present invention, it is not used to Limit the present invention.
Fig. 1 is inventive disk snapshot rollback method first embodiment flow chart, as shown in Figure 1, institute of the embodiment of the present invention The disk snapshot rollback method of offer is performed by disk snapshot rollback device, and disk snapshot rollback device can be by software/hardware It realizes.Wherein when disk snapshot rollback device is realized using software, it can be integrated in virtual machine.This method includes:
Step S100 sets up the number that global snapshot number is established as global variable, the overall situation snapshot number according to snapshot Value is carried out, local number is set up to each data block of current secondary table management, the local number is according to described global fast According to number value carry out value.
Step S102 receives snapshot and establishes order, works as previous stage table and institute according to the snapshot establishes order copy Current secondary table is stated as snapshot level-one table and snapshot secondary table, the local volume of each data block of the snapshot secondary table management Number for characterizing the version of the snapshot secondary table.
Specifically, the snapshot rollback method in the present embodiment is built on the basis of following snapshot establishing techniques, specifically Snapshot establishing techniques include:
Global snapshot number is set up as global variable, initial value 1.When disk establishes first time snapshot, global snapshot Number value is 1;When disk establishes second of snapshot, global snapshot value is 2, and so on.To each current secondary table The data block managed sets up local number, initial value 0.When disk establishes first time snapshot, global snapshot value is 1, the local number for the data block that current secondary table is managed is 1;When disk establishes second of snapshot, global snapshot value For 2, the local number for the data block that current secondary table is managed is 2.Meanwhile when establishing snapshot, copy is when previous stage table and institute There is local number of the current secondary table as snapshot level-one table and snapshot secondary table, the wherein data block that snapshot secondary table is managed The local number for the data block that current secondary table during with establishing snapshot is managed is identical.I.e. when disk establishes first time snapshot When, the local number for the data block that first snapshot secondary table is managed is 1;When disk establishes second of snapshot, first The local number for the data block that snapshot secondary table is managed is still 1, the part for the data block that second snapshot secondary table is managed Number is 2.
Write operation order is received, obtains the address that data block to be operated is carried in write operation order.From when previous stage table and The local number of the data block to be operated is searched in current secondary table.
When being directed to metadata progress write operation in disk due to presetting, the metadata is preserved in former data block, so After copy the metadata to another target data block, and the storage address of the metadata is changed to point to the target data block.It builds After vertical snapshot, in the event of write operation, since in preset disk read-write mechanism, meeting is directly to metadata in original number According to being preserved in block, therefore directly the metadata can be rewritten, without carrying out Copy on write.Assume a certain data If having data originally in block, after establishing snapshot to the data block, local number of the data block in current secondary table should Global snapshot number should be equal to.Now write operation is carried out to the data block, according to preset disk read-write mechanism, to the data After block carries out write operation, data data content in the block can be automatically saved, and amended data content is copied to new In data block, therefore write operation can be directly performed without carrying out Copy on write.
During disk use, the data in disk can constantly change, i.e., data in magnetic disk block can be performed constantly Write operation order.If receiving snapshot at this time establishes order, global snapshot number can add 1, and what current secondary table was managed The local number of data block is still the value before snapshot is established.The local volume for the data block that current secondary table is managed at this time Number and global snapshot number can be unequal.Therefore need to carry out Copy on write at this time.
Step S104 receives snapshot rollback order, rollback snapshot version number is carried in the snapshot rollback order, according to institute It states rollback snapshot version number and searches the corresponding snapshot level-one table and the snapshot secondary table, make described when previous stage table is directed toward The corresponding snapshot secondary table of the rollback snapshot version number.
By using above-mentioned technical proposal disclosed by the invention, following beneficial effect has been obtained:It is global fast by setting up According to number and local number is set up to storage object data block, to record the version of snapshot.In snapshot rollback, pass through rollback snapshot Version number finds corresponding snapshot level-one table and snapshot secondary table so that when previous stage table is directed toward rollback snapshot version number again Corresponding snapshot secondary table.Without carrying out rollback by snapshot level-one table, and snapshot secondary table need not be managed during rollback The operation that subtracts 1 is done in the reference count of data block, is taken and is greatly reduced.
Fig. 2 is inventive disk snapshot rollback method first embodiment flow chart, as shown in Fig. 2, institute of the embodiment of the present invention The disk snapshot rollback method of offer is performed by disk snapshot rollback device, and disk snapshot rollback device can be by software/hardware It realizes.Wherein when disk snapshot rollback device is realized using software, it can be integrated in virtual machine.This method includes:
Step S200 sets up the number that global snapshot number is established as global variable, the overall situation snapshot number according to snapshot Value is carried out, local number is set up to each data block of current secondary table management, the local number is according to described global fast According to number value carry out value.
Step S202 receives snapshot and establishes order, works as previous stage table and institute according to the snapshot establishes order copy Current secondary table is stated as snapshot level-one table and snapshot secondary table, the local volume of each data block of the snapshot secondary table management Number for characterizing the version of the snapshot secondary table.
Step S204 receives snapshot rollback order, rollback snapshot version number is carried in the snapshot rollback order, according to institute It states rollback snapshot version number and searches the corresponding snapshot level-one table and the snapshot secondary table, make described when previous stage table is directed toward The corresponding snapshot secondary table of the rollback snapshot version number.
Step S206 is obtained in rear snapshot level-one table and in rear snapshot secondary table, described in rear snapshot level-one table and rear It is described fast after the corresponding snapshot secondary table of the rollback snapshot version number that snapshot secondary table refers to that settling time is later than According to level-one table and the snapshot secondary table;
Specifically, it is more than the corresponding snapshot two of the rollback snapshot version number in the local number of rear snapshot secondary table The local number of grade table.
Step S208 is deleted described in rear snapshot level-one table and described in rear snapshot secondary table.
Specifically, each correspondence in the corresponding snapshot secondary table of rear snapshot secondary table and rollback snapshot version number is compared Entry;If there are different entries, the data block in rear snapshot secondary table corresponding to the entry is deleted;Stay in rear snapshot After all entry comparisons are completed in secondary table, discharge in rear snapshot secondary table;It is finished after the release of all snapshot secondary tables after Afterwards, discharge in rear stage table.
By using above-mentioned technical proposal disclosed by the invention, following beneficial effect has been obtained:It is global fast by setting up According to number and local number is set up to storage object data block, to record the version of snapshot.In snapshot rollback, pass through rollback snapshot Version number finds corresponding snapshot level-one table and snapshot secondary table so that when previous stage table is directed toward rollback snapshot version number again Corresponding snapshot secondary table.Without carrying out rollback by snapshot level-one table, and snapshot secondary table need not be managed during rollback The operation that subtracts 1 is done in the reference count of data block, is taken and is greatly reduced.
Fig. 3 is inventive disk snapshot rollback device first embodiment structure chart, as shown in figure 3, institute of the embodiment of the present invention The disk snapshot rollback device of offer can be realized by software/hardware.Wherein when disk snapshot rollback device is realized using software When, it can be integrated in virtual machine.The device includes:
Variable sets up module 10, and for setting up global snapshot number as global variable, the overall situation snapshot number is according to snapshot The number of foundation carries out value, sets up local number to each data block of current secondary table management, the local number according to The value of the overall situation snapshot number carries out value;
Snapshot establishes module 12, and order is established for receiving snapshot, and it is described current to establish order copy according to the snapshot Level-one table and the current secondary table are as snapshot level-one table and snapshot secondary table, each data of the snapshot secondary table management The local number of block is used to characterize the version of the snapshot secondary table;
Snapshot roll-back module 14 for receiving snapshot rollback order, carries rollback snapshot version in the snapshot rollback order This number, the corresponding snapshot level-one table and the snapshot secondary table are searched according to the rollback snapshot version number, make described work as Previous stage table is directed toward the corresponding snapshot secondary table of the rollback snapshot version number.
Specifically, the snapshot rollback method in the present embodiment is built on the basis of following snapshot establishing techniques, specifically Snapshot establishing techniques include:
Global snapshot number is set up as global variable, initial value 1.When disk establishes first time snapshot, global snapshot Number value is 1;When disk establishes second of snapshot, global snapshot value is 2, and so on.To each current secondary table The data block managed sets up local number, initial value 0.When disk establishes first time snapshot, global snapshot value is 1, the local number for the data block that current secondary table is managed is 1;When disk establishes second of snapshot, global snapshot value For 2, the local number for the data block that current secondary table is managed is 2.Meanwhile when establishing snapshot, copy is when previous stage table and institute There is local number of the current secondary table as snapshot level-one table and snapshot secondary table, the wherein data block that snapshot secondary table is managed The local number for the data block that current secondary table during with establishing snapshot is managed is identical.I.e. when disk establishes first time snapshot When, the local number for the data block that first snapshot secondary table is managed is 1;When disk establishes second of snapshot, first The local number for the data block that snapshot secondary table is managed is still 1, the part for the data block that second snapshot secondary table is managed Number is 2.
Write operation order is received, obtains the address that data block to be operated is carried in write operation order.From when previous stage table and The local number of the data block to be operated is searched in current secondary table.
When being directed to metadata progress write operation in disk due to presetting, the metadata is preserved in former data block, so After copy the metadata to another target data block, and the storage address of the metadata is changed to point to the target data block.It builds After vertical snapshot, in the event of write operation, since in preset disk read-write mechanism, meeting is directly to metadata in original number According to being preserved in block, therefore directly the metadata can be rewritten, without carrying out Copy on write.Assume a certain data If having data originally in block, after establishing snapshot to the data block, local number of the data block in current secondary table should Global snapshot number should be equal to.Now write operation is carried out to the data block, according to preset disk read-write mechanism, to the data After block carries out write operation, data data content in the block can be automatically saved, and amended data content is copied to new In data block, therefore write operation can be directly performed without carrying out Copy on write.
During disk use, the data in disk can constantly change, i.e., data in magnetic disk block can be performed constantly Write operation order.If receiving snapshot at this time establishes order, global snapshot number can add 1, and what current secondary table was managed The local number of data block is still the value before snapshot is established.The local volume for the data block that current secondary table is managed at this time Number and global snapshot number can be unequal.Therefore need to carry out Copy on write at this time.
Disk snapshot rollback device has the function of identical for performing above-mentioned disk snapshot rollback method in the present embodiment Module, details are not described herein.
By using above-mentioned technical proposal disclosed by the invention, following beneficial effect has been obtained:It is global fast by setting up According to number and local number is set up to storage object data block, to record the version of snapshot.In snapshot rollback, pass through rollback snapshot Version number finds corresponding snapshot level-one table and snapshot secondary table so that when previous stage table is directed toward rollback snapshot version number again Corresponding snapshot secondary table.Without carrying out rollback by snapshot level-one table, and snapshot secondary table need not be managed during rollback The operation that subtracts 1 is done in the reference count of data block, is taken and is greatly reduced.
Fig. 4 is inventive disk snapshot rollback device second embodiment structure chart, as shown in figure 4, institute of the embodiment of the present invention The disk snapshot rollback device of offer can be realized by software/hardware.Wherein when disk snapshot rollback device is realized using software When, it can be integrated in virtual machine.The device includes:
Variable sets up module 20, and for setting up global snapshot number as global variable, the overall situation snapshot number is according to snapshot The number of foundation carries out value, sets up local number to each data block of current secondary table management, the local number according to The value of the overall situation snapshot number carries out value;
Snapshot establishes module 22, and order is established for receiving snapshot, and it is described current to establish order copy according to the snapshot Level-one table and the current secondary table are as snapshot level-one table and snapshot secondary table, each data of the snapshot secondary table management The local number of block is used to characterize the version of the snapshot secondary table;
Snapshot roll-back module 24 for receiving snapshot rollback order, carries rollback snapshot version in the snapshot rollback order This number, the corresponding snapshot level-one table and the snapshot secondary table are searched according to the rollback snapshot version number, make described work as Previous stage table is directed toward the corresponding snapshot secondary table of the rollback snapshot version number.
Snapshot searching module 26, it is described in rear snapshot one for obtaining in rear snapshot level-one table and in rear snapshot secondary table Grade table with rear snapshot secondary table refer to settling time be later than the corresponding snapshot secondary table of the rollback snapshot version number it The snapshot level-one table afterwards and the snapshot secondary table;
Snapshot removing module 28, it is described in rear snapshot level-one table and described in rear snapshot secondary table for deleting.
Wherein, it is more than the corresponding snapshot two level of the rollback snapshot version number in the local number of rear snapshot secondary table The local number of table.
Wherein, snapshot removing module 28 includes:
Entry comparison unit 281, it is described corresponding in rear snapshot secondary table and the rollback snapshot version number for comparing Each corresponding entry in the snapshot secondary table;
Entry deletes unit 282, if for there are different entries, deleting described entry in rear snapshot secondary table Corresponding data block;
First releasing unit 283 after all entries comparisons are completed in snapshot secondary table after described in, discharges institute It states in rear snapshot secondary table;
Second releasing unit 284, after discharging and finishing after all snapshot secondary tables after, release is described rear Level-one table.
By using above-mentioned technical proposal disclosed by the invention, following beneficial effect has been obtained:It is global fast by setting up According to number and local number is set up to storage object data block, to record the version of snapshot.In snapshot rollback, pass through rollback snapshot Version number finds corresponding snapshot level-one table and snapshot secondary table so that when previous stage table is directed toward rollback snapshot version number again Corresponding snapshot secondary table.Without carrying out rollback by snapshot level-one table, and snapshot secondary table need not be managed during rollback The operation that subtracts 1 is done in the reference count of data block, is taken and is greatly reduced.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (8)

1. a kind of disk snapshot rollback method, which is characterized in that including:
Global snapshot number is set up as global variable, the number that the overall situation snapshot number is established according to snapshot carries out value, to working as Each data block of preceding secondary table management sets up local number, and the local number is carried out according to the value of the global snapshot number Value;
Snapshot foundation order is received, order copy is established according to the snapshot and works as previous stage watch and the current secondary table as fast According to level-one table and snapshot secondary table, the local number of each data block of the snapshot secondary table management is used to characterize the snapshot The version of secondary table;
Snapshot rollback order is received, rollback snapshot version number is carried in the snapshot rollback order, according to the rollback snapshot version This number is searched the corresponding snapshot level-one table and the snapshot secondary table, is made described when previous stage table is directed toward the rollback snapshot The corresponding snapshot secondary table of version number.
2. disk snapshot rollback method according to claim 1, which is characterized in that the reception snapshot rollback order, institute It states and rollback snapshot version number is carried in snapshot rollback order, the corresponding snapshot one is searched according to the rollback snapshot version number Grade table and the snapshot secondary table make described when previous stage table is directed toward the corresponding snapshot two level of the rollback snapshot version number After table, further include:
It obtains in rear snapshot level-one table and in rear snapshot secondary table, it is described to refer in rear snapshot level-one table and in rear snapshot secondary table Settling time is later than the snapshot level-one table after the corresponding snapshot secondary table of the rollback snapshot version number and described Snapshot secondary table;
It deletes described in rear snapshot level-one table and described in rear snapshot secondary table.
3. disk snapshot rollback method according to claim 2, which is characterized in that the part in rear snapshot secondary table Number is more than the local number of the corresponding snapshot secondary table of the rollback snapshot version number.
4. disk snapshot rollback method according to claim 2, which is characterized in that in rear snapshot level-one described in the deletion Table and described in rear snapshot secondary table, including:
Each is right in the corresponding snapshot secondary table of rear snapshot secondary table and the rollback snapshot version number described in comparison The entry answered;
If there are different entries, the data block in rear snapshot secondary table corresponding to the entry is deleted;
After all entries comparisons are completed in snapshot secondary table after described in, release is described in rear snapshot secondary table;
After all snapshot secondary tables after are discharged and finished, release is described in rear snapshot level-one table.
5. a kind of disk snapshot rollback device, which is characterized in that including:
Variable sets up module, and global variable is used as setting up global snapshot number, what the overall situation snapshot number was established according to snapshot Number carries out value, local number is set up to each data block of current secondary table management, the local number is according to described complete The value of office's snapshot number carries out value;
Snapshot establishes module, and order is established for receiving snapshot, and order copy is established when previous stage table and institute according to the snapshot Current secondary table is stated as snapshot level-one table and snapshot secondary table, the local volume of each data block of the snapshot secondary table management Number for characterizing the version of the snapshot secondary table;
Snapshot roll-back module for receiving snapshot rollback order, carries rollback snapshot version number, root in the snapshot rollback order The corresponding snapshot level-one table and the snapshot secondary table are searched according to the rollback snapshot version number, is made described when previous stage table It is directed toward the corresponding snapshot secondary table of the rollback snapshot version number.
6. disk snapshot rollback device according to claim 5, which is characterized in that described device further includes:
Snapshot searching module, for obtaining in rear snapshot level-one table and in rear snapshot secondary table, it is described in rear snapshot level-one table and Institute after rear snapshot secondary table refers to that settling time is later than the corresponding snapshot secondary table of the rollback snapshot version number State snapshot level-one table and the snapshot secondary table;
Snapshot removing module, it is described in rear snapshot level-one table and described in rear snapshot secondary table for deleting.
7. disk snapshot rollback device according to claim 6, which is characterized in that the part in rear snapshot secondary table Number is more than the local number of the corresponding snapshot secondary table of the rollback snapshot version number.
8. disk snapshot rollback device according to claim 6, which is characterized in that the snapshot removing module includes:
Entry comparison unit, it is described in the corresponding snapshot of rear snapshot secondary table and the rollback snapshot version number for comparing The corresponding entry of each in secondary table;
Entry deletes unit, if described in rear snapshot secondary table corresponding to the entry for there are different entries, deleting Data block;
First releasing unit, after all entries comparisons are completed in snapshot secondary table after described in, release is described rear Snapshot secondary table;
Second releasing unit, after discharging and finishing after all snapshot secondary tables after, release is described in rear snapshot one Grade 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 CN105095016A (en) 2015-11-25
CN105095016B true 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)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106814972B (en) * 2016-12-22 2018-04-17 北京华云网际科技有限公司 The rollback method and device of the snapshot node of distributed block storage
CN108604201B (en) * 2016-12-30 2022-02-25 华为技术有限公司 Snapshot rollback method, device, storage controller and system
CN106909514B (en) * 2017-03-01 2021-04-30 郑州云海信息技术有限公司 Method and device for positioning snapshot disk address
CN109697021A (en) * 2017-10-23 2019-04-30 阿里巴巴集团控股有限公司 A kind of data processing method and device of disk snapshot
CN110515543B (en) * 2019-08-02 2021-02-19 星辰天合(北京)数据科技有限公司 Object bucket-based snapshot method, device and system
CN111857602B (en) * 2020-07-31 2022-10-28 重庆紫光华山智安科技有限公司 Data processing method, data processing device, data node and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7555504B2 (en) * 2003-09-23 2009-06-30 Emc Corporation Maintenance of a file version set including read-only and read-write snapshot copies of a production file

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN105095016A (en) 2015-11-25

Similar Documents

Publication Publication Date Title
CN105095016B (en) A kind of disk snapshot rollback method and device
US10996884B2 (en) System and method for reference tracking garbage collector
US10656859B2 (en) Efficient deduplication for storage systems
US8782011B2 (en) System and method for scalable reference management in a deduplication based storage system
EP2863310B1 (en) Data processing method and apparatus, and shared storage device
US10564880B2 (en) Data deduplication method and apparatus
KR100703753B1 (en) Apparatus and method for managing file system
CN106484906A (en) A kind of distributed objects storage system flash back method and device
EP3316150A1 (en) Method and apparatus for file compaction in key-value storage system
KR102038529B1 (en) System for processing real-time data modification of in-memory database
WO2013091167A1 (en) Log storage method and system
US10007436B2 (en) Storage control apparatus and control method of storage control apparatus
US10509767B2 (en) Systems and methods for managing snapshots of a file system volume
US10289345B1 (en) Contention and metadata write amplification reduction in log structured data storage mapping
CN110716924B (en) Method and device for deleting expired data
CN103699681B (en) The treating method and apparatus of data rewind
US20200097581A1 (en) Systems and methods of managing manifest refresh in a database
US10210067B1 (en) Space accounting in presence of data storage pre-mapper
CN103530067B (en) A kind of method and apparatus of data manipulation
US10303680B2 (en) Data processing apparatus and data processing method
CN105095015B (en) The method for building up and device of a kind of disk snapshot
US10795875B2 (en) Data storing method using multi-version based data structure
US10146836B2 (en) Primary key generator
US9588996B2 (en) Point in time recovery support for pending schema definition changes
CN110659250B (en) File processing method and system

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

Granted publication date: 20180518

Termination date: 20190516

CF01 Termination of patent right due to non-payment of annual fee