CN103645967A - Read-only snapshot rollback method and device - Google Patents

Read-only snapshot rollback method and device Download PDF

Info

Publication number
CN103645967A
CN103645967A CN201310611326.3A CN201310611326A CN103645967A CN 103645967 A CN103645967 A CN 103645967A CN 201310611326 A CN201310611326 A CN 201310611326A CN 103645967 A CN103645967 A CN 103645967A
Authority
CN
China
Prior art keywords
read
materialized view
file system
data
materialized
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
CN201310611326.3A
Other languages
Chinese (zh)
Other versions
CN103645967B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310611326.3A priority Critical patent/CN103645967B/en
Publication of CN103645967A publication Critical patent/CN103645967A/en
Application granted granted Critical
Publication of CN103645967B publication Critical patent/CN103645967B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a read-only snapshot rollback method and device used for solving the problem that partial read-only snapshot data cannot be obtained after rollback of the read-only snapshot in a read-only snapshot rollback process. The read-only snapshot rollback method comprises the steps of: after a read-only snapshot rollback indication is received, obtaining a root of a target read-only snapshot based on the read-only snapshot rollback indication; replacing a root of a file system by using the root of the target read-only snapshot; enabling the target read-only snapshot to roll back to the file system; reserving the read-only snapshots at all the establishment moments after the corresponding establishment moment of the target read-only snapshot. With the adoption of the technical scheme, after the target read-only snapshot is rolled back to the file system based on the user indication, the read-only snapshots at all the establishment moments after the corresponding establishment moment of the target read-only snapshot are reserved, so that incapability of restoring data caused by wrong operation of the user is prevented efficiently, the user can obtain necessary read-only snapshots rapidly after the read-only snapshot is rolled back, and therefore operability of the system is improved efficiently.

Description

A kind of read-only materialized view rollback method and device
Technical field
The present invention relates to Computer Applied Technology field, relate in particular to a kind of read-only materialized view rollback method and device.
Background technology
At present, at NAS(Network Attached Storage; Network connection storage) in application, FS(File System; File system) for for storing and the system of management document, it comprises the file directory that is managed in a large number file and represents this heap file hierarchical relationship, and file system can provide for user the functions such as reading and writing of files, deleted file and new files.In file system, the needs for file data protection, can create ROW(Redirect-on-write to FS in the different moment; While writing, be redirected) read-only materialized view, wherein, read-only materialized view is the reflection of file system sometime.When FS breaks down or based on business needs itself, in the time of read-only materialized view sometime need to being returned to file system, often needs ROW read-only materialized view to carry out rolling back action.Wherein, the above-mentioned read-only materialized view sometime that returns to file system is target read-only materialized view; The rollback of read-only materialized view is target read-only materialized view is returned to file system.After rollback completes, the read-write data of above-mentioned FS are the data in above-mentioned target read-only materialized view.
Consult shown in Fig. 1, file system FS1 is at three (2:00 in the same time not, 4:00 and 6:00) to have created respectively read-only materialized view (be read-only materialized view one Snap1, read-only materialized view two Snap2 and read-only materialized view Three S's nap3), wherein, each read-only materialized view and file system all have the root (Snap Root) of himself.If the root of read-only materialized view one is Snap1Root, this Snap1Root is for pointing to the root of read-only materialized view one All Files, and the root of FS1 is FS1Root, and this FS1Root is for pointing to the root of All Files.And, each read-only materialized view all comprises metadata, and in the metadata of any one read-only materialized view, record this any one read-only materialized view upper one constantly read-only materialized view monopolize data message, as the data message of monopolizing of the metadata record read-only materialized view one of read-only materialized view two, and in file system, the data message of monopolizing of last establishment read-only materialized view is constantly recorded in the metadata of file system.
Consult shown in Fig. 2, if target read-only materialized view is read-only materialized view two, conventionally the root of FS1 is replaced with to the root of read-only materialized view two, because read-only materialized view two returns to after FS1, FS1 and read-only materialized view two are shared same root, for fear of the chaotic problem of the follow-up file system data causing when FS1 is carried out to operations, also need to delete read-only materialized view three.
As can be seen here, adopt technique scheme, although can realize quickly and easily file system recovery to any one read-only materialized view constantly, but after completing in read-only materialized view rollback, rear all read-only materialized views constantly that create of the establishment moment that target read-only materialized view is corresponding will be deleted, therefore, when above-mentioned read-only materialized view rolling back action is maloperation, or according to business demand, need to use above-mentioned while having deleted read-only materialized view, cannot recover above-mentioned and delete read-only materialized view, thereby cause the problem of system poor operability.
In sum, in read-only materialized view rollback process, exist read-only materialized view rollback cannot obtain part read-only materialized view data afterwards, affect the problem of system operability.
Summary of the invention
The embodiment of the present invention provides a kind of read-only materialized view rollback method and device, in order to solve at present in read-only materialized view rollback process, cannot obtain part read-only materialized view data after there is read-only materialized view rollback, affects the problem of system operability.
The concrete technical scheme that the embodiment of the present invention provides is as follows:
First aspect, provides a kind of read-only materialized view rollback method, comprising:
Receive read-only materialized view rollback indication;
Obtain the sign of the target read-only materialized view carrying in described read-only materialized view rollback indication, according to the sign of described target read-only materialized view, read root and the establishment moment corresponding to described target read-only materialized view of described target read-only materialized view, the root of file system is replaced with to the root of described target read-only materialized view, make described target read-only materialized view be rolled back to described file system; And
Retain afterwards all read-only materialized views constantly that create of the establishment moment that described target read-only materialized view is corresponding; And
The next one obtaining after establishment corresponding to described target read-only materialized view constantly creates the metadata of read-only materialized view constantly, in described metadata, obtain the monopolizing after data message of described target read-only materialized view, delete the data message of monopolizing of target read-only materialized view described in described metadata; Wherein, described read-only materialized view is the reflection of file system sometime.
In conjunction with first aspect, in the possible implementation of the first, the metadata of file reading system, and the establishment moment corresponding to the read-only materialized view being created for the last time in described file system; According to the metadata of described file system, if when detecting after establishment corresponding to the described read-only materialized view being created for the last time constantly described file system and having more new data, based on the default read-only materialized view of described renewal data creation; If when detecting after establishment corresponding to the described read-only materialized view being created for the last time constantly described file system and not having more new data, using the described read-only materialized view being created for the last time as default read-only materialized view.
In conjunction with the possible implementation of the first of first aspect, in the possible implementation of the second, the root of file system is replaced with to the root of described target read-only materialized view; And by the data information memory of described target read-only materialized view in the metadata of described file system, make described target read-only materialized view be rolled back to described file system.
In conjunction with the possible implementation of the second of first aspect, in the third possible implementation, make after described target read-only materialized view is rolled back to described file system, when receiving while deleting read-only materialized view indication, according to described deletion read-only materialized view indication, obtain the sign of read-only materialized view to be deleted; And whether according to the sign of described read-only materialized view to be deleted, detecting read-only materialized view to be deleted is default read-only materialized view; If so, travel through described read-only materialized view to be deleted, and delete the data of monopolizing of described read-only materialized view to be deleted; Otherwise, according to the next one in the establishment moment corresponding to described read-only materialized view to be deleted, create the metadata of read-only materialized view constantly, obtain the data of monopolizing of described read-only materialized view to be deleted, and the data of monopolizing of deleting described read-only materialized view to be deleted, and the data message of monopolizing of deleting read-only materialized view to be deleted described in the next metadata that creates read-only materialized view constantly after establishment corresponding to described read-only materialized view to be deleted constantly.
In conjunction with the possible implementation of the first of first aspect or the possible implementation of the second, in the 4th kind of possible implementation, after described target read-only materialized view is rolled back to described file system, when receiving the indication of upgrading the data in described file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of described file system, when there is newly-built read-only materialized view in detection after described target read-only materialized view is rolled back to described file system, according to new data more, obtain the data of monopolizing of described newly-built read-only materialized view, according to the data of monopolizing of described newly-built read-only materialized view, in the metadata of described file system, upgrade the data message of described newly-built read-only materialized view.
In conjunction with the 4th kind of possible implementation of first aspect, in the 5th kind of possible implementation, if after described newly-built read-only materialized view, while again creating new read-only materialized view, empty the snapshot object territory in the metadata of described file system.
In conjunction with the possible implementation of the first of first aspect or the possible implementation of the second, in the 6th kind of possible implementation, after described target read-only materialized view is rolled back to described file system, when receiving the indication of upgrading the data in described file system, when receiving the indication of upgrading the data in described file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of described file system, when there is not newly-built read-only materialized view in detection after described target read-only materialized view is rolled back to described file system, according to described more new data, determine the data of monopolizing of described target read-only materialized view, according to the data of monopolizing of described target read-only materialized view, in creating the metadata of read-only materialized view constantly, upgrades establishment corresponding to the described target read-only materialized view next one constantly the data message of described target read-only materialized view.
Second aspect, provides a kind of read-only materialized view rollback device, comprising:
Receiving element, for receiving read-only materialized view rollback indication, and is sent to acquiring unit by described read-only materialized view rollback indication;
Acquiring unit, the read-only materialized view rollback indication sending for receiving described receiving element, and obtain the sign of the target read-only materialized view carrying in described read-only materialized view rollback indication, according to the sign of described target read-only materialized view, read the root of described target read-only materialized view and establishment corresponding to described target read-only materialized view constantly; Wherein, described read-only materialized view is the reflection of file system sometime; And the root of described target read-only materialized view and establishment corresponding to described target read-only materialized view are sent to control module constantly, and establishment corresponding to described target read-only materialized view is sent to the first delete cells constantly;
Control module, for receiving root and the establishment moment corresponding to described target read-only materialized view of the described target read-only materialized view of described acquiring unit transmission, and the root of file system is replaced with to the root of described target read-only materialized view, make described target read-only materialized view be rolled back to described file system; And the read-only materialized views that retain afterwards all establishment moment in the establishment moment that described target read-only materialized view is corresponding;
The first delete cells, the establishment moment corresponding to described read-only materialized view sending for receiving described acquiring unit, and the next one obtaining after the establishment constantly that described target read-only materialized view is corresponding creates the metadata of read-only materialized view constantly; Obtain the data message of monopolizing of target read-only materialized view described in described metadata; Delete the data message of monopolizing of target read-only materialized view described in described metadata.
In conjunction with second aspect, in the possible implementation of the first, also comprise default read-only materialized view creating unit, for: the metadata of file reading system, and the establishment moment corresponding to the read-only materialized view being created for the last time in described file system; According to the metadata of described file system, if when detecting after establishment corresponding to the described read-only materialized view being created for the last time constantly described file system and having more new data, based on the default read-only materialized view of described renewal data creation; If when detecting after establishment corresponding to the described read-only materialized view being created for the last time constantly described file system and not having more new data, using the described read-only materialized view being created for the last time as default read-only materialized view.
In conjunction with the possible implementation of the first of second aspect, in the possible implementation of the second, described control module, specifically for: the root that the root of file system is replaced with to described target read-only materialized view; And by the data information memory of described target read-only materialized view in the metadata of described file system, make described target read-only materialized view be rolled back to described file system.
In conjunction with the possible implementation of the first of second aspect or the possible implementation of the second, in the third possible implementation, also comprise the second delete cells, be used for: when receiving the indication of deletion read-only materialized view, according to described deletion read-only materialized view indication, obtain the sign of read-only materialized view to be deleted; And whether according to the sign of described read-only materialized view to be deleted, detecting read-only materialized view to be deleted is default read-only materialized view; If so, travel through described read-only materialized view to be deleted, and delete the data of monopolizing of described read-only materialized view to be deleted; Otherwise, according to the next one in the establishment moment corresponding to described read-only materialized view to be deleted, create the metadata of read-only materialized view constantly, obtain the data of monopolizing of described read-only materialized view to be deleted, and the data of monopolizing of deleting described read-only materialized view to be deleted, and the data message of monopolizing of deleting read-only materialized view to be deleted described in the next metadata that creates read-only materialized view constantly after establishment corresponding to described read-only materialized view to be deleted constantly.
In conjunction with the possible implementation of the first of second aspect or the possible implementation of the second, in the 4th kind of possible implementation, also comprise the first updating block, be used for: when receiving the indication of the data of upgrading described file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of described file system, when there is newly-built read-only materialized view in detection after described target read-only materialized view is rolled back to described file system, according to new data more, obtain the data of monopolizing of described newly-built read-only materialized view; According to the data of monopolizing of described newly-built read-only materialized view, in the metadata of described file system, upgrade the data message of described newly-built read-only materialized view.
The 4th kind of possible implementation in conjunction with second aspect, in the 5th kind of possible implementation, also comprise and empty unit, for: if after described newly-built read-only materialized view, while again creating new read-only materialized view, empty the snapshot object territory in the metadata of described file system.
In conjunction with the possible implementation of the first of second aspect or the possible implementation of the second, in the 6th kind of possible implementation, also comprise the second updating block, be used for: after described target read-only materialized view is rolled back to described file system, when receiving the indication of upgrading the data in described file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of described file system, when there is not newly-built read-only materialized view in detection after described target read-only materialized view is rolled back to described file system, according to described more new data, determine the data of monopolizing of described target read-only materialized view, according to the data of monopolizing of described target read-only materialized view, in creating the metadata of read-only materialized view constantly, upgrades establishment corresponding to the described target read-only materialized view next one constantly the data message of described target read-only materialized view.
In the embodiment of the present invention, after receiving read-only materialized view rollback indication, the sign of the target read-only materialized view carrying based on this read-only materialized view rollback indication is obtained the root of target read-only materialized view, the root of file system is replaced with to the root of target read-only materialized view, make target read-only materialized view be rolled back to file system, and retain all read-only materialized views constantly that create after the establishment constantly that target read-only materialized view is corresponding, and delete the data message of monopolizing that the next one after target read-only materialized view creates target read-only materialized view in the metadata of read-only materialized view constantly.Adopt technical solution of the present invention, according to user, indicate after realize target read-only materialized view is rolled back to file system, retain afterwards all read-only materialized views constantly that create of the establishment moment that target read-only materialized view is corresponding, effectively prevent that the data that user's maloperation causes from cannot recover, and after read-only materialized view rollback, user can obtain rapidly needed read-only materialized view, thereby has effectively improved the operability of system.
Accompanying drawing explanation
Fig. 1 is read-only materialized view schematic diagram in file system in prior art;
Fig. 2 is read-only materialized view rollback schematic diagram in prior art;
Fig. 3 is system architecture schematic diagram in the embodiment of the present invention;
Fig. 4 is read-only materialized view rollback process flow diagram in the embodiment of the present invention;
Fig. 5 is file system architecture schematic diagram one in the embodiment of the present invention;
Fig. 6 is file system architecture schematic diagram two in the embodiment of the present invention;
Fig. 7 is file system architecture schematic diagram three in the embodiment of the present invention;
Fig. 8 is file system architecture schematic diagram four in the embodiment of the present invention;
Fig. 9 is file system architecture schematic diagram five in the embodiment of the present invention;
Figure 10 is read-only materialized view rollback schematic diagram one in the embodiment of the present invention;
Figure 11 is read-only materialized view rollback schematic diagram two in the embodiment of the present invention;
Figure 12 is read-only materialized view rollback schematic diagram three in the embodiment of the present invention;
Figure 13 is read-only materialized view rollback process flow diagram under concrete application scenarios in the embodiment of the present invention;
Figure 14 is information interaction schematic diagram in read-only materialized view rollback process under concrete application scenarios in the embodiment of the present invention;
Figure 15 be in the embodiment of the present invention under concrete application scenarios read-only materialized view delete process flow diagram;
Figure 16 is information interaction schematic diagram in read-only materialized view delete procedure under concrete application scenarios in the embodiment of the present invention;
Figure 17 be in the embodiment of the present invention under concrete application scenarios file system data upgrade process flow diagram;
Figure 18 is information interaction schematic diagram in file system data renewal process under concrete application scenarios in the embodiment of the present invention;
Figure 19 is read-only materialized view rollback apparatus structure schematic diagram in the embodiment of the present invention;
Figure 20 is read-only materialized view rollback device structure schematic diagram in the embodiment of the present invention.
Embodiment
In order to solve at present in read-only materialized view rollback process, there is the problem of system poor operability.In the embodiment of the present invention, after receiving read-only materialized view rollback indication, the sign of the target read-only materialized view carrying based on this read-only materialized view rollback indication is obtained the root of target read-only materialized view, the root of file system is replaced with to the root of target read-only materialized view, make target read-only materialized view be rolled back to file system, and retain all read-only materialized views constantly that create after the establishment constantly that target read-only materialized view is corresponding, and delete the data message of monopolizing that the next one after target read-only materialized view creates target read-only materialized view in the metadata of read-only materialized view constantly.Adopt technical solution of the present invention, according to user, indicate after realize target read-only materialized view is rolled back to file system, retain afterwards all read-only materialized views constantly that create of the establishment moment that target read-only materialized view is corresponding, effectively prevent that the data that user's maloperation causes from cannot recover, and after read-only materialized view rollback, user can obtain rapidly needed read-only materialized view, thereby has effectively improved the operability of system.
Consult and Figure 3 shows that file system architecture schematic diagram in the embodiment of the present invention, this document system applies is in NAS application, and it comprises client, ISM(Integrated Software Management; Integrated software management device), and storage server, wherein, client sends indication by TCP/IP network to storage server, carry out the I/O operation (comprising file reading operation) for read-only materialized view, the indication that storage server sends according to above-mentioned client, carries out operation accordingly; ISM sends indication by TCP/IP network to storage server, carries out configuration operation for read-only materialized view (comprising the operations such as establishment, deletion, rollback of read-only materialized view), and the indication that storage server sends according to above-mentioned ISM, carries out operation accordingly.
Based on above-mentioned file system framework, to consult shown in Fig. 4, in the embodiment of the present invention, the detailed process of read-only materialized view rollback is:
Step 400: receive read-only materialized view rollback indication.
In the embodiment of the present invention, the data and the metadata that in any one read-only materialized view constantly, comprise All Files in this any one file system constantly, wherein, the data message of monopolizing that comprises the upper moment read-only materialized view before of above-mentioned any one moment in this metadata.For example, consult shown in Fig. 1, in the metadata of read-only materialized view two, comprise the data message of monopolizing of read-only materialized view one, in the metadata of read-only materialized view three, comprise the data message of monopolizing of read-only materialized view two.In addition, in file system, all data exist with the form of data block, and each data block is corresponding logical time separately all, and the monopolizing of above-mentioned read-only materialized view record in data message that in this read-only materialized view, each monopolizes logical time corresponding to data block and other relevant informations.
Step 410: the sign of obtaining the target read-only materialized view carrying in read-only materialized view rollback indication, according to the sign of this target read-only materialized view, read root and the establishment moment corresponding to target read-only materialized view of target read-only materialized view, the root of file system is replaced with to the root of target read-only materialized view, make target read-only materialized view be rolled back to file system, and retain all read-only materialized views constantly that create after establishment corresponding to target read-only materialized view constantly, and the next one obtaining after the establishment constantly that target read-only materialized view is corresponding creates the metadata of read-only materialized view constantly, in above-mentioned metadata, obtain the monopolizing after data message of target read-only materialized view, delete the data message of monopolizing of target read-only materialized view in above-mentioned metadata.
In the embodiment of the present invention, when storage server receives after the read-only materialized view rollback indication of ISM transmission, obtain the sign of target read-only materialized view, and the root that obtains target read-only materialized view according to the sign of target read-only materialized view, and the root of file system is replaced with to the root of target read-only materialized view; And by the data information memory of target read-only materialized view to the metadata of file system, thereby make target read-only materialized view be rolled back to file system, and retain all read-only materialized views constantly that create after the establishment constantly that target read-only materialized view is corresponding.
In said process, the root of file system is a disk address, by this disk address, can have access to all catalogues and the file data of file system; The catalogue of this document system, file are all conceptualized as Objects(object one by one), the object set of all Object composing document systems.Generally, above-mentioned object set is with the form tissue of tree, an Objset Root(tree root of this tree existence) address, by this Objset Root, can have access to all objects of file system, therefore, the root of file system is again ObjsetRoot.Because read-only materialized view is the reflection of file system sometime, therefore, the root of read-only materialized view is similarly a disk address, by this disk address, can have access to all catalogues and the file data of read-only materialized view; The catalogue of this read-only materialized view, file are all conceptualized as Objects(object one by one), all Object form the object set of read-only materialized view.Generally, above-mentioned object set is with the form tissue of tree, an Objset Root(tree root of this tree existence) address, by this Objset Root, can have access to all objects of read-only materialized view, therefore, the root of read-only materialized view is again Objset Root.For example, consult the file system configuration diagram shown in Fig. 5, BP(BlockPointer; Block pointer) be the root (FS Root) of file system, this BP points to the address of single data piece.When the single data piece in above-mentioned file system is resolved, can be indexed to all catalogues and the file of this document system downwards.Accordingly, consult in the file system configuration diagram shown in Fig. 6, A, B, C and D all represent the file data blocks of file system, and in file system, All Files data block can be resolved and obtain downwards by single data piece.Consult shown in Fig. 7, after file system is created to read-only materialized view, the root of read-only materialized view points to the single data piece of file system, and read-only materialized view and file system are shared root.
Consult shown in Fig. 8, revised after data block A in file system, the root of file system points to the new single data piece producing, thereby has occurred that root is separated, and file system and read-only materialized view are still shared unmodified partial data piece.While realizing read-only materialized view rollback in file system, consult shown in Fig. 9, conventionally the root of file system is pointed to the root of target read-only materialized view, and target read-only materialized view returns to after file system, delete all establishment moment read-only materialized views after target read-only materialized view.
Further, after target read-only materialized view is rolled back to file system, because the data in target read-only materialized view are the shared data with file system, therefore, after target read-only materialized view is rolled back to file system, what the next one after establishment corresponding to target read-only materialized view constantly created the target read-only materialized view that records in the metadata of read-only materialized view constantly monopolizes data that data message is corresponding by the data of monopolizing that are no longer target read-only materialized view.Now, in target read-only materialized view, the state of data changes in the time of causing deleting this target read-only materialized view, can not create according to the next one after establishment constantly corresponding to target read-only materialized view the metadata of read-only materialized view constantly and delete target read-only materialized view.
Based on this technical matters, in the embodiment of the present invention, after target read-only materialized view is rolled back to file system, need to delete the data message of monopolizing that the next one after establishment corresponding to target read-only materialized view constantly creates target read-only materialized view in the metadata of read-only materialized view constantly, be specially: after target read-only materialized view is rolled back to file system, the next one obtaining after establishment corresponding to target read-only materialized view constantly creates the metadata of read-only materialized view constantly; Obtain the data message of target read-only materialized view in above-mentioned metadata, and from the data message of target read-only materialized view, determine the data message of monopolizing of target read-only materialized view; Delete the data message of monopolizing of target read-only materialized view in above-mentioned metadata.For example, consult shown in Figure 10, if target read-only materialized view is read-only materialized view two, when read-only materialized view two is rolled back to file system, data in read-only materialized view two are the shared data of file system, now, the next one that need to obtain the moment of read-only materialized view two correspondences creates the metadata of read-only materialized view (being read-only materialized view three) constantly, and deletes the data message of monopolizing of read-only materialized view two in the metadata of read-only materialized view three.Adopt technique scheme, after retaining the read-only materialized view in afterwards all establishment moment in the establishment moment that target read-only materialized view is corresponding, delete the next one after the establishment constantly that target read-only materialized view is corresponding and create the data of monopolizing of target read-only materialized view in the metadata of read-only materialized view constantly, thereby avoided file system and the inconsistent problem of read-only materialized view data message, guaranteed the follow-up stability of file system when file system is carried out to associative operation.
In addition, in file system, while carrying out Data Update after file system is created to read-only materialized view, need to be according to upgrading corresponding data in Data Update file system, and this legacy data that more new data is corresponding is the data of monopolizing of read-only materialized view protection, this is monopolized the data message of monopolizing corresponding to data and is stored in the metadata of file system, and the metadata of this document system can be snapshotted in the read-only materialized view new to this when creating new read-only materialized view; Wherein, when above-mentioned more new data is the indication that receives the data in updating file system, the data after the renewal of carrying in this indication, and this more new data be to create with respect to target read-only materialized view the Data Update that data are constantly carried out.As can be seen here, adopt technique scheme, if after last establishment read-only materialized view constantly also there is Data Update in this document system in file system, after read-only materialized view rolling back action is finished, above-mentioned more new data is by deleted, in the time need to using above-mentioned more new data according to business demand, cannot obtain.For example, consult shown in Figure 11, read-only materialized view three is that in file system, last creates read-only materialized view constantly, after creating read-only materialized view three, if when file system exists more new data, more new data will be deleted after read-only materialized view two is rolled back to file system for this.
Based on above-mentioned technical matters, in the embodiment of the present invention, when storage server receives after the read-only materialized view rollback indication of ISM transmission, i.e. the establishment moment that the metadata of file reading system, and the last read-only materialized view creating is corresponding; Because new data more can be recorded in the metadata of file system, therefore, according to the metadata of this document system, after can detecting the establishment constantly that the read-only materialized view of above-mentioned last establishment is corresponding, whether file system there is more new data, when file system exists more new data after the establishment constantly that the read-only materialized view of above-mentioned last establishment is corresponding being detected, based on this, upgrade the default read-only materialized view of data creation.In addition, if when after establishment corresponding to the read-only materialized view of above-mentioned last establishment constantly there is not more new data in file system, using the read-only materialized view of above-mentioned last establishment as default read-only materialized view.
Optionally, above-mentioned default read-only materialized view is user's visible state.For example, consult shown in Figure 12, when the last read-only materialized view (being read-only materialized view three) creating being detected in file system and have afterwards more new data, in file system, based on upgrading data creation, preset read-only materialized view (being read-only materialized view four), this default read-only materialized view is distinguished by the special marking and other the common read-only materialized views that comprise in default read-only materialized view, as comprised identifier isSpecialSnap=TRUE in the sign at read-only materialized view four, and in the sign of other common read-only materialized views, comprise identifier isSpecialSnap for empty or be other values of the non-TRUE such as FAULT.
Adopt technique scheme; before carrying out read-only materialized view rollback; if while there is more new data after the last read-only materialized view creating in file system; according to upgrading the default read-only materialized view of data creation; after target read-only materialized view is rolled back to file system; user still can obtain more new data by access preset read-only materialized view, thereby has effectively protected the read-only materialized view data in file system.
Owing to the root of file system being replaced with to the root of target read-only materialized view, after establishment corresponding to target read-only materialized view constantly, last creates data in read-only materialized view constantly last creates the data of monopolizing of read-only materialized view constantly by changing into this with the shared data of file system before read-only materialized view rollback, and this data message of monopolizing data is not recorded in file system.For example, consult shown in Figure 12, if read-only materialized view four is last establishment read-only materialized view constantly, before read-only materialized view rollback, data in read-only materialized view four are changed into the data of monopolizing of read-only materialized view four by the shared data of file system, and, the data message of monopolizing data of read-only materialized view four is not recorded in the metadata of file system, therefore, when receiving user, indicate while deleting read-only materialized view four, if while deleting read-only materialized view four according to traditional approach, the variation of the information state of read-only materialized view will cause this deletion action to occur mistake.
Based on above-mentioned technical matters, after target read-only materialized view is rolled back to file system, when storage server receives the indication of deletion read-only materialized view, according to this, delete read-only materialized view indication, obtain the sign of read-only materialized view to be deleted; And whether according to the sign of this read-only materialized view to be deleted, detecting read-only materialized view to be deleted is default read-only materialized view; If this read-only materialized view, for default read-only materialized view, travels through this default read-only materialized view, and delete the data of monopolizing that record in default read-only materialized view, wherein, delete read-only materialized view and be the data of monopolizing of deleting this read-only materialized view.Adopt technique scheme, by traveling through the mode of default read-only materialized view, delete default read-only materialized view, avoided because wrong problem appears in the default read-only materialized view of imperfect the caused deletion of the metadata of default read-only materialized view.
Optionally, according to the sign of this read-only materialized view to be deleted, whether be the process of presetting read-only materialized view be: detect the sign of read-only materialized view to be deleted, if when the sign of read-only materialized view to be deleted comprises special marking, this read-only materialized view to be deleted is default read-only materialized view if detecting read-only materialized view to be deleted; Otherwise this read-only materialized view to be deleted is common read-only materialized view.For example, consult shown in Figure 12, when if read-only materialized view to be deleted is read-only materialized view four, storage server detects the sign of read-only materialized view four, because the sign of read-only materialized view four comprises identifier isSpecialSnap=TRUE, therefore, judge that read-only materialized view four is as default read-only materialized view, should delete read-only materialized view four according to the mode of the default read-only materialized view of above-mentioned traversal.
Further, when read-only materialized view to be deleted is not default read-only materialized view, according to the next one in the establishment moment corresponding to read-only materialized view to be deleted, create the metadata of read-only materialized view constantly, obtain the data of monopolizing of read-only materialized view to be deleted, delete the data of monopolizing of this read-only materialized view to be deleted, and delete the data message of monopolizing that the next one after establishment corresponding to this read-only materialized view to be deleted constantly creates read-only materialized view to be deleted in the metadata of read-only materialized view constantly, thereby reach the object of deleting read-only materialized view to be deleted.
In addition, when target read-only materialized view is rolled back to file system, in the metadata of file system, create snapshot object territory, the sign of record object read-only materialized view in this snapshot object territory.For example, consult shown in Figure 12, target read-only materialized view is read-only materialized view two, creates snapshot object territory in the metadata of file system, in this snapshot object territory, records rollSnap=Snap2, the sign of record object read-only materialized view.In file system original state, this snapshot object territory is initialized to sky.Optionally, after the newly-built read-only materialized view of file system, again during newly-built read-only materialized view, above-mentioned snapshot object territory is emptied, until read-only materialized view rolling back action next time.For example, consult shown in Figure 12, because target read-only materialized view is read-only materialized view two, therefore, above-mentioned snapshot object records rollSnap=Snap2 in territory, when the newly-built read-only materialized view of file system is read-only materialized view five, if while creating read-only materialized view six after read-only materialized view five, empty the snapshot object territory of metadata in above-mentioned file system.
Said process is the operating process that storage server is deleted read-only materialized view, after target read-only materialized view is rolled back to file system, when receiving user and indicate the data in updating file system, according to whether there is newly-built read-only materialized view after target read-only materialized view is rolled back to file system, the process of storage server updating file system is divided into two kinds of situations:
The first situation, after target read-only materialized view is rolled back to file system, according to the sign of the target read-only materialized view of snapshot object territory record in the metadata of above-mentioned file system, when there is newly-built read-only materialized view in detection after target read-only materialized view is rolled back to file system, according to new data more, newly-built read-only materialized view monopolized to data information memory to the metadata of file system.Optionally, by data information memory to the process in the metadata of file system of monopolizing of newly-built read-only materialized view, be: the data of monopolizing of obtaining this newly-built read-only materialized view, and according to the data of monopolizing of this newly-built read-only materialized view, in the metadata of file system, upgrade the data message of above-mentioned newly-built read-only materialized view.
In said process; existence due to newly-built read-only materialized view; now; the Data Update that file system is carried out is the Data Update of carrying out with respect to the data of this newly-built read-only materialized view; be that data block A is updated to data block B; now; if the logical time of data block A early than or equal the logical time of newly-built read-only materialized view; this data block A is the data of monopolizing of being protected by newly-built read-only materialized view; this data block A belongs to above-mentioned newly-built read-only materialized view; therefore, the data message of monopolizing of above-mentioned data block A will be stored in the metadata of current time file system.
For example, consult shown in Figure 12, after read-only materialized view two is rolled back to file system, to the newly-built read-only materialized view of file system (as newly-built read-only materialized view five) afterwards, if when receiving user and indicating data corresponding to updating file system, the read-only materialized view five producing in file system is carried out to data updating process monopolize data using as the follow-up reference that again creates new read-only materialized view (as read-only materialized view six), therefore, the data message of monopolizing of read-only materialized view five will be stored in the metadata of file system.
Adopt technique scheme, after target read-only materialized view is rolled back to file system, when there is newly-built read-only materialized view in file system, the renewal of directly recording newly-built read-only materialized view by the metadata of revised file system, avoided due to do not delete after establishment corresponding to target read-only materialized view constantly all create that read-only materialized view constantly causes file system is carried out to associative operation time the chaotic problem of file system data that causes, improved the stability of system.
The second situation: after target read-only materialized view is rolled back to file system, when receiving user and indicate the data in updating file system, according to the target read-only materialized view sign of the snapshot object territory record creating in the metadata of file system, when there is not newly-built read-only materialized view in detection after target read-only materialized view is rolled back to file system, according to new data more, determine the data of monopolizing of target read-only materialized view, and according to the data of monopolizing of target read-only materialized view, at establishment corresponding to the target read-only materialized view next one constantly, create in the metadata of read-only materialized view constantly the more data message of fresh target read-only materialized view, be about to after Data Update, data information memory to establishment corresponding to this target read-only materialized view next one constantly of monopolizing of target read-only materialized view creates in the metadata of read-only materialized view constantly.
In said process, the Data Update that file system is carried out, to create with respect to target read-only materialized view the Data Update that data are constantly carried out, be that data block A is updated to data block B, this data block A is the data of monopolizing of being protected by target read-only materialized view, this data block A only belongs to target read-only materialized view, and does not belong to the read-only materialized view of the up-to-date time point of file system current time; Therefore, the data message of monopolizing of above-mentioned data block A creates the next one after being stored to the establishment constantly that target read-only materialized view is corresponding in the metadata of moment read-only materialized view, and is not stored in the metadata of current time file system.
For example, consult shown in Figure 12, after read-only materialized view two is rolled back to file system, before the newly-built read-only materialized view to file system, if when receiving user and indicating data corresponding to updating file system, the read-only materialized view two producing in file system is carried out to data updating process monopolize data message using the reference as follow-up deletion target read-only materialized view two, the data message of monopolizing of this read-only materialized view two will be stored in the metadata of read-only materialized view three.
Adopt technique scheme, after target read-only materialized view is rolled back to file system, when not there is not newly-built read-only materialized view in file system, only by the next metadata that creates moment target read-only materialized view after establishment constantly corresponding to modifying target read-only materialized view, carry out the renewal of record object read-only materialized view, avoided due to do not delete after establishment corresponding to target read-only materialized view constantly all create that read-only materialized view constantly causes file system is carried out to associative operation time the chaotic problem of file system data that causes, improved the stability of system.
Based on technique scheme, below in conjunction with different application scenarios message, introduce read-only materialized view rollback process.
Application scenarios one
Consult shown in Figure 13, the flow process that storage server is realized read-only materialized view rollback is:
Step 1300: when storage server receives read-only materialized view rollback indication, obtain root and the establishment moment corresponding to target read-only materialized view of target read-only materialized view according to this read-only materialized view rollback indication.
In the embodiment of the present invention, receiving read-only materialized view rollback indication can realize by the controller in storage server.
Step 1310: storage server detects in file system, whether last exists Data Update after creating read-only materialized view constantly, if so, performs step 1320; Otherwise, execution step 1330.
In the embodiment of the present invention, above-mentioned testing process can realize by the snapshot module in storage server.
Step 1320: after above-mentioned last establishment read-only materialized view constantly, based on upgrading the default read-only materialized view of data creation.
In the embodiment of the present invention, the default read-only materialized view process of above-mentioned establishment can realize by the snapshot module in storage server.
Step 1330: the root that the root of file system is replaced with to target read-only materialized view, delete the target read-only materialized view that the next one after the establishment constantly that target read-only materialized view is corresponding creates in the metadata of read-only materialized view constantly and monopolize data message, and retain all read-only materialized views constantly that create after the establishment constantly that target read-only materialized view is corresponding.
In the embodiment of the present invention, after the root of file system being replaced with to the root of target read-only materialized view, by the metadata of the data information memory value file system of target read-only materialized view.In the embodiment of the present invention, above-mentioned delete procedure can be realized by the snapshot module in storage server.
Consult and Figure 14 shows that in the embodiment of the present invention, information interaction schematic diagram in read-only materialized view rollback process, wherein, ISM sends read-only materialized view rollback indication to storage server, storage server is carried out read-only materialized view rolling back action, after target read-only materialized view is rolled back to file system, return to rollback successful information to ISM.
Application scenarios two
Consult shown in Figure 15, the flow process that storage server is carried out read-only materialized view deletion indication is:
Step 1500: when storage server receives read-only materialized view deletion indication, obtain the sign that this read-only materialized view is deleted the read-only materialized view to be deleted carrying in indication.
In the embodiment of the present invention, above-mentioned reception read-only materialized view deletion is rolled indication and can be realized by the controller in storage server.
Step 1510: storage server, according to the sign of read-only materialized view to be deleted, judges that above-mentioned read-only materialized view to be deleted, whether as default read-only materialized view, if so, performs step 1520; Otherwise, execution step 1530.
In the embodiment of the present invention, above-mentioned decision process can the snapshot module in storage server realize.
Step 1520: travel through this default read-only materialized view, and delete the data of monopolizing that record in default read-only materialized view.
In the embodiment of the present invention, above-mentioned delete procedure can the snapshot module in storage server be realized.
Step 1530: create the metadata of read-only materialized view constantly according to the next one in the establishment moment corresponding to read-only materialized view to be deleted, obtain the data of monopolizing of read-only materialized view to be deleted, the data of monopolizing of deleting this read-only materialized view to be deleted.
In the embodiment of the present invention, above-mentioned delete procedure can the snapshot module in storage server be realized.
Consult and Figure 16 shows that in the embodiment of the present invention, information interaction schematic diagram in read-only materialized view delete procedure, wherein, ISM sends read-only materialized view rollback to storage server and deletes indication, storage server is carried out read-only materialized view deletion action, after target read-only materialized view is rolled back to file system, returns and delete successful information to ISM.
Application scenarios three
Consult shown in Figure 17, after read-only materialized view rollback, the flow process that storage server execute file system data upgrades is:
Step 1700: when user indicates the data in updating file system, obtain the sign that this read-only materialized view is deleted the read-only materialized view to be deleted carrying in indication.
In the embodiment of the present invention, the data indication in above-mentioned reception updating file system can protocol adaptation layers and Virtual File System in storage server realize.
Step 1710: storage server is according to the sign of read-only materialized view to be deleted, after being rolled back to file system according to the label detection target read-only materialized view of the target read-only materialized view of snapshot object territory record in the metadata of above-mentioned file system, whether there is newly-built read-only materialized view, if so, perform step 1720; Otherwise, execution step 1730.
In the embodiment of the present invention, above-mentioned testing process can the snapshot module in storage server realize.
Step 1720: according to new data more, obtain the data of monopolizing of this newly-built read-only materialized view, and according to the data of monopolizing of this newly-built read-only materialized view, upgrade the data message of above-mentioned newly-built read-only materialized view in the metadata of file system.
In the embodiment of the present invention, above-mentioned renewal process can the snapshot module in storage server realize.
Wherein, the data message of the newly-built read-only materialized view in the metadata of updating file system, is newly-built read-only materialized view is monopolized to data information memory to the metadata of file system.
Step 1730: according to new data more, determine the data of monopolizing of target read-only materialized view, and according to the data of monopolizing of target read-only materialized view, at establishment corresponding to the target read-only materialized view next one constantly, create in the metadata of read-only materialized view constantly the more data message of fresh target read-only materialized view.
In the embodiment of the present invention, above-mentioned renewal process can the snapshot module in storage server realize.
Consult and Figure 18 shows that in the embodiment of the present invention, file system is carried out information interaction schematic diagram in data updating process, and wherein, client sends more new data to storage server, after the Data Update operation of storage server execute file system, return data is updated successfully information to client.
Based on technique scheme, consult shown in Figure 19, the present invention also provides a kind of read-only materialized view rollback device, comprises receiving element 190, acquiring unit 191, control module 192, the first delete cellses 193, wherein:
Receiving element 190, for receiving read-only materialized view rollback indication, and is sent to acquiring unit 191 by above-mentioned read-only materialized view rollback indication;
Acquiring unit 191, the read-only materialized view rollback indication sending for receiving above-mentioned receiving element 190, and according to above-mentioned read-only materialized view rollback indication, obtain root and the establishment moment corresponding to target read-only materialized view of target read-only materialized view; And the root of target read-only materialized view and establishment corresponding to target read-only materialized view are sent to control module 192 constantly, and establishment corresponding to target read-only materialized view is sent to the first delete cells 193 constantly;
Control module 192, for receiving root and the establishment moment corresponding to target read-only materialized view of the target read-only materialized view of above-mentioned acquiring unit 191 transmissions, according to the sign of target read-only materialized view, read root and the establishment moment corresponding to target read-only materialized view of target read-only materialized view, the root of file system is replaced with to the root of target read-only materialized view, make target read-only materialized view be rolled back to above-mentioned file system; And retain all read-only materialized views constantly that create after establishment corresponding to target read-only materialized view constantly;
The first delete cells 193, the establishment moment corresponding to target read-only materialized view sending for receiving acquiring unit 191, and the next one obtaining after the establishment constantly that target read-only materialized view is corresponding creates the metadata of read-only materialized view constantly, in above-mentioned metadata, obtain the monopolizing after data message of target read-only materialized view, delete the data message of monopolizing of target read-only materialized view in above-mentioned metadata; Wherein, above-mentioned read-only materialized view is the reflection of file system sometime.
Wherein, said apparatus also comprises default read-only materialized view creating unit 194, for: the metadata of file reading system, and the establishment moment corresponding to the read-only materialized view being created for the last time in above-mentioned file system; According to the metadata of above-mentioned file system, if when detecting after establishment corresponding to the above-mentioned read-only materialized view being created for the last time constantly above-mentioned file system and having more new data, based on the default read-only materialized view of above-mentioned renewal data creation; If when detecting after establishment corresponding to the above-mentioned read-only materialized view being created for the last time constantly above-mentioned file system and not having more new data, using the above-mentioned read-only materialized view being created for the last time as default read-only materialized view.
Further, said apparatus also comprises the second delete cells 195, for: when receiving the indication of deletion read-only materialized view, according to above-mentioned deletion read-only materialized view indication, obtain the sign of read-only materialized view to be deleted; And whether according to the sign of above-mentioned read-only materialized view to be deleted, detecting read-only materialized view to be deleted is default read-only materialized view; If so, travel through above-mentioned read-only materialized view to be deleted, and delete the data of monopolizing of above-mentioned read-only materialized view to be deleted; Otherwise, according to the next one in the establishment moment corresponding to above-mentioned read-only materialized view to be deleted, create the metadata of read-only materialized view constantly, obtain the data of monopolizing of above-mentioned read-only materialized view to be deleted, and the data of monopolizing of deleting above-mentioned read-only materialized view to be deleted, and the data message of monopolizing of deleting after establishment corresponding to above-mentioned read-only materialized view to be deleted constantly above-mentioned read-only materialized view to be deleted in the next metadata that creates read-only materialized view constantly.
Further, said apparatus also comprises the first updating block 196, be used for: when receiving the indication of the data of upgrading above-mentioned file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of above-mentioned file system, when there is newly-built read-only materialized view in detection after target read-only materialized view is rolled back to above-mentioned file system, according to new data more, obtain the data of monopolizing of above-mentioned newly-built read-only materialized view; According to the data of monopolizing of above-mentioned newly-built read-only materialized view, in the metadata of above-mentioned file system, upgrade the data message of above-mentioned newly-built read-only materialized view.
Further, said apparatus also comprises and empties unit 197, for: if after above-mentioned newly-built read-only materialized view, while again creating new read-only materialized view, empty the snapshot object territory in the metadata of above-mentioned file system.
Further, said apparatus also comprises the second updating block 198, be used for: after target read-only materialized view is rolled back to above-mentioned file system, when receiving the indication of upgrading the data in above-mentioned file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of above-mentioned file system, when there is not newly-built read-only materialized view in detection after target read-only materialized view is rolled back to above-mentioned file system, according to above-mentioned more new data, determine the data of monopolizing of target read-only materialized view; According to the data of monopolizing of target read-only materialized view, at establishment corresponding to the target read-only materialized view next one constantly, create in the metadata of read-only materialized view constantly the more data message of fresh target read-only materialized view.
Based on technique scheme, consult shown in Figure 20, the invention provides a kind of read-only materialized view rollback equipment, comprise transceiver 200, processor 201, wherein:
Transceiver 200, for receiving read-only materialized view rollback indication, read-only materialized view upgrades indication, and this read-only materialized view rollback indication is sent to processor 201;
Processor 201, be used for: receive the read-only materialized view rollback indication that transceiver 200 sends, and obtain the sign of the target read-only materialized view carrying in described read-only materialized view rollback indication, according to the sign of described target read-only materialized view, read the root of described target read-only materialized view and establishment corresponding to described target read-only materialized view constantly; Wherein, described read-only materialized view is the reflection of file system sometime; The root of file system is replaced with to the root of described target read-only materialized view, make described target read-only materialized view be rolled back to described file system; And the read-only materialized views that retain afterwards all establishment moment in the establishment moment that described target read-only materialized view is corresponding; The next one obtaining after establishment corresponding to described target read-only materialized view constantly creates the metadata of read-only materialized view constantly; Obtain the data message of monopolizing of target read-only materialized view described in described metadata; Delete the data message of monopolizing of target read-only materialized view described in described metadata.
Further, processor 201, also for the metadata of file reading system, and establishment corresponding to the read-only materialized view that is created for the last time in described file system is constantly; According to the metadata of described file system, if when detecting after establishment corresponding to the described read-only materialized view being created for the last time constantly described file system and having more new data, based on the default read-only materialized view of described renewal data creation; If when detecting after establishment corresponding to the described read-only materialized view being created for the last time constantly described file system and not having more new data, using the described read-only materialized view being created for the last time as default read-only materialized view.
Optionally, processor 201, specifically for: the root that the root of file system is replaced with to described target read-only materialized view; And by the data information memory of described target read-only materialized view in the metadata of described file system, make described target read-only materialized view be rolled back to described file system.
Further, transceiver 200, also for: receive read-only materialized view and delete indication, and this read-only materialized view is deleted to indication be sent to processor 201;
Further, processor 201, also for: receive the read-only materialized view that transceiver 200 sends and delete indication, according to described deletion read-only materialized view indication, obtain the sign of read-only materialized view to be deleted; And whether according to the sign of described read-only materialized view to be deleted, detecting read-only materialized view to be deleted is default read-only materialized view; If so, travel through described read-only materialized view to be deleted, and delete the data of monopolizing of described read-only materialized view to be deleted; Otherwise, according to the next one in the establishment moment corresponding to described read-only materialized view to be deleted, create the metadata of read-only materialized view constantly, obtain the data of monopolizing of described read-only materialized view to be deleted, and the data of monopolizing of deleting described read-only materialized view to be deleted, and the data message of monopolizing of deleting read-only materialized view to be deleted described in the next metadata that creates read-only materialized view constantly after establishment corresponding to described read-only materialized view to be deleted constantly.
Further, transceiver 200, also for: receive to upgrade the indication of the data of described file system, and the indication of upgrading the data in described file system be sent to processor 201;
Further, processor 201, also for: receive the indication of the data of the described file system of renewal that transceiver 200 sends, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of described file system, when there is newly-built read-only materialized view in detection after described target read-only materialized view is rolled back to described file system, according to new data more, obtain the data of monopolizing of described newly-built read-only materialized view; According to the data of monopolizing of described newly-built read-only materialized view, in the metadata of described file system, upgrade the data message of described newly-built read-only materialized view.
Further, processor 201, also for: if after described newly-built read-only materialized view, while again creating new read-only materialized view, empty the snapshot object territory in the metadata of described file system.
Further, processor 201, also for: after described target read-only materialized view is rolled back to described file system, when receiving the indication of upgrading the data in described file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of described file system, when detection does not exist newly-built read-only materialized view after described target read-only materialized view is rolled back to described file system, according to described more new data, determine the data of monopolizing of described target read-only materialized view; According to the data of monopolizing of described target read-only materialized view, in creating the metadata of read-only materialized view constantly, upgrades establishment corresponding to the described target read-only materialized view next one constantly the data message of described target read-only materialized view.
In sum, in the embodiment of the present invention, after receiving read-only materialized view rollback indication, obtain the sign of the target read-only materialized view carrying in read-only materialized view rollback indication, according to the sign of this target read-only materialized view, read root and the establishment moment corresponding to target read-only materialized view of target read-only materialized view, the root of file system is replaced with to the root of target read-only materialized view, make target read-only materialized view be rolled back to file system, and retain all read-only materialized views constantly that create after establishment corresponding to target read-only materialized view constantly, and the next one obtaining after the establishment constantly that target read-only materialized view is corresponding creates the metadata of read-only materialized view constantly, in above-mentioned metadata, obtain the monopolizing after data message of target read-only materialized view, delete the data message of monopolizing of target read-only materialized view in above-mentioned metadata.Adopt technical solution of the present invention, according to user, indicate after realize target read-only materialized view is rolled back to file system, retain afterwards all read-only materialized views constantly that create of the establishment moment that target read-only materialized view is corresponding, effectively prevent that the data that user's maloperation causes from cannot recover, and after read-only materialized view rollback, user can obtain rapidly needed read-only materialized view, thereby has effectively improved the operability of system.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt complete hardware implementation example, implement software example or in conjunction with the form of the embodiment of software and hardware aspect completely.And the present invention can adopt the form that wherein includes the upper computer program of implementing of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code one or more.
The present invention is with reference to describing according to process flow diagram and/or the block scheme of the method for the embodiment of the present invention, equipment (system) and computer program.Should understand can be in computer program instructions realization flow figure and/or block scheme each flow process and/or the flow process in square frame and process flow diagram and/or block scheme and/or the combination of square frame.Can provide these computer program instructions to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, the instruction of carrying out by the processor of computing machine or other programmable data processing device is produced for realizing the device in the function of flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame appointments.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, the instruction that makes to be stored in this computer-readable memory produces the manufacture that comprises command device, and this command device is realized the function of appointment in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make to carry out sequence of operations step to produce computer implemented processing on computing machine or other programmable devices, thereby the instruction of carrying out is provided for realizing the step of the function of appointment in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame on computing machine or other programmable devices.
Although described the preferred embodiments of the present invention, once those skilled in the art obtain the basic creative concept of cicada, can make other change and modification to these embodiment.So claims are intended to all changes and the modification that are interpreted as comprising preferred embodiment and fall into the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the embodiment of the present invention the embodiment of the present invention.Like this, if within these of the embodiment of the present invention are revised and modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.

Claims (14)

1. a read-only materialized view rollback method, is characterized in that, comprising:
Receive read-only materialized view rollback indication;
Obtain the sign of the target read-only materialized view carrying in described read-only materialized view rollback indication, according to the sign of described target read-only materialized view, read root and the establishment moment corresponding to described target read-only materialized view of described target read-only materialized view, the root of file system is replaced with to the root of described target read-only materialized view, make described target read-only materialized view be rolled back to described file system; And
Retain afterwards all read-only materialized views constantly that create of the establishment moment that described target read-only materialized view is corresponding; And
The next one obtaining after establishment corresponding to described target read-only materialized view constantly creates the metadata of read-only materialized view constantly, in described metadata, obtain the monopolizing after data message of described target read-only materialized view, delete the data message of monopolizing of target read-only materialized view described in described metadata; Wherein, described read-only materialized view is the reflection of file system sometime.
2. the method for claim 1, is characterized in that, before the root of file system being replaced with to the root of described target read-only materialized view, further comprises:
The metadata of file reading system, and the establishment moment corresponding to the read-only materialized view being created for the last time in described file system;
According to the metadata of described file system, if when detecting after establishment corresponding to the described read-only materialized view being created for the last time constantly described file system and having more new data, based on the default read-only materialized view of described renewal data creation; If when detecting after establishment corresponding to the described read-only materialized view being created for the last time constantly described file system and not having more new data, using the described read-only materialized view being created for the last time as default read-only materialized view.
3. method as claimed in claim 2, is characterized in that, the root of file system is replaced with to the root of described target read-only materialized view, makes described target read-only materialized view be rolled back to described file system, specifically comprises:
The root of file system is replaced with to the root of described target read-only materialized view; And
To the metadata of described file system, make described target read-only materialized view be rolled back to described file system the data information memory of described target read-only materialized view.
4. method as claimed in claim 2 or claim 3, is characterized in that, after described target read-only materialized view is rolled back to described file system, further comprises:
When receiving the indication of deletion read-only materialized view, according to described deletion read-only materialized view indication, obtain the sign of read-only materialized view to be deleted; And
Whether according to the sign of described read-only materialized view to be deleted, detecting read-only materialized view to be deleted is default read-only materialized view;
If so, travel through described read-only materialized view to be deleted, and delete the data of monopolizing of described read-only materialized view to be deleted;
Otherwise, according to the next one in the establishment moment corresponding to described read-only materialized view to be deleted, create the metadata of read-only materialized view constantly, obtain the data of monopolizing of described read-only materialized view to be deleted, and
Delete the data of monopolizing of described read-only materialized view to be deleted, and the data message of monopolizing of deleting read-only materialized view to be deleted described in the next metadata that creates read-only materialized view constantly after establishment corresponding to described read-only materialized view to be deleted constantly.
5. method as claimed in claim 2 or claim 3, is characterized in that, after described target read-only materialized view is rolled back to described file system, further comprises:
When receiving the indication of upgrading the data in described file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of described file system, when there is newly-built read-only materialized view in detection after described target read-only materialized view is rolled back to described file system, according to new data more, obtain the data of monopolizing of described newly-built read-only materialized view;
According to the data of monopolizing of described newly-built read-only materialized view, in the metadata of described file system, upgrade the data message of described newly-built read-only materialized view.
6. method as claimed in claim 5, is characterized in that, further comprises:
If after described newly-built read-only materialized view, while again creating new read-only materialized view, empty the snapshot object territory in the metadata of described file system.
7. method as claimed in claim 2 or claim 3, is characterized in that, after described target read-only materialized view is rolled back to described file system, further comprises:
When receiving the indication of upgrading the data in described file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of described file system, when there is not newly-built read-only materialized view in detection after described target read-only materialized view is rolled back to described file system, according to described more new data, determine the data of monopolizing of described target read-only materialized view;
According to the data of monopolizing of described target read-only materialized view, in creating the metadata of read-only materialized view constantly, upgrades establishment corresponding to the described target read-only materialized view next one constantly the data message of described target read-only materialized view.
8. a read-only materialized view rollback device, is characterized in that, comprising:
Receiving element, for receiving read-only materialized view rollback indication, and is sent to acquiring unit by described read-only materialized view rollback indication;
Acquiring unit, the read-only materialized view rollback indication sending for receiving described receiving element, and obtain the sign of the target read-only materialized view carrying in described read-only materialized view rollback indication, according to the sign of described target read-only materialized view, read root and the establishment moment corresponding to described target read-only materialized view of described target read-only materialized view; Wherein, described read-only materialized view is the reflection of file system sometime; And the root of described target read-only materialized view and establishment corresponding to described target read-only materialized view are sent to control module constantly, and establishment corresponding to described target read-only materialized view is sent to the first delete cells constantly;
Control module, for receiving root and the establishment moment corresponding to described target read-only materialized view of the described target read-only materialized view of described acquiring unit transmission, and the root of file system is replaced with to the root of described target read-only materialized view, make described target read-only materialized view be rolled back to described file system; And the read-only materialized views that retain afterwards all establishment moment in the establishment moment that described target read-only materialized view is corresponding;
The first delete cells, the establishment moment corresponding to described read-only materialized view sending for receiving described acquiring unit, and the next one obtaining after the establishment constantly that described target read-only materialized view is corresponding creates the metadata of read-only materialized view constantly; Obtain the data message of monopolizing of target read-only materialized view described in described metadata; Delete the data message of monopolizing of target read-only materialized view described in described metadata.
9. device as claimed in claim 8, is characterized in that, also comprises default read-only materialized view creating unit, for:
The metadata of file reading system, and the establishment moment corresponding to the read-only materialized view being created for the last time in described file system; According to the metadata of described file system, if when detecting after establishment corresponding to the described read-only materialized view being created for the last time constantly described file system and having more new data, based on the default read-only materialized view of described renewal data creation; If when detecting after establishment corresponding to the described read-only materialized view being created for the last time constantly described file system and not having more new data, using the described read-only materialized view being created for the last time as default read-only materialized view.
10. device as claimed in claim 9, is characterized in that, described control module, specifically for:
The root of file system is replaced with to the root of described target read-only materialized view; And by the data information memory of described target read-only materialized view in the metadata of described file system, make described target read-only materialized view be rolled back to described file system.
11. devices as described in claim 9 or 10, is characterized in that, also comprise the second delete cells, for:
When receiving the indication of deletion read-only materialized view, according to described deletion read-only materialized view indication, obtain the sign of read-only materialized view to be deleted; And whether according to the sign of described read-only materialized view to be deleted, detecting read-only materialized view to be deleted is default read-only materialized view; If so, travel through described read-only materialized view to be deleted, and delete the data of monopolizing of described read-only materialized view to be deleted; Otherwise, according to the next one in the establishment moment corresponding to described read-only materialized view to be deleted, create the metadata of read-only materialized view constantly, obtain the data of monopolizing of described read-only materialized view to be deleted, and the data of monopolizing of deleting described read-only materialized view to be deleted, and the data message of monopolizing of deleting read-only materialized view to be deleted described in the next metadata that creates read-only materialized view constantly after establishment corresponding to described read-only materialized view to be deleted constantly.
12. devices as described in claim 9 or 10, is characterized in that, also comprise the first updating block, for:
When receiving the indication of upgrading the data in described file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of described file system, when there is newly-built read-only materialized view in detection after described target read-only materialized view is rolled back to described file system, according to new data more, obtain the data of monopolizing of described newly-built read-only materialized view; According to the data of monopolizing of described newly-built read-only materialized view, in the metadata of described file system, upgrade the data message of described newly-built read-only materialized view.
13. devices as claimed in claim 12, is characterized in that, also comprise and empty unit, for:
If after described newly-built read-only materialized view, while again creating new read-only materialized view, empty the snapshot object territory in the metadata of described file system.
14. devices as described in claim 9 or 10, is characterized in that, also comprise the second updating block, for:
After described target read-only materialized view is rolled back to described file system, when receiving the indication of upgrading the data in described file system, according to the sign of the target read-only materialized view of the snapshot object territory record creating in the metadata of described file system, when there is not newly-built read-only materialized view in detection after described target read-only materialized view is rolled back to described file system, according to described more new data, determine the data of monopolizing of described target read-only materialized view; According to the data of monopolizing of described target read-only materialized view, in creating the metadata of read-only materialized view constantly, upgrades establishment corresponding to the described target read-only materialized view next one constantly the data message of described target read-only materialized view.
CN201310611326.3A 2013-11-26 2013-11-26 A kind of read-only materialized view rollback method and device Active CN103645967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310611326.3A CN103645967B (en) 2013-11-26 2013-11-26 A kind of read-only materialized view rollback method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310611326.3A CN103645967B (en) 2013-11-26 2013-11-26 A kind of read-only materialized view rollback method and device

Publications (2)

Publication Number Publication Date
CN103645967A true CN103645967A (en) 2014-03-19
CN103645967B CN103645967B (en) 2016-06-22

Family

ID=50251188

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310611326.3A Active CN103645967B (en) 2013-11-26 2013-11-26 A kind of read-only materialized view rollback method and device

Country Status (1)

Country Link
CN (1) CN103645967B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017088476A1 (en) * 2015-11-27 2017-06-01 华为技术有限公司 Method for synchronization and resumed transfer, slave end device, and system
CN108255638A (en) * 2017-06-29 2018-07-06 新华三技术有限公司 A kind of snapshot rollback method and device
CN108572986A (en) * 2017-03-13 2018-09-25 华为软件技术有限公司 A kind of method and node device of data update

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101419564A (en) * 2008-12-11 2009-04-29 杭州华三通信技术有限公司 Method and device for recovering data by employing snapshot
US7831565B2 (en) * 2007-01-18 2010-11-09 Dot Hill Systems Corporation Deletion of rollback snapshot partition
CN102594849A (en) * 2011-01-06 2012-07-18 阿里巴巴集团控股有限公司 Data backup and recovery method and device, virtual machine snapshot deleting and rollback method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7831565B2 (en) * 2007-01-18 2010-11-09 Dot Hill Systems Corporation Deletion of rollback snapshot partition
CN101419564A (en) * 2008-12-11 2009-04-29 杭州华三通信技术有限公司 Method and device for recovering data by employing snapshot
CN102594849A (en) * 2011-01-06 2012-07-18 阿里巴巴集团控股有限公司 Data backup and recovery method and device, virtual machine snapshot deleting and rollback method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
倪琴琴 等: "ZFS文件系统Snapshot技术的分析", 《计算机教育》, no. 14, 31 July 2009 (2009-07-31), pages 141 - 143 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017088476A1 (en) * 2015-11-27 2017-06-01 华为技术有限公司 Method for synchronization and resumed transfer, slave end device, and system
CN108572986A (en) * 2017-03-13 2018-09-25 华为软件技术有限公司 A kind of method and node device of data update
CN108572986B (en) * 2017-03-13 2022-05-17 华为技术有限公司 Data updating method and node equipment
CN108255638A (en) * 2017-06-29 2018-07-06 新华三技术有限公司 A kind of snapshot rollback method and device

Also Published As

Publication number Publication date
CN103645967B (en) 2016-06-22

Similar Documents

Publication Publication Date Title
US10956364B2 (en) Efficient data synchronization for storage containers
US8250033B1 (en) Replication of a data set using differential snapshots
US8738883B2 (en) Snapshot creation from block lists
CN103473277B (en) The Snapshot Method and device of file system
WO2015078370A1 (en) Method, device, node and system for managing file in distributed data warehouse
CN106569738B (en) A kind of method and device for deleting cascade snapshot
CN110018989B (en) Snapshot comparison method and device
CN100429628C (en) Method for rebuilding directory structure and recovering data in NTFS volume
CN102667703A (en) System and method for optimized reclamation processing in a virtual tape library system
EP3474143B1 (en) Method and apparatus for incremental recovery of data
CN109558213A (en) The method and apparatus for managing the virtual machine snapshot of OpenStack platform
CN106096447A (en) A kind of document protection method and device
CN104793981A (en) Online snapshot managing method and device for virtual machine cluster
CN105867962A (en) System upgrading method and device
CN103645967A (en) Read-only snapshot rollback method and device
CN111831475A (en) Data backup method and device, node equipment and readable storage medium
CN114281779A (en) Data synchronization method and device, computer equipment and storage medium
CN111857939A (en) Method, system, electronic device and storage medium for deleting and pushing mirror image
CN111656325A (en) Fast recovery from failure in a time-ordered log structured key-value storage system
CN108369549B (en) Versioned record management computing system, method and computer readable medium
CN106874343B (en) Data deletion method and system for time sequence database
CN102520947A (en) Method and device for automatically removing codes
CN109542841B (en) Method for creating data snapshot in cluster and terminal equipment
CN107562898A (en) A kind of method that recycle bin is created based on KUX operating systems
KR20150097973A (en) Tile image update system for map service and method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant