CN108228813A - The delet method and device of replica database in distributed system - Google Patents

The delet method and device of replica database in distributed system Download PDF

Info

Publication number
CN108228813A
CN108228813A CN201711486360.7A CN201711486360A CN108228813A CN 108228813 A CN108228813 A CN 108228813A CN 201711486360 A CN201711486360 A CN 201711486360A CN 108228813 A CN108228813 A CN 108228813A
Authority
CN
China
Prior art keywords
catalogue
replica database
hard link
database
replica
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
CN201711486360.7A
Other languages
Chinese (zh)
Other versions
CN108228813B (en
Inventor
王康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology 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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201711486360.7A priority Critical patent/CN108228813B/en
Publication of CN108228813A publication Critical patent/CN108228813A/en
Application granted granted Critical
Publication of CN108228813B publication Critical patent/CN108228813B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses the delet methods and device of replica database in a kind of distributed system.Wherein, the method includes:Recovery fiel folder is pre-configured in file system;When receiving the delete operation to replica database, the first catalogue that hard link is had built up with the replica database is obtained, the second catalogue is established under recovery fiel folder according to first catalogue;Establish the hard link of the replica database and second catalogue;Delete the hard link of the replica database and first catalogue.Using this programme, after deleting replica database, it is easy to the recovery to replica database, so as to reduce the risk for accidentally deleting replica database, avoids the loss that can not restore after accidentally being deleted to replica database in the prior art and bring.

Description

The delet method and device of replica database in distributed system
Technical field
The present invention relates to field of computer technology, and in particular to the delet method of replica database in a kind of distributed system And device.
Background technology
Distributed system has the characteristics that high parallel, high fault-tolerant, high flexibility by numerous those skilled in the art with it Favor.Each copy data in a distributed system has its corresponding replica database.When in replica database Migration or deletion, table can lead to the deletion of replica database when deleting.
However, at present after deleting replica database, replica database can not be restored again, so as to carry The high risk accidentally deleted to replica database, the loss for increasing to accidentally deleting for replica database and bringing.
Invention content
In view of the above problems, it is proposed that the present invention overcomes the above problem in order to provide one kind or solves at least partly State the delet method and device of replica database in the distributed system of problem.
According to an aspect of the invention, there is provided in a kind of distributed system replica database delet method, including:
Recovery fiel folder is pre-configured in file system;
When receiving the delete operation to replica database, obtain and have built up hard link with the replica database First catalogue establishes the second catalogue according to first catalogue under recovery fiel folder;
Establish the hard link of the replica database and second catalogue;
Delete the hard link of the replica database and first catalogue.
According to another aspect of the present invention, a kind of deletion device of replica database in distributed system is provided, including:
Preset module, suitable for being pre-configured with recovery fiel folder in file system;
First catalogue establishes module, suitable for when receiving the delete operation to replica database, obtaining and the copy Database has built up the first catalogue of hard link, and the second mesh is established under recovery fiel folder according to first catalogue Record;
First hard link establishes module, is adapted to set up the hard link of the replica database and second catalogue;
First hard link removing module, suitable for deleting the replica database and the hard link of first catalogue.
According to another aspect of the invention, a kind of computing device is provided, including:Processor, memory, communication interface and Communication bus, the processor, the memory and the communication interface complete mutual communication by the communication bus;
For the memory for storing an at least executable instruction, it is above-mentioned that the executable instruction performs the processor The corresponding operation of the delet method of replica database in distributed system.
In accordance with a further aspect of the present invention, provide a kind of computer storage media, be stored in the storage medium to A few executable instruction, the executable instruction make processor perform such as the deletion side of replica database in above-mentioned distributed system The corresponding operation of method.
According to the delet method and device of replica database in distributed system provided by the invention.First in file system In be pre-configured with recovery fiel folder;When receiving the delete operation to replica database, acquisition has been built with replica database First catalogue of vertical hard link establishes the second catalogue according to the first catalogue under recovery fiel folder;Establish replica database and The hard link of two catalogues;Delete replica database and the hard link of the first catalogue.Using this programme, deleted to replica database Later, it is easy to the recovery to copy data, accidentally deletes replica database risk so as to reduce, avoid in the prior art to number of copies It can not restore caused loss after accidentally being deleted according to library.
Above description is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, below the special specific embodiment for lifting the present invention.
Description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this field Technical staff will become clear.Attached drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 is shown according to the delet method of replica database in distributed system provided by one embodiment of the present invention Flow diagram;
Fig. 2 shows the delet methods of replica database in the distributed system provided according to a further embodiment of the invention Flow diagram;
Fig. 3 is shown according to the deletion device of replica database in distributed system provided by one embodiment of the present invention Structure diagram;
Fig. 4 shows the deletion device of replica database in the distributed system provided according to a further embodiment of the invention Structure diagram;
Fig. 5 shows the structure diagram according to computing device provided by one embodiment of the present invention.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
Fig. 1 is shown according to the delet method of replica database in distributed system provided by one embodiment of the present invention Flow diagram.As shown in Figure 1, this method includes:
Step S110 is pre-configured with recovery fiel folder in file system.
Wherein, file system is the mechanism being responsible in operating system with storage file information.The present invention is to file system The specific category of system does not limit, for example, file system can be RAMFS file system (memory file system), VFAT files System (file system that 95/98 operating systems of Windows use), the HPFS file system (file that os/2 operation system uses System) etc..
User realizes the operation of replica database by file system.For example, in the prior art to copy It is the deletion to file directory corresponding with the replica database in file system or file to reach when database is deleted To the deletion to replica database.
Specifically, before deleting replica database, recovery fiel folder is configured in file system in advance.Its In, the present invention does not limit form of recovery fiel folder etc..Optionally, recovery fiel is clipped in set up after can recessive file Mode shown, shown in a manner of dominant file when including catalogue under recovery fiel folder.
Step S120, when receiving the delete operation to replica database, acquisition has built up with the replica database First catalogue of hard link establishes the second catalogue according to the first catalogue under recovery fiel folder.
Specifically, the first catalogue is located in file system, the first catalogue and the number of copies stored in memory node or subregion Being established according to library has hard link.When receiving the delete operation to replica database, it can obtain and built with the replica database First catalogue of vertical hard link presss from both sides automatic foundation second catalogue identical with the first catalogue in recovery fiel.
When receiving the delete operation to multiple replica databases, obtain had built up with each replica database respectively Each first catalogue of hard link, according to each first catalogue, foundation is corresponding with each first catalogue under recovery fiel folder Second catalogue.
Step S130 establishes replica database and the hard link of the second catalogue.
After establishing the second catalogue under recovery fiel folder in the step s 120, replica database is further established with being somebody's turn to do The hard link of second catalogue.
Step S140 deletes replica database and the hard link of the first catalogue.
After step S130 establishes the hard link of replica database and the second catalogue, replica database and the first mesh are deleted The hard link of record.After the hard link of replica database and the first catalogue is deleted, the first catalogue in file system is also deleted It removes, and the position of the replica database in memory node or subregion or content do not do any variation, consequently facilitating to copy data The recovery in library.
It is pre- first in file system according to the delet method of replica database in distributed system provided in this embodiment First configuration recovery fiel folder;When receiving the delete operation to replica database, obtain and had built up firmly with replica database First catalogue of link establishes the second catalogue according to the first catalogue under recovery fiel folder;Establish replica database and the second mesh The hard link of record;Delete replica database and the hard link of the first catalogue.Using this programme, it is being deleted to replica database Afterwards, the position or content of memory node or the replica database in subregion do not do any variation, consequently facilitating to replica database Recovery, and then reduce and accidentally delete the risk of replica database, avoid in the prior art after accidentally being deleted to replica database It can not restore caused loss.
Fig. 2 shows the delet methods of replica database in the distributed system provided according to a further embodiment of the invention Flow diagram.As shown in Fig. 2, this method includes:
Step S210 is pre-configured with recovery fiel folder in file system.
Wherein, file system is the mechanism being responsible in operating system with storage file information.The present invention is to file system The specific category of system does not limit, for example, file system can be RAMFS file system (memory file system), VFAT files System (file system that 95/98 operating systems of Windows use), the HPFS file system (file that os/2 operation system uses System) etc..
User realizes the operation of replica database by file system.For example, in the prior art to copy It is the deletion to file directory corresponding with the replica database in file system or file to reach when database is deleted To the deletion to replica database.
Specifically, before deleting replica database, recovery fiel folder is configured in file system in advance.Its In, the present invention does not limit form of recovery fiel folder etc..Optionally, recovery fiel is clipped in set up after can recessive file Mode shown.
Step S220, when receiving the delete operation to replica database, acquisition has built up with the replica database First catalogue of hard link establishes the second catalogue and acquisition and replica database according to the first catalogue under recovery fiel folder Corresponding journal file and the third catalogue that hard link is had built up with journal file, according to third catalogue in recovery fiel The 4th catalogue is established under folder.
Specifically, replica database has the first catalogue corresponding thereto in file system, also, replica database with First catalogue is connected in a manner of hard link.User can change the additions and deletions of replica database by being realized to the operation of the first catalogue It looks into.In addition, replica database also has journal file corresponding thereto, being recorded in the journal file has in the replica database Operation information or data change information etc..Wherein, the present invention does not limit the type of journal file, for example, journal file can Think binlog daily records (binary log), redo log daily records (redoing log), error log etc..The quantity of journal file can Think one, or multiple.Wherein, in file system there is also with the corresponding third catalogue of the journal file, third Catalogue is connect with the journal file in the form of hard link.
Specifically, it when receiving the delete operation to replica database, obtains and is had built up firmly with the replica database First catalogue of link, journal file corresponding with replica database and the third that hard link is had built up with journal file Catalogue;And second catalogue and fourth catalogue identical with the first catalogue and third catalogue are established respectively under recovery fiel folder.
When receiving the delete operation to multiple replica databases, obtain had built up with each replica database respectively Each third catalogue of each first catalogue of hard link and journal file corresponding with each replica database, and recycling It is established in batches under file and each first catalogue and corresponding second catalogue of each third catalogue and the 4th catalogue.
Step S230 establishes the hard link of replica database and the second catalogue and establishes corresponding with replica database The hard link of journal file and the 4th catalogue.
After step S220 establishes the second catalogue and the 4th catalogue, the hard of replica database and the second catalogue is established Link and foundation journal file corresponding with replica database and the hard link of the 4th catalogue.
Step S240 deletes the hard link of replica database and the first catalogue and deletes corresponding with replica database Journal file and the hard link of third catalogue.
The hard link of replica database and the second catalogue and the corresponding daily record text of replica database are established in step S230 After part and the hard link of the 4th catalogue, the hard link and deletion and copy data of deletion replica database and the first catalogue The corresponding journal file in library and the hard link of third catalogue.
After the hard link of replica database and the first catalogue is deleted, the first catalogue in file system is also deleted, And the position of the replica database in memory node or subregion or content do not do any variation, consequently facilitating to replica database Restore.
Similarly, after hard link of the corresponding journal file of replica database with third catalogue is deleted, in file system Third catalogue be also deleted, and the position of the corresponding journal file of the replica database in memory node or subregion or content are not Do any variation, consequently facilitating to replica database corresponding journal file recovery.
Step S250 according to the complete deletion order for replica database performed under being pressed from both sides in recovery fiel, is deleted secondary The hard link of database and the second catalogue;And delete the corresponding journal file of replica database and the hard chain of the 4th catalogue It connects.
When triggering is directed to the complete deletion order of replica database to user under recovery fiel folder, replica database is deleted With the hard link of the second catalogue;And delete the corresponding journal file of replica database and the hard link of the 4th catalogue.Due to returning It is unique linking relationship to receive the second catalogue in file and the replica database in memory node or subregion, when deletion copy After database and the hard link of the second catalogue, the second catalogue under recovery fiel is also deleted, and in memory node or subregion Replica database will also be deleted from memory node or subregion, so as to fulfill the complete deletion to replica database.Similarly, it returns The 4th catalogue journal file corresponding with the replica database in memory node or subregion in file is received uniquely to link Relationship, after the hard link for deleting the corresponding journal file of replica database and the 4th catalogue, the 4th catalogue under recovery fiel Also it can delete, and journal file corresponding with the replica database in memory node or subregion also will be from memory node or subregion It deletes, so as to fulfill the complete deletion of journal file corresponding to replica database.
Optionally, it in complete deletion order of user's triggering for replica database, can be sent out in the form of pop-up etc. Will complete deletion replica database and the corresponding journal file of replica database prompt message, when user believes for the prompting After breath execution complete deletion determines operation, then to deleting the hard link of replica database and the second catalogue and deleting copy The hard link of the corresponding journal file of database and the 4th catalogue;After user performs for the prompt message returns to operation, Then this does not delete the hard link of replica database and the second catalogue and the corresponding journal file of replica database and the 4th mesh The hard link of record.
Step S260, according to the recovery order for replica database, according between replica database and the second catalogue Hard link rebuilds replica database and the hard link of the first catalogue;And according to journal file corresponding with replica database with Hard link between 4th catalogue rebuilds the corresponding journal file of replica database and the hard link of third catalogue.
Optionally, it is rebuilding the hard link of replica database and the first catalogue and is rebuilding replica database corresponding day Will file is with that after the hard link of third catalogue, can delete the hard link and number of copies between replica database and the second catalogue According to the hard link between the corresponding journal file in library and the 4th catalogue, the second mesh in recovery fiel folder further can be also deleted Record and the 4th catalogue.
Step S270 empties order according to recovery fiel folder, empties all second catalogues under recovery fiel folder and owns 4th catalogue.
After step S220 constantly recycles execution to step S240, may include having in recovery fiel folder multiple second catalogues and Multiple 4th catalogues.When receive to recovery fiel folder empty order when, empty recovery fiel folder under the second all catalogues With the 4th all catalogues, so as to fulfill pair with the corresponding each replica database of each second catalogue and replica database pair The batch for the journal file answered is deleted.
In a kind of optional embodiment, it is pressed from both sides when step S210 is pre-configured with recovery fiel in file system Afterwards, step S220 to step S240 can be:It is established in recovery fiel folder and each replica database corresponding each the Two catalogues, wherein, each second catalogue be according to each replica database have built up hard link each first catalogue and It establishes.When receiving the delete operation to specifying replica database, establish and the specified replica database corresponding second Hard link between catalogue, and delete the hard chain that the specified replica database specifies corresponding first catalogue of copy data with this It connects.
It is pre- first in file system according to the delet method of replica database in distributed system provided in this embodiment First configuration recovery fiel folder;When receiving the delete operation to replica database, acquisition has built up with the replica database First catalogue of hard link establishes the second catalogue and acquisition and replica database according to the first catalogue under recovery fiel folder Corresponding journal file and the third catalogue that hard link is had built up with journal file, according to third catalogue in recovery fiel The 4th catalogue is established under folder;And it establishes the hard link of replica database and the second catalogue and establishes corresponding with replica database Journal file and the 4th catalogue hard link;Delete the hard link of replica database and the first catalogue later and delete and The corresponding journal file of replica database and the hard link of third catalogue.So as to which after deleting replica database, storage saves The position or content of point or the replica database in subregion do not do any variation, consequently facilitating the recovery to replica database, into And the risk for accidentally deleting replica database is reduced, it avoids that institute can not be restored after replica database is accidentally deleted in the prior art The loss brought;In addition, can be directed to according to the complete deletion order for replica database performed under recovery fiel folder, delete Except replica database and the hard link of the second catalogue;And delete the corresponding journal file of replica database and the 4th catalogue Hard link realizes the complete deletion to replica database and journal file;Also, according to the recovery life for replica database It enables, according to the hard link between replica database and the second catalogue, rebuilds replica database and the hard link of the first catalogue;With And according to the hard link between journal file corresponding with replica database and the 4th catalogue, it is corresponding to rebuild replica database Journal file and the hard link of third catalogue are, it can be achieved that the automation to deleted replica database and journal file restores; Also, it can also be pressed from both sides according to recovery fiel and empty order, empty all second catalogues under recovery fiel folder and all 4th catalogues, It is deleted so as to fulfill to the batch of replica database and journal file.
Fig. 3 is shown according to the deletion device of replica database in distributed system provided by one embodiment of the present invention Structure diagram.As shown in figure 3, the device includes:Preset module 31, the first catalogue establish module 32, the first hard link establishes mould 33 and first hard link removing module 34 of block.
Preset module 31, suitable for being pre-configured with recovery fiel folder in file system.
First catalogue establishes module 32, suitable for when receiving the delete operation to replica database, obtains and number of copies The first catalogue of hard link is had built up according to library, the second catalogue is established under recovery fiel folder according to the first catalogue.
First hard link establishes module 33, is adapted to set up replica database and the hard link of the second catalogue.
First hard link removing module 34, suitable for deleting the hard link of replica database and the first catalogue.
Wherein, in the distributed system in the present embodiment replica database delete device in modules specific implementation Mode can refer to the elaboration in the delet method embodiment of replica database in distributed system as shown in Figure 1 or 2, herein It does not repeat.
It is pre- first in file system according to the deletion device of replica database in distributed system provided in this embodiment First configuration recovery fiel folder;When receiving the delete operation to replica database, obtain and had built up firmly with replica database First catalogue of link establishes the second catalogue according to the first catalogue under recovery fiel folder;Establish replica database and the second mesh The hard link of record;Delete replica database and the hard link of the first catalogue.Using this programme, it is being deleted to replica database Afterwards, the position or content of memory node or the replica database in subregion do not do any variation, consequently facilitating to replica database Recovery, and then reduce and accidentally delete the risk of replica database, avoid in the prior art after accidentally being deleted to replica database It can not restore caused loss.
Fig. 4 shows the deletion device of replica database in the distributed system provided according to a further embodiment of the invention Structure diagram.As shown in figure 4, on the basis of device shown in Fig. 3, which further includes:Second catalogue establishes module 41, Two hard links establish module 42, the second hard link removing module 43, complete deletion module 44, recovery module 45 and empty mould Block 46.
Second catalogue establishes module 41, suitable for when receiving the delete operation to replica database, obtains and number of copies The third catalogue of hard link is had built up according to the corresponding journal file in library and with journal file, is being recycled according to third catalogue The 4th catalogue is established under file.
Second hard link establishes module 42, is adapted to set up the hard of journal file corresponding with replica database and the 4th catalogue Link;
Second hard link removing module 43, suitable for deleting the hard of corresponding with replica database journal file and third catalogue Link.
Complete deletion module 44, suitable for being ordered according to the complete deletion for replica database performed under recovery fiel folder It enables, deletes replica database and the hard link of the second catalogue;And delete the corresponding journal file of replica database and the 4th mesh The hard link of record.
Recovery module 45 is directed to the recovery order of replica database suitable for basis, according to replica database and the second catalogue Between hard link, rebuild the hard link of replica database and the first catalogue;And according to daily record corresponding with replica database Hard link between file and the 4th catalogue rebuilds the corresponding journal file of replica database and the hard link of third catalogue.
Module 46 is emptied, suitable for emptying order according to recovery fiel folder, empties all second catalogues under recovery fiel folder With the 4th all Log Directories.
Wherein, in the distributed system in the present embodiment replica database delete device in modules specific implementation Mode can refer to the elaboration in the delet method embodiment of replica database in distributed system as shown in Figure 1 or 2, herein It does not repeat.
It is pre- first in file system according to the deletion device of replica database in distributed system provided in this embodiment First configuration recovery fiel folder;When receiving the delete operation to replica database, acquisition has built up with the replica database First catalogue of hard link establishes the second catalogue and acquisition and replica database according to the first catalogue under recovery fiel folder Corresponding journal file and the third catalogue that hard link is had built up with journal file, according to third catalogue in recovery fiel The 4th catalogue is established under folder;And it establishes the hard link of replica database and the second catalogue and establishes corresponding with replica database Journal file and the 4th catalogue hard link;Delete the hard link of replica database and the first catalogue later and delete and The corresponding journal file of replica database and the hard link of third catalogue.So as to which after deleting replica database, storage saves The position or content of point or the replica database in subregion do not do any variation, and then are convenient for the recovery to replica database, into And the risk for accidentally deleting replica database is reduced, it avoids that institute can not be restored after replica database is accidentally deleted in the prior art The loss brought;In addition, can be directed to according to the complete deletion order for replica database performed under recovery fiel folder, delete Except replica database and the hard link of the second catalogue;And delete the corresponding journal file of replica database and the 4th catalogue Hard link realizes the complete deletion to replica database and journal file;Also, according to the recovery life for replica database It enables, according to the hard link between replica database and the second catalogue, rebuilds replica database and the hard link of the first catalogue;With And according to the hard link between journal file corresponding with replica database and the 4th catalogue, it is corresponding to rebuild replica database Journal file and the hard link of the 4th catalogue are, it can be achieved that the automation to deleted replica database and journal file restores; Also, it can also be pressed from both sides according to recovery fiel and empty order, empty all second catalogues under recovery fiel folder and all 4th catalogues, It is deleted so as to fulfill to the batch of replica database and journal file.
A kind of nonvolatile computer storage media is provided according to one embodiment of the invention, the computer storage is situated between Matter is stored with an at least executable instruction, which can perform the distribution in above-mentioned any means embodiment The delet method of replica database in system.
A kind of structure diagram of computing device is provided according to one embodiment of the invention, the specific embodiment of the invention is simultaneously The specific implementation of computing device is not limited.
As shown in figure 5, the computing device can include:Processor (processor) 502, communication interface (Communications Interface) 504, memory (memory) 506 and communication bus 508.
Wherein:
Processor 502, communication interface 504 and memory 506 complete mutual communication by communication bus 508.
Communication interface 504, for communicating with the network element of miscellaneous equipment such as client or other servers etc..
Processor 502 for performing program 510, can specifically perform deleting for replica database in above-mentioned distributed system Except the correlation step in embodiment of the method.
Specifically, program 510 can include program code, which includes computer-managed instruction.
Processor 502 may be central processor CPU or specific integrated circuit ASIC (Application Specific Integrated Circuit) or be arranged to implement the embodiment of the present invention one or more integrate electricity Road.The one or more processors that computing device includes can be same type of processor, such as one or more CPU;Also may be used To be different types of processor, such as one or more CPU and one or more ASIC.
Memory 506, for storing program 510.Memory 506 may include high-speed RAM memory, it is also possible to further include Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.
Program 510 specifically can be used for so that processor 502 performs following operation:
Recovery fiel folder is pre-configured in file system;
When receiving the delete operation to replica database, obtain and have built up hard link with the replica database First catalogue establishes the second catalogue according to first catalogue under recovery fiel folder;
Establish the hard link of the replica database and second catalogue;
Delete the hard link of the replica database and first catalogue.
In a kind of optional embodiment, program 510 specifically can be used for so that processor 502 performs following operation:
When receiving the delete operation to replica database, journal file corresponding with the replica database is obtained, And the third catalogue of hard link is had built up with the journal file, according to the third catalogue under recovery fiel folder Establish the 4th catalogue;
Establish journal file corresponding with the replica database and the hard link of the 4th catalogue;
Delete journal file corresponding with the replica database and the hard link of the third catalogue.
In a kind of optional embodiment, program 510 specifically can be used for so that processor 502 performs following operation:
According to the complete deletion order for the replica database performed under being pressed from both sides in recovery fiel, the copy is deleted Database and the hard link of second catalogue;And delete the corresponding journal file of the replica database and the described 4th The hard link of catalogue.
In a kind of optional embodiment, program 510 specifically can be used for so that processor 502 performs following operation:
According to the recovery order for the replica database, according to hard between the replica database and the second catalogue The hard link of the replica database and first catalogue is rebuild in link;And according to corresponding with the replica database Hard link between journal file and the 4th catalogue rebuilds the corresponding journal file of the replica database and the third catalogue Hard link.
In a kind of optional embodiment, program 510 specifically can be used for so that processor 502 performs following operation:
Order is emptied according to recovery fiel folder, empties all second catalogues under the recovery fiel folder and all 4th mesh Record.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification provided in this place, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor Shield the present invention claims the more features of feature than being expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim is in itself Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to carry out adaptively the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.It can be the module or list in embodiment Member or component be combined into a module or unit or component and can be divided into addition multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it may be used any Combination is disclosed to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification is (including adjoint power Profit requirement, abstract and attached drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be with hardware realization or to be run on one or more processor Software module realize or realized with combination thereof.It will be understood by those of skill in the art that it can use in practice Microprocessor or digital signal processor (DSP) realize replica database in distributed system according to embodiments of the present invention Delete device in some or all components some or all functions.The present invention is also implemented as performing this In described method some or all equipment or program of device (for example, computer program and computer program Product).It is such realize the present invention program can may be stored on the computer-readable medium either can have there are one or it is more The form of a signal.Such signal can be downloaded from internet website obtain either providing on carrier signal or with Any other form provides.
It should be noted that the present invention will be described rather than limits the invention, and ability for above-described embodiment Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference mark between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any sequence.These words can be explained and run after fame Claim.
The invention discloses:A1. in a kind of distributed system replica database delet method, including:
Recovery fiel folder is pre-configured in file system;
When receiving the delete operation to replica database, obtain and have built up hard link with the replica database First catalogue establishes the second catalogue according to first catalogue under recovery fiel folder;
Establish the hard link of the replica database and second catalogue;
Delete the hard link of the replica database and first catalogue.
A2. the method according to A1, wherein, the method further includes:
When receiving the delete operation to replica database, journal file corresponding with the replica database is obtained, And the third catalogue of hard link is had built up with the journal file, according to the third catalogue under recovery fiel folder Establish the 4th catalogue;
Establish journal file corresponding with the replica database and the hard link of the 4th catalogue;
Delete journal file corresponding with the replica database and the hard link of the third catalogue.
A3. the method according to A2, wherein, delete the replica database and the hard chain of first catalogue described After connecing, the method further includes:
According to the complete deletion order for the replica database performed under being pressed from both sides in recovery fiel, the copy is deleted Database and the hard link of second catalogue;And delete the corresponding journal file of the replica database and the described 4th The hard link of catalogue.
A4. the method according to A2, wherein, delete the replica database and the hard chain of first catalogue described After connecing, the method further includes:
According to the recovery order for the replica database, according to hard between the replica database and the second catalogue The hard link of the replica database and first catalogue is rebuild in link;And according to corresponding with the replica database Hard link between journal file and the 4th catalogue rebuilds the corresponding journal file of the replica database and the third catalogue Hard link.
A5. according to A2-A4 any one of them methods, wherein, delete the replica database and described first described After the hard link of catalogue, the method further includes:
Order is emptied according to recovery fiel folder, empties all second catalogues under the recovery fiel folder and all 4th mesh Record.
The invention also discloses:B6. in a kind of distributed system replica database deletion device, including:
Preset module, suitable for being pre-configured with recovery fiel folder in file system;
First catalogue establishes module, suitable for when receiving the delete operation to replica database, obtaining and the copy Database has built up the first catalogue of hard link, and the second mesh is established under recovery fiel folder according to first catalogue Record;
First hard link establishes module, is adapted to set up the hard link of the replica database and second catalogue;
First hard link removing module, suitable for deleting the replica database and the hard link of first catalogue.
B7. the device according to B6, wherein, described device further includes:
Second catalogue establishes module, suitable for when receiving the delete operation to replica database, obtaining and the copy The corresponding journal file of database and the third catalogue that hard link is had built up with the journal file, according to the third Catalogue establishes the 4th catalogue under recovery fiel folder;
Second hard link establishes module, is adapted to set up journal file corresponding with the replica database and the 4th mesh The hard link of record;
Second hard link removing module, suitable for deleting journal file corresponding with the replica database and the third mesh The hard link of record.
B8. the device according to B7, wherein, described device further includes:
Complete deletion module, suitable for according to the complete deletion for the replica database performed under recovery fiel folder The hard link of the replica database and second catalogue is deleted in order;And delete the replica database corresponding day Will file and the hard link of the 4th catalogue.
B9. the method according to B7, wherein, described device further includes:
Recovery module, suitable for according to the recovery order for being directed to the replica database, according to the replica database and the Hard link between two catalogues rebuilds the hard link of the replica database and first catalogue;And according to the pair Hard link between the corresponding journal file of database and the 4th catalogue rebuilds the corresponding journal file of the replica database With the hard link of the third catalogue.
B10. the method according to any one of B7-B9, wherein, described device further includes:
Module is emptied, suitable for emptying order according to recovery fiel folder, empties all second mesh under the recovery fiel folder Record and all 4th catalogues.
The invention also discloses:C11. a kind of computing device, including:Processor, memory, communication interface and communication are total Line, the processor, the memory and the communication interface complete mutual communication by the communication bus;
For the memory for storing an at least executable instruction, the executable instruction makes the processor perform such as The corresponding operation of the delet method of replica database in distributed system described in any one of A1-A5.
The invention also discloses:D12. a kind of computer storage media, being stored at least one in the storage medium can hold Row instruction, the executable instruction make replica database in distributed system of the processor execution as described in any one of A1-A5 The corresponding operation of delet method.

Claims (10)

1. the delet method of replica database in a kind of distributed system, including:
Recovery fiel folder is pre-configured in file system;
When receiving the delete operation to replica database, obtain and have built up the first of hard link with the replica database Catalogue establishes the second catalogue according to first catalogue under recovery fiel folder;
Establish the hard link of the replica database and second catalogue;
Delete the hard link of the replica database and first catalogue.
2. according to the method described in claim 1, wherein, the method further includes:
When receiving the delete operation to replica database, obtain corresponding with replica database journal file and The third catalogue of hard link is had built up with the journal file, is established under recovery fiel folder according to the third catalogue 4th catalogue;
Establish journal file corresponding with the replica database and the hard link of the 4th catalogue;
Delete journal file corresponding with the replica database and the hard link of the third catalogue.
3. according to the method described in claim 2, wherein, the hard of the replica database and first catalogue is deleted described After link, the method further includes:
According to the complete deletion order for the replica database performed under being pressed from both sides in recovery fiel, the copy data is deleted Library and the hard link of second catalogue;And delete the corresponding journal file of the replica database and the 4th catalogue Hard link.
4. according to the method described in claim 2, wherein, the hard of the replica database and first catalogue is deleted described After link, the method further includes:
According to the recovery order for the replica database, according to the hard chain between the replica database and the second catalogue It connects, rebuilds the hard link of the replica database and first catalogue;And according to day corresponding with the replica database Hard link between will file and the 4th catalogue rebuilds the corresponding journal file of the replica database and the third catalogue Hard link.
5. according to claim 2-4 any one of them methods, wherein, delete the replica database and described first described After the hard link of catalogue, the method further includes:
Order is emptied according to recovery fiel folder, empties all second catalogues under the recovery fiel folder and all 4th catalogues.
6. the deletion device of replica database in a kind of distributed system, including:
Preset module, suitable for being pre-configured with recovery fiel folder in file system;
First catalogue establishes module, suitable for when receiving the delete operation to replica database, obtaining and the copy data Library has built up the first catalogue of hard link, and the second catalogue is established under recovery fiel folder according to first catalogue;
First hard link establishes module, is adapted to set up the hard link of the replica database and second catalogue;
First hard link removing module, suitable for deleting the replica database and the hard link of first catalogue.
7. device according to claim 6, wherein, described device further includes:
Second catalogue establishes module, suitable for when receiving the delete operation to replica database, obtaining and the copy data The corresponding journal file in library and the third catalogue that hard link is had built up with the journal file, according to the third catalogue The 4th catalogue is established under recovery fiel folder;
Second hard link establishes module, is adapted to set up journal file corresponding with the replica database and the 4th catalogue Hard link;
Second hard link removing module, suitable for deleting journal file corresponding with the replica database and the third catalogue Hard link.
8. device according to claim 7, wherein, described device further includes:
Complete deletion module, suitable for being ordered according to the complete deletion for the replica database performed under recovery fiel folder It enables, deletes the hard link of the replica database and second catalogue;And delete the corresponding daily record of the replica database File and the hard link of the 4th catalogue.
9. a kind of computing device, including:Processor, memory, communication interface and communication bus, the processor, the storage Device and the communication interface complete mutual communication by the communication bus;
For the memory for storing an at least executable instruction, the executable instruction makes the processor perform right such as will Ask the corresponding operation of delet method of replica database in the distributed system described in any one of 1-5.
10. a kind of computer storage media, an at least executable instruction, the executable instruction are stored in the storage medium The delet method for making replica database in distributed system of the processor execution as described in any one of claim 1-5 is corresponding Operation.
CN201711486360.7A 2017-12-29 2017-12-29 Method and device for deleting duplicate database in distributed system Active CN108228813B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711486360.7A CN108228813B (en) 2017-12-29 2017-12-29 Method and device for deleting duplicate database in distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711486360.7A CN108228813B (en) 2017-12-29 2017-12-29 Method and device for deleting duplicate database in distributed system

Publications (2)

Publication Number Publication Date
CN108228813A true CN108228813A (en) 2018-06-29
CN108228813B CN108228813B (en) 2021-08-24

Family

ID=62647394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711486360.7A Active CN108228813B (en) 2017-12-29 2017-12-29 Method and device for deleting duplicate database in distributed system

Country Status (1)

Country Link
CN (1) CN108228813B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258954A (en) * 2020-01-10 2020-06-09 北京百度网讯科技有限公司 Data migration method, device, equipment and storage medium
CN114564456A (en) * 2022-03-03 2022-05-31 北京天融信网络安全技术有限公司 Distributed storage file recovery method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101937377A (en) * 2009-06-29 2011-01-05 百度在线网络技术(北京)有限公司 Data recovery method and device
CN102662981A (en) * 2012-03-13 2012-09-12 中国人民大学 Windows recycle bin delete record forensics method based on feature scan
CN103473296A (en) * 2013-09-04 2013-12-25 国云科技股份有限公司 Recycle bin mechanism and recycle bin system applicable to cloud computing
CN103973731A (en) * 2013-01-29 2014-08-06 中兴通讯股份有限公司 Method and device for managing cloud storage recycle bin
US9098520B2 (en) * 2012-04-03 2015-08-04 Baloota Applications Ltd. Apparatus and methods for restoring data objects
CN104991834A (en) * 2015-05-27 2015-10-21 努比亚技术有限公司 Data recycle method and mobile terminal
CN107066349A (en) * 2017-01-20 2017-08-18 郑州云海信息技术有限公司 A kind of method and system of cluster file system data protection
CN107239521A (en) * 2017-05-26 2017-10-10 郑州云海信息技术有限公司 Recycle bin application process and system on a kind of distributed type assemblies

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101937377A (en) * 2009-06-29 2011-01-05 百度在线网络技术(北京)有限公司 Data recovery method and device
CN102662981A (en) * 2012-03-13 2012-09-12 中国人民大学 Windows recycle bin delete record forensics method based on feature scan
US9098520B2 (en) * 2012-04-03 2015-08-04 Baloota Applications Ltd. Apparatus and methods for restoring data objects
CN103973731A (en) * 2013-01-29 2014-08-06 中兴通讯股份有限公司 Method and device for managing cloud storage recycle bin
CN103473296A (en) * 2013-09-04 2013-12-25 国云科技股份有限公司 Recycle bin mechanism and recycle bin system applicable to cloud computing
CN104991834A (en) * 2015-05-27 2015-10-21 努比亚技术有限公司 Data recycle method and mobile terminal
CN107066349A (en) * 2017-01-20 2017-08-18 郑州云海信息技术有限公司 A kind of method and system of cluster file system data protection
CN107239521A (en) * 2017-05-26 2017-10-10 郑州云海信息技术有限公司 Recycle bin application process and system on a kind of distributed type assemblies

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
于红、冯艳红: "《计算机操作系统》", 31 May 2017, 西安电子科技大学出版社 *
邓波: "《Windows系统管理与高级应用技术》", 30 November 1999, 电子科技大学出版社 *
邓波: "Recycled文件夹的技术实质探索", 《四川经济管理学院学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258954A (en) * 2020-01-10 2020-06-09 北京百度网讯科技有限公司 Data migration method, device, equipment and storage medium
CN111258954B (en) * 2020-01-10 2023-12-05 北京百度网讯科技有限公司 Data migration method, device, equipment and storage medium
CN114564456A (en) * 2022-03-03 2022-05-31 北京天融信网络安全技术有限公司 Distributed storage file recovery method and device
CN114564456B (en) * 2022-03-03 2022-09-23 北京天融信网络安全技术有限公司 Distributed storage file recovery method and device

Also Published As

Publication number Publication date
CN108228813B (en) 2021-08-24

Similar Documents

Publication Publication Date Title
CN104380263B (en) Backup image replicates
TW522320B (en) Apparatus and method for recovering a failed database data set
CN103946809B (en) Product servers load activity is produced for testing service device
CN111124755A (en) Cluster node fault recovery method and device, electronic equipment and storage medium
CN105373340A (en) System and method for secure multi-tenancy in operating system of a storage system
CN106605217B (en) For the method and system for being moved to another website from a website will to be applied
CN108123851A (en) The lifetime detection method and device of main and subordinate node synchronization link in distributed system
CN108563440A (en) The automatic adding method of List Controller code, device and readable storage medium storing program for executing
CN108228813A (en) The delet method and device of replica database in distributed system
CN108038153A (en) The online data moving method and device of Hbase
CN104917798A (en) Data updating method and system
US9037821B1 (en) Systems and methods for replicating snapshots across backup domains
CN108363727A (en) A kind of date storage method and device based on ZFS file system
EP2372552B1 (en) Automated relocation of in-use multi-site protected data storage
CN104462290A (en) File system copying method and device
CN112131177A (en) Data migration method and device, storage medium and electronic equipment
CN103645968A (en) Browser status restoration method and device
CN106557383A (en) A kind of method and device of data recovery
CN110413587A (en) A kind of method and apparatus of aging history data
CN105787135A (en) Method and device for backing up database logs
CN116383161A (en) File synchronization method, device and medium
CN109814911A (en) Method, apparatus, computer equipment and storage medium for Manage Scripts program
CN109241071A (en) A kind of Android database upgrade method, apparatus and terminal
CN113157414A (en) Task processing method and device, nonvolatile storage medium and processor
CN113778975A (en) Data processing method and device based on distributed database

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant