CN105630875A - File restoration method and device - Google Patents
File restoration method and device Download PDFInfo
- Publication number
- CN105630875A CN105630875A CN201510953865.4A CN201510953865A CN105630875A CN 105630875 A CN105630875 A CN 105630875A CN 201510953865 A CN201510953865 A CN 201510953865A CN 105630875 A CN105630875 A CN 105630875A
- Authority
- CN
- China
- Prior art keywords
- file
- repaired
- lock
- described target
- reparation
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/13—File access structures, e.g. distributed indices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a file restoration method and system. The method comprises the following steps: limiting the locking of a restoration process, when the restoration process tries to lock a file, if the lock has a user, directly considering that the locking fails without queuing up to seize the lock, and waiting to try during the next restoration; and after the locking of the restoration process succeeds, setting the attribute of the lock to be seizable. According to the file restoration method and device, the locks possessed by normal businesses are prevented from being seized by restoration processes, the condition of waiting to restore to release the locks of the normal businesses is avoided, the problem that the execution of faulted file restoration processes causes the process response time of the normal businesses to be prolonged is solved, and the influences, caused by data restoration, on the normal businesses are reduced.
Description
Technical field
The present invention relates to data processing field, particularly relate to a kind of Ile repair method and device.
Background technology
During file system initial design, it is only for the local file service in LAN. And service area be extend to whole network by distributed file system. Not only change storage and the way to manage of file, also have data backup that local file system cannot possess, the data advantage such as safely. Distributed file system generally comprises client, meta data server and data server, and client is responsible for the access interface of file and is formulated, and meta data server is responsible for processing layout and the attribute of file, and data server is responsible for the data content of storage file.
For distributed file system, ensureing that on the basis of data reliability, " height is handled up, low latency " is important performance requirement. In order to realize high concurrent lock mechanism affairs, need to use Read-Write Locks that distributed file system is carried out con current control, Read-Write Locks is really a kind of special spin lock, it is the visitor of shared resource is divided into reader and writer, shared resource is only carried out read access by reader, and writer then needs shared resource is carried out write operation. This phase-locked for spin lock, concurrency can be improved, because in a multi-processor system, it allows there is multiple reader to access shared resource simultaneously, and reader's number of maximum possible is actual logic CPU number. Writer is exclusiveness, and a Read-Write Locks can only have a writer or multiple reader (relevant to CPU number) simultaneously, but existing reader can not have again writer simultaneously. Reader is referred to as resource read lock, and writer is referred to as resource is added to write lock.
In order to ensure the concordance of data, the file in distributed system is repaired requirements of process and is carried out under lock protection, and normal file access flow process is also required to carry out under lock protection. In prior art, if the lock that normal file browsing process is held is repaired flow process by file and seized, then need again to lock; If normal file browsing process needs the lock added held by file reparation flow process, then, after needing pending file to repair flow process release lock, just can be normally carried out. Both of these case all can make the response time of normal file browsing process extend, and affects the performance of regular traffic.
Summary of the invention
The embodiment of the present invention proposes and solves the technical scheme of the problem that the execution of fault file reparation flow process can cause regular traffic flow process response time to extend in distributed file system.
In one aspect, embodiments provide a kind of Ile repair method, including:
When file repair operation in described distributed file system is triggered, if target is repaired file and is locked protection, then file repairing failure;
If described target repairs file not by lock protection, described target is repaired file and performs to add latching operation, lock attribute is set for seizing, described target is repaired file and repairs.
In yet another aspect, embodiments provide a kind of file prosthetic device, including:
Trigger module, for triggering the file repair operation in distributed file system;
Judge module, for when described file repair operation is triggered, it is judged that whether target repairs file by lock protection, if described target is repaired file and locked protection, then returns described file repair operation to described trigger module and triggers unsuccessfully;
Repair and control module, for when described target repairs file not by lock protection, described target being repaired file and performs to add latching operation, arrange lock attribute for seizing, described target is repaired file and repairs.
Current distributed file system also exists fault file and repairs the problem that the execution of flow process can cause normal file browsing process response time to extend, the locking repairing flow process is limited by the embodiment of the present invention, when repairing flow process and attempting file locking, if this is latched in user, then do not queue up and seize lock, but directly failure, wait that next round is attempted when repairing again; Lock after successfully when repairing flow process, lock attribute is set for seizing, it is repaired flow process seizes thus avoiding the lock that regular traffic holds, and the situation of the release lock to be repaired such as regular traffic, solve fault file and repair the problem that the execution of flow process can cause regular traffic flow process response time to extend, reduce the data reparation impact on regular traffic.
Accompanying drawing explanation
Specific embodiments of the invention are described below with reference to accompanying drawings, wherein:
Fig. 1 illustrates the schematic flow sheet of embodiment of the present invention file restorative procedure;
Fig. 2 illustrates the structural representation of embodiment of the present invention file prosthetic device.
Detailed description of the invention
In order to make technical scheme and advantage clearly understand, below in conjunction with accompanying drawing, the exemplary embodiment of the present invention is described in more detail, obviously, described embodiment is only a part of embodiment of the present invention, rather than all embodiments is exhaustive. And when not conflicting, the embodiment in this explanation and the feature in embodiment can be combined with each other.
Inventor note that the concordance in order to ensure data in invention process, and the file in distributed system is repaired requirements of process and carried out under lock protection, and normal file access flow process is also required to carry out under lock protection. If the lock that normal file browsing process is held is repaired flow process by file and seized, then need again to lock; If normal file browsing process needs the lock added held by file reparation flow process, then, after needing pending file to repair flow process release lock, just can be normally carried out. Both of these case all can make the response time of normal file browsing process extend, and affects the performance of regular traffic.
For above-mentioned deficiency/based on this, the embodiment of the present invention proposes a kind of Ile repair method, is illustrated below.
Fig. 1 illustrates the schematic flow sheet of embodiment of the present invention file restorative procedure, as it can be seen, include:
Step 101, in distributed system target repair document creation repair task, the distributed system mentioned in the embodiment of the present invention can adopt the distributed file system based on Long Teng server;
After file repair operation in step 102, distributed file system is triggered, it is judged that whether target repairs file by lock protection, if so, performs step 103, otherwise, performs step 104;
Step 103, file repairing failure, wait that next round file reparation is triggered, return step 102.
Step 104, to target repair file perform add latching operation, arrange lock attribute for seizing, to target reparation file repair.
Relative to traditional way, the locking repairing flow process is limited by the present invention, when repairing flow process and attempting file locking, if this is latched in user, does not then queue up and seizes lock, but directly failure, wait that next round is attempted when repairing again; Locks after successfully when repairing flow process, lock attribute is set for seizing, be repaired flow process seize thus avoiding the lock that regular traffic holds, and the situation about locking that discharges to be repaired such as regular traffic, reduce the data reparation impact on regular traffic.
Further, lock successfully when repairing flow process, after lock attribute is set to seize, when regular traffic needs target reparation file is modified, if target is repaired file and is repaired, it is invalid to be then set to by the lock of file reparation, target is repaired file simultaneously and performs to add to write latching operation, with this effect reaching to seize lock.
Further, in order to ensure that smoothly completing of task repaired by file, after target is repaired in file repair procedures and/or has been repaired, check whether the lock of file reparation is preempted, if the lock of file reparation is preempted, target is then repaired file again perform to add latching operation, and locking after successfully, again target is repaired file and performs to repair operation; After target is repaired in file repair procedures and/or repaired, the lock of file reparation is not preempted, then, after file reparation completes, this document is labeled, and next round file no longer repairs this document when repairing.
Based on same inventive concept, the embodiment of the present invention additionally provides a kind of file prosthetic device, owing to the principle of these equipment solution problem is similar to a kind of Ile repair method, therefore the enforcement of these equipment may refer to the enforcement of method, repeats part and repeats no more.
Fig. 2 illustrates the structural representation of embodiment of the present invention file prosthetic device; As it can be seen, device may include that
Trigger module, for triggering the file repair operation in distributed file system;
Judge module, for when file repair operation is triggered, it is judged that whether target repairs file by lock protection, if described target is repaired file and locked protection, then returns file repair operation to described trigger module and triggers unsuccessfully;
Repair and control module, for when described target repairs file not by lock protection, described target being repaired file and performs to add latching operation, arrange lock attribute for seizing, target is repaired file and repairs.
Further, embodiment of the present invention file prosthetic device also includes:
Regular traffic processing module, for when target reparation file is modified by regular traffic, if target is repaired file and is repaired, then it is invalid to be set to by the lock that described file is repaired, target is repaired file simultaneously perform to add to write latching operation, with this effect reaching to seize lock.
Further, in order to ensure that smoothly completing of task repaired by file, repair and control module after target is repaired in file repair procedures and/or repaired, check whether the lock of described file reparation is preempted, if the lock of file reparation is preempted, target is then repaired file again perform to add latching operation, locking after successfully, again described target is being repaired file and repair. If after target is repaired in file repair procedures and/or repaired, the lock of file reparation is not preempted, then repair and control module after file reparation completes, this document is labeled, and next round file no longer repairs this document when repairing.
In above-described embodiment, existing Functional Unit device blocks all can be adopted to implement. Such as, trigger module, judge module all can adopt existing Digital Logical Circuits to realize, latching operation is added as what reparation control module and regular traffic processing module carried out, detection etc. seized by lock is all the technological means that those skilled in the art comparatively commonly use, and those skilled in the art design and develop can realize through accordingly.
For convenience of description, each several part of apparatus described above is divided into various module or unit to be respectively described with function. Certainly, the function of each module or unit can be realized in same or multiple softwares or hardware when implementing the present invention.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program. Therefore, the present invention can adopt the form of complete hardware embodiment, complete software implementation or the embodiment in conjunction with software and hardware aspect. And, the present invention can adopt the form at one or more upper computer programs implemented of computer-usable storage medium (including but not limited to disk memory, CD-ROM, optical memory etc.) wherein including computer usable program code.
The present invention is that flow chart and/or block diagram with reference to method according to embodiments of the present invention, equipment (system) and computer program describe. It should be understood that can by the combination of the flow process in each flow process in computer program instructions flowchart and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame. These computer program instructions can be provided to produce a machine to the processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device so that the instruction performed by the processor of computer or other programmable data processing device is produced for realizing the device of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and can guide in the computer-readable memory that computer or other programmable data processing device work in a specific way, the instruction making to be stored in this computer-readable memory produces to include the manufacture of command device, and this command device realizes the function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices provides for realizing the step of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
Although preferred embodiments of the present invention have been described, but those skilled in the art are once know basic creative concept, then these embodiments can be made other change and amendment. So, claims are intended to be construed to include preferred embodiment and fall into all changes and the amendment of the scope of the invention.
Claims (10)
1. an Ile repair method, in distributed file system, it is characterised in that including:
When file repair operation in described distributed file system is triggered, if target is repaired file and is locked protection, then file repairing failure;
If described target repairs file not by lock protection, described target is repaired file and performs to add latching operation, lock attribute is set for seizing, described target is repaired file and repairs.
2. the method for claim 1, it is characterised in that after described file repairing failure, waits that again described target being repaired file when next round file reparation is triggered repairs.
3. the method for claim 1, it is characterised in that described method farther includes:
When described target reparation file is modified by regular traffic, if described target is repaired file and is repaired, then it is invalid to be set to by the lock that described file is repaired, and described target is repaired file simultaneously and performs to add latching operation.
4. method as claimed in claim 3, it is characterised in that described regular traffic described target is repaired file perform described in add latching operation and write latching operation for adding.
5. the method for claim 1, it is characterised in that described method farther includes:
After described target is repaired in file repair procedures and/or has been repaired, check whether the lock of described file reparation is preempted, if the lock of described file reparation is preempted, described target is then repaired file again perform to add latching operation, locking after successfully, again described target is being repaired file and repair.
6. method as claimed in claim 5, it is characterised in that after the reparation file reparation of described target completes, if the lock of described file reparation is not preempted, then described target repairs file access pattern is normal, and next round file no longer repairs this document when repairing.
7. a file prosthetic device, in distributed file system, it is characterised in that including:
Trigger module, for triggering the file repair operation in distributed file system;
Judge module, for when described file repair operation is triggered, it is judged that whether target repairs file by lock protection, if described target is repaired file and locked protection, then returns described file repair operation to described trigger module and triggers unsuccessfully;
Repair and control module, for when described target repairs file not by lock protection, described target being repaired file and performs to add latching operation, arrange lock attribute for seizing, described target is repaired file and repairs.
8. device as claimed in claim 7, it is characterised in that also include:
Regular traffic processing module, for when described target reparation file is modified by regular traffic, if described target is repaired file and is repaired, then it is invalid to be set to by the lock that described file is repaired, and described target is repaired file simultaneously and performs to add latching operation.
9. device as claimed in claim 7, it is characterized in that, described reparation controls module after described target is repaired in file repair procedures and/or repaired, check whether the lock of described file reparation is preempted, if the lock of described file reparation is preempted, described target is then repaired file again perform to add latching operation, locking after successfully, again described target is being repaired file and repair.
10. device as claimed in claim 9, it is characterised in that described reparation controls module after the reparation file reparation of described target completes, if the lock of described file reparation is not preempted, then next round file no longer repairs this document when repairing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510953865.4A CN105630875A (en) | 2015-12-17 | 2015-12-17 | File restoration method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510953865.4A CN105630875A (en) | 2015-12-17 | 2015-12-17 | File restoration method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105630875A true CN105630875A (en) | 2016-06-01 |
Family
ID=56045808
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510953865.4A Pending CN105630875A (en) | 2015-12-17 | 2015-12-17 | File restoration method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105630875A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7206776B2 (en) * | 2002-08-15 | 2007-04-17 | Microsoft Corporation | Priority differentiated subtree locking |
US7933976B2 (en) * | 2007-10-25 | 2011-04-26 | International Business Machines Corporation | Checkpoint and restart of NFS version 2/version 3 clients with network state preservation inside a workload partition (WPAR) |
CN102968486A (en) * | 2012-11-26 | 2013-03-13 | 国电南瑞科技股份有限公司 | High-reliability file synchronization method based on log change |
CN103218258A (en) * | 2011-12-07 | 2013-07-24 | 三星电子株式会社 | Apparatus and method for dynamically controlling preemption section in operating system |
CN103488526A (en) * | 2013-09-02 | 2014-01-01 | 用友软件股份有限公司 | System and method for locking business resource in distributed system |
CN105160253A (en) * | 2015-09-29 | 2015-12-16 | 网易(杭州)网络有限公司 | Client program restoration method, apparatus and system and server |
-
2015
- 2015-12-17 CN CN201510953865.4A patent/CN105630875A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7206776B2 (en) * | 2002-08-15 | 2007-04-17 | Microsoft Corporation | Priority differentiated subtree locking |
US7933976B2 (en) * | 2007-10-25 | 2011-04-26 | International Business Machines Corporation | Checkpoint and restart of NFS version 2/version 3 clients with network state preservation inside a workload partition (WPAR) |
CN103218258A (en) * | 2011-12-07 | 2013-07-24 | 三星电子株式会社 | Apparatus and method for dynamically controlling preemption section in operating system |
CN102968486A (en) * | 2012-11-26 | 2013-03-13 | 国电南瑞科技股份有限公司 | High-reliability file synchronization method based on log change |
CN103488526A (en) * | 2013-09-02 | 2014-01-01 | 用友软件股份有限公司 | System and method for locking business resource in distributed system |
CN105160253A (en) * | 2015-09-29 | 2015-12-16 | 网易(杭州)网络有限公司 | Client program restoration method, apparatus and system and server |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107656834B (en) | System and method for recovering host access based on transaction log and storage medium | |
US9213562B2 (en) | Garbage collection safepoint system using non-blocking asynchronous I/O call to copy data when the garbage collection safepoint is not in progress or is completed | |
US10635473B2 (en) | Setting support program, setting support method, and setting support device | |
WO2020107829A1 (en) | Fault processing method, apparatus, distributed storage system, and storage medium | |
CN105988798B (en) | Patch processing method and device | |
CN109656724A (en) | Method for processing business, device, equipment and computer readable storage medium | |
US7818749B2 (en) | Data processing method, data processing apparatus, and data processing program | |
CN113568566A (en) | Method, host device and storage server for seamless migration of simple storage service by using index object | |
US7353342B1 (en) | Shared lease instruction support for transient blocking synchronization | |
EP4318211A1 (en) | Method for inspecting code under weak memory order architecture, and corresponding device | |
CN115543643A (en) | Distributed lock reentry execution method, device, equipment and readable storage medium | |
CN111666088A (en) | Pod replacement method and device, electronic equipment and computer-readable storage medium | |
WO2022242372A1 (en) | Object processing method and apparatus, computer device, and storage medium | |
CN103377125A (en) | Code testing method, device and system | |
CN110941591A (en) | File deletion method, device and equipment and readable storage medium | |
CN111241594B (en) | Method, device, computer equipment and storage medium for signing transaction information | |
US8689206B2 (en) | Isolating operating system in-memory modules using error injection | |
CN105630875A (en) | File restoration method and device | |
US9507817B2 (en) | Method for synchronizing access to shared resources of a computing system and detecting and eliminating deadlocks using lock files | |
KR102123616B1 (en) | Method and apparatus for parallel journaling using conflict page list | |
CN114461409A (en) | Auxiliary analysis method, system and storage medium for abnormal blocking of mutual exclusion semaphore | |
CN114265637A (en) | Archive management system configuration method, system, electronic device and storage medium | |
US9575986B2 (en) | Method for managing design files shared by multiple users and system thereof | |
CN106055322A (en) | Flow scheduling method and device | |
CN117077447B (en) | Multi-seat collaborative desired editing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160601 |
|
RJ01 | Rejection of invention patent application after publication |