CN112905556B - Directory lease management method, device, equipment and storage medium for distributed system - Google Patents

Directory lease management method, device, equipment and storage medium for distributed system Download PDF

Info

Publication number
CN112905556B
CN112905556B CN202110179207.XA CN202110179207A CN112905556B CN 112905556 B CN112905556 B CN 112905556B CN 202110179207 A CN202110179207 A CN 202110179207A CN 112905556 B CN112905556 B CN 112905556B
Authority
CN
China
Prior art keywords
lease
directory
authority
metadata server
directory operation
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.)
Active
Application number
CN202110179207.XA
Other languages
Chinese (zh)
Other versions
CN112905556A (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.)
Shandong Yingxin Computer Technology Co Ltd
Original Assignee
Shandong Yingxin Computer 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 Shandong Yingxin Computer Technology Co Ltd filed Critical Shandong Yingxin Computer Technology Co Ltd
Priority to CN202110179207.XA priority Critical patent/CN112905556B/en
Publication of CN112905556A publication Critical patent/CN112905556A/en
Application granted granted Critical
Publication of CN112905556B publication Critical patent/CN112905556B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3034Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a storage system, e.g. DASD based or network based
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2137Time limited access, e.g. to a computer or data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Abstract

The invention discloses a method, a device, equipment and a storage medium for managing directory lease of a distributed system. The method comprises the following steps: monitoring lease duration of the directory operation authority by using a first timing task, wherein the directory operation authority is a read sharing authority or a modification authority; if the lease duration reaches a first preset threshold, applying for lease renewal to the metadata server; if the contract is successfully renewed, returning to the step of monitoring the lease duration of the directory operation authority by using the first timing task; and if the lease duration reaches a second preset threshold value which is larger than the first preset threshold value, recovering the directory operation authority and the lease by using the metadata server. In the scheme of the invention, the time of the directory operation authority is not a fixed valid period but a variable elastic time, so that the interaction times of the metadata server and the client are reduced to a certain extent, the response capability of the client and the usability of a distributed system are improved, and the problem that other clients are influenced by the fault of the client is avoided.

Description

Directory lease management method, device, equipment and storage medium for distributed system
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for managing a directory lease in a distributed system.
Background
In recent years, with the ever-increasing data storage demand, the amount of file data managed by enterprises is increased, and at present, a distributed storage system is mainly adopted for file management, and directory consistency maintained by multiple clients is required in the distributed storage system. At present, before operating a directory, a client needs to apply for a corresponding right to a metadata server and give a lease with a fixed duration, where a lease means that a server gives the right that the client is a use right within a certain period.
However, the existing fixed-duration lease has the following problems: firstly, when other clients create or delete files or directories in the directory, metadata needs to recover directory permissions held by other clients, after the other clients release the directory permissions, the clients applying the directory permissions are authorized to have corresponding permissions, and when abnormal conditions such as network faults, shutdown of client nodes or no response of client processes occur, the clients cannot respond to the metadata server to recover the directory permission information in time to release the permissions, and the clients applying the directory permissions are blocked or blocked for a long time, so that the response capability and usability requirements of the distributed system are seriously influenced; secondly, after the client needs to check the file and subdirectory list under the directory and applies for permission, the directory permission is released after the checking is finished, when the file and subdirectory list under the directory or the metadata information is checked again by the same client within a short time interval, the permission needs to be applied again, the interaction times and pressure of the metadata server are increased, when the pressure of the metadata server is higher, the permission application request can be delayed and responded, the use of the client is influenced, the usability of a distributed system is reduced, and the pressure of the metadata server is increased.
Disclosure of Invention
In view of the above, there is a need to provide a method, an apparatus, a device and a storage medium for managing a directory lease in a distributed system, which can ensure consistent directories and make the duration of the directory operation authority flexible.
According to a first aspect of the present invention, there is provided a directory lease management method for a distributed system, the method comprising:
monitoring lease duration of a directory operation authority by using a first timing task, wherein the directory operation authority is a read sharing authority or a modification authority;
if the lease duration reaches a first preset threshold, applying for a lease to a metadata server;
if the contract is successfully renewed, returning to the step of monitoring the lease duration of the directory operation authority by using the first timing task;
and if the lease duration reaches a second preset threshold which is larger than the first preset threshold, recovering the directory operation authority and the lease by using a metadata server.
In one embodiment, the method further comprises:
monitoring the idle duration of the directory in which the client stops operating by using a second timing task;
and if the idle duration reaches a third preset threshold, recovering the directory operation authority and the lease by using the metadata server.
In one embodiment, the method further comprises:
if the lease duration time does not reach a first preset threshold value and the metadata server receives a directory operation permission application of a target client, recovering the issued modification permission by using the metadata server;
and if the metadata server finishes recovering the issued modification authority, determining a directory operation type based on the directory operation authority application of the target client, and issuing a read sharing authority or a modification authority and a lease corresponding to the read sharing authority or the modification authority by using the metadata server based on the directory operation type.
In one embodiment, the method further comprises:
and if the metadata server does not receive the response result of the client to the recovery of the issued modification permission and the lease duration of the issued modification permission is greater than the second preset threshold, the metadata server clears the issued modification permission.
In one embodiment, the method further comprises:
and if the application of the directory operation authority of the target client fails, the application of the directory operation authority of the target client is sent to the metadata server again after waiting for a preset interval time.
In one embodiment, the method further comprises:
counting the number of times of applying the directory operation authority of the target client;
and if the number of times of applying the directory operation authority exceeds the preset number of times, the target client cancels the sending of the directory operation authority application and sends out an error alarm.
In one embodiment, the read sharing permission comprises permission to view files under the directory, permission to view a list of subdirectories of the directory, and the modification permission comprises creation and deletion of files under the directory, creation and deletion of subdirectories of the directory, and modification of subdirectory metadata attributes.
According to a second aspect of the invention, there is provided a directory lease management apparatus for a distributed system, the apparatus comprising:
the time monitoring module is used for monitoring lease duration of the directory operation authority by utilizing a first timing task, wherein the directory operation authority is a read sharing authority or a modification authority;
the lease duration time reaches a first preset threshold value, and the lease duration time is used for applying for lease renewal to the metadata server;
the returning module is used for returning and utilizing the time monitoring module to monitor the lease duration of the directory operation authority if the lease is successful;
a recovery module for recovering the residual water from the water tank, for when the lease duration reaches a second preset threshold greater than the first preset threshold, the directory operation rights and leases are reclaimed using the metadata server.
According to a third aspect of the present invention, there is also provided a computer apparatus comprising:
at least one processor; and
the memory stores a computer program operable on the processor, and the processor executes the program to perform the aforementioned directory lease management method for the distributed system.
According to a fourth aspect of the present invention, there is also provided a computer-readable storage medium storing a computer program which, when executed by a processor, performs the aforementioned directory lease management method for a distributed system.
The method for managing the directory lease of the distributed system comprises the steps of monitoring the lease duration of directory operation permission by using a first timing task, applying for a lease to a metadata server if the lease duration reaches a first preset threshold, returning to the step of monitoring the lease duration of the directory operation permission by using the first timing task if the lease duration is successful, and recovering the directory operation permission and the lease by using the metadata server if the lease duration reaches a second preset threshold which is larger than the first preset threshold, so that the time of the directory operation permission is not a fixed effective period but a variable elastic time, interaction times of the metadata server and a client are reduced to a certain extent, the response capability of the client and the usability and robustness of the distributed system are improved, and the problem that other clients are influenced by faults of the client is avoided.
In addition, the invention also provides a directory lease management device, a computer device and a computer readable storage medium of the distributed system, which can also realize the technical effects and are not described again.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a directory lease management method of a distributed system according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a directory lease management apparatus of a distributed system according to another embodiment of the present invention;
fig. 3 is an internal structural view of a computer device in another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are only used for convenience of expression and should not be construed as a limitation to the embodiments of the present invention, and no description is given in the following embodiments.
In an embodiment, referring to fig. 1, the present invention provides a directory lease management method for a distributed system, including:
s100, monitoring lease duration of a directory operation authority by using a first timing task, wherein the directory operation authority is a read sharing authority or a modification authority;
preferably, the read sharing permission comprises permission to view files under the directory, permission to view a list of subdirectories of the directory, and the modification permission comprises creation and deletion of files under the directory, creation and deletion of subdirectories of the directory, and attribute modification of metadata of the subdirectories.
S200, if the lease duration reaches a first preset threshold, applying for lease continuation to a metadata server;
the lease refers to re-requesting to issue a lease, for example, a right that a certain client holds file creation and a lease corresponding to the right are issued, the lease refers to re-requesting the metadata server to re-issue the lease, a limited period is usually specified in the lease, and the created right that the client holds can be extended by the lease issued after the lease.
S300, if the contract is successfully renewed, returning to the step of monitoring the lease duration of the directory operation permission by using the first timing task; wherein, after each successful lease renewal, the duration of the lease renewal is monitored again as a new lease;
and S400, if the lease duration reaches a second preset threshold which is larger than the first preset threshold, recovering the directory operation authority and the lease by using a metadata server.
The method for managing the directory lease of the distributed system comprises the steps of monitoring the lease duration of directory operation permission by using a first timing task, applying for renewal to a metadata server if the lease duration reaches a first preset threshold, returning to the step of monitoring the lease duration of the directory operation permission by using the first timing task if the lease duration is successful, and recovering the directory operation permission and the lease by using the metadata server if the lease duration reaches a second preset threshold, so that the time of the directory operation permission is not a fixed effective period but is variable flexible time, interaction times of the metadata server and a client are reduced to a certain extent, the response capability of the client is improved, the usability and the robustness of the distributed system are improved, and the problem that other clients are influenced by faults of the client is avoided.
In yet another embodiment, the method of the present invention further comprises the steps of:
s510, monitoring the idle duration of the directory in which the client stops operating by using a second timing task;
and S520, if the idle duration reaches a third preset threshold, recovering the directory operation authority and the lease by using the metadata server.
For example, suppose a certain client obtains the authority of file creation, at this time, the client performs corresponding file creation operation after obtaining the authority, suppose that the user performs file creation twice at an interval of 3 seconds continuously, and no subsequent operation can automatically release the authority and lease of the user within 10 seconds after the 2 nd file creation, thereby avoiding the influence of occupying resources for a long time or the influence on the speed of applying for the authority by other users.
In yet another embodiment, the method further comprises the steps of:
s610, if the lease duration time does not reach a first preset threshold value and the metadata server receives a directory operation permission application of a target client, recovering the issued modification permission by using the metadata server;
s620, if the metadata server finishes recovering the issued modification authority, determining a directory operation type based on the directory operation authority application of the target client, and issuing a read sharing authority or a modification authority and a lease corresponding to the read sharing authority or the modification authority based on the directory operation type by using the metadata server.
Preferably, the method further comprises:
s630, if the metadata server does not receive the response result of the client to the recovery of the issued modification permission and the lease duration of the issued modification permission is greater than the second preset threshold, the metadata server clears the issued modification permission.
In yet another embodiment, the method further comprises:
and S710, if the application of the directory operation authority of the target client fails, the application of the directory operation authority of the target client is sent again to the metadata server after waiting for a preset interval time.
Preferably, the method further comprises:
s720, counting the number of times of applying the directory operation authority of the target client;
and S730, if the number of times of the application of the directory operation authority exceeds the preset number of times, the target client cancels the sending of the application of the directory operation authority, and sends an error alarm.
In another embodiment, in order to facilitate understanding of the technical solution of the present invention, the following describes an interactive process and a response process of the client and the user, respectively.
The interaction process of the client and the metadata server comprises the following steps:
the method comprises the following steps: when accessing a directory of a distributed system, a client requests directory access authority and lease from a metadata server;
step two: after receiving the request, the metadata server traverses a client authority table Cap _ Map < key recorded in metadata information corresponding to the directory, wherein the client unique identification ID, the value and the authority information Cap _ Info > are used for checking whether a mutual exclusion operation causing the change of files or subdirectories under the directory exists, the mutual exclusion operation refers to an operation corresponding to the modification authority, and if the mutual exclusion operation exists, a message for recovering the authority is sent to the client one by one;
step three: after the authority recovery is successful, the metadata server updates the Cap _ Map table information and deletes the Lease table Lease _ Map < key recorded by the directory metadata information, wherein the Lease table Lease _ Map < key comprises the unique identification ID of the client, the value is the Lease information corresponding to the client in the directory Lease information Lease _ Info >;
step four: if the client does not respond to the information of the recovery authority and the lease is overdue in the process of recovering the authority of the client by the metadata server, directly deleting the authority information and the lease information corresponding to the client;
step five: after the metadata service finishes permission recovery and lease update of all other clients, issuing permissions and elastic leases to the client applying for the directory permissions;
step six: if the metadata server does not check the exclusive operation causing the change of the files or the subdirectories under the directory, the metadata server issues the authority to the client applying the authority and a Lease according to the operation type, and updates the Cap _ Map and the Lease _ Map in the metadata information of the directory.
Step seven: after receiving the authority and Lease information issued by the metadata server, the client updates a local Lease information table, namely, lease _ Info < key, namely, a directory inode number, value, namely, lease information >, and then accesses and operates the directory;
step eight: if the message of the metadata server recovery authority is received in the process of operating the directory, the authority and the directory lease are released after the current operation is finished; when the client does not receive the recovery authority message after completing the directory access, the client regularly traverses the Lease _ Info table, if the first preset threshold of the Lease is reached, the client applies for a renewal operation to the metadata server, and the renewal succeeds in updating the local Lease _ Info table information of the client; if the renewal fails, the directory authority and Lease information are actively released, and a local Lease _ Map table is updated, and a metadata server is informed of relevant operations such as recovery authority and Lease; and when the directory Lease exceeds a second preset threshold value, actively releasing the authority and the Lease, updating the client end Lease _ Info table and informing the metadata server of recovering and updating the directory authority Cap _ Map and the Lease Lease _ Map.
(II) the client prolongs the use time of the authority through the continuous operation, and mainly comprises the following steps:
the method comprises the following steps: running a distributed system and a client program;
step two: the client accesses the directory of the distributed system and requests directory access authority and lease from the metadata server;
step three: waiting for the metadata server to return a result;
step four: if the application fails, retrying after delaying for a certain time, and reporting an error to quit after reaching the upper limit of the retrying;
step five: if the application is successful, the directory is accessed and operated after the local Lease information table Lease _ Info is updated;
step six: when receiving the message of recovering the authority and the lease of the metadata server in the process of accessing the directory, actively releasing the authority and the lease after the current operation is finished;
step seven: updating a client local Lease _ Info table and informing a metadata server of permission and Lease recovery;
step eight: scanning an Lease _ Info table at fixed time by a fixed time task, and applying for Lease renewal to a metadata server if the directory Lease is close to a soft threshold;
step nine: if the Lease is successful, updating Lease information of the directory of the client Lease _ Info table;
step ten: if the renewal fails, actively releasing the directory authority and the Lease, updating the Lease _ Info and informing the metadata server of recovering the authority and the Lease;
step eleven: and if the directory Lease is close to the hard threshold, deleting Lease information of the directory in the client Lease _ Info table, and informing the metadata server of the recovery authority and Lease.
And (III) the metadata data server side is responsible for directory authority and lease authorization and recovery management, and the method mainly comprises the following steps:
the method comprises the following steps: receiving a client side application directory authority and lease message;
step two: traversing Cap _ Map information in the directory metadata information;
step three: checking whether a mutual exclusion operation causing the change of files or subdirectories under the directory exists;
step four: if yes, performing the step (five);
step five: sending messages one by one to recover client rights and leases;
step six: when the directory authority is recovered, if the lease of the client is overdue, deleting the authority and lease information of the client;
step seven: after all other client side authorities are recovered, replying a message authorization flexible lease and a directory authority to the client side;
step eight: updating the Cap _ Map and the Lease _ Map after the authorization is successful;
step nine: and if the mutual exclusion operation does not exist, authorizing the authority and the elastic Lease to the client and updating the Cap _ Map and the Lease _ Map.
The method of the invention at least has the following technical effects: the lease time of the directory according to the operation right authority is changed into an elastic lease, the interaction times of the client and the metadata server are reduced, the problem that other clients are influenced due to client faults is solved, and the usability and the robustness of the distributed system are improved.
In another embodiment, referring to fig. 2, the invention provides a directory lease management apparatus 80 for a distributed system, the apparatus comprising:
the time monitoring module 81 is configured to monitor lease duration of a directory operation permission by using a first timing task, where the directory operation permission is a read sharing permission or a modification permission;
a renewal module 82, configured to apply for renewal to the metadata server when the lease duration reaches a first preset threshold;
the returning module 83 is used for returning and utilizing the time monitoring module to monitor the lease duration of the directory operation authority if the renewal is successful;
a recycling module 84, configured to recycle the directory operation authority and the lease by using the metadata server when the lease duration reaches a second preset threshold that is greater than the first preset threshold.
It should be noted that, for specific limitations of the directory lease management apparatus of the distributed system, reference may be made to the above limitations of the directory lease management method of the distributed system, and details thereof are not described herein again. The various modules in the directory lease management apparatus of the distributed system described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
According to another aspect of the present invention, a computer device is provided, and the computer device may be a server, and its internal structure is shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements the directory lease management method for a distributed system as described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (9)

1. A method for directory lease management in a distributed system, the method comprising:
monitoring lease duration of a directory operation authority by using a first timing task, wherein the directory operation authority is a read sharing authority or a modification authority;
if the lease duration reaches a first preset threshold, applying for lease continuation to a metadata server;
if the contract is successfully renewed, returning to the step of monitoring the lease duration of the directory operation authority by using the first timing task;
if the lease duration reaches a second preset threshold which is larger than the first preset threshold, recovering the directory operation authority and the lease by using a metadata server;
the method further comprises the following steps:
monitoring the idle duration of the directory in which the client stops operating by using a second timing task;
and if the idle duration reaches a third preset threshold, recovering the directory operation authority and the lease by using the metadata server.
2. The method of claim 1, further comprising:
if the lease duration time does not reach a first preset threshold value and the metadata server receives a directory operation permission application of a target client, recovering the issued modification permission by using the metadata server;
and if the metadata server finishes recovering the issued modification authority, determining a directory operation type based on the directory operation authority application of the target client, and issuing a read sharing authority or a modification authority and a lease corresponding to the read sharing authority or the modification authority by using the metadata server based on the directory operation type.
3. The method of claim 2, further comprising:
and if the metadata server does not receive the response result of the client to the recovery of the issued modification permission and the lease duration of the issued modification permission is greater than the second preset threshold, the metadata server clears the issued modification permission.
4. The method of claim 2, further comprising:
and if the application of the directory operation authority of the target client fails, the application of the directory operation authority of the target client is sent to the metadata server again after waiting for a preset interval time.
5. The method of claim 4, further comprising:
counting the number of times of applying the directory operation authority of the target client;
and if the number of times of the application of the directory operation authority exceeds the preset number of times, the target client cancels the sending of the application of the directory operation authority and sends out an error alarm.
6. The method of claim 1, wherein the read sharing permissions include permission to view files under a directory, permission to view a list of subdirectories of a directory, and wherein the modification permissions include creation and deletion of files under a directory, creation and deletion of subdirectories of a directory, and modification of subdirectory metadata attributes.
7. An apparatus for managing directory leases in a distributed system, the apparatus comprising:
the time monitoring module is used for monitoring lease duration of the directory operation authority by utilizing a first timing task, wherein the directory operation authority is a read sharing authority or a modification authority;
the lease duration time reaches a first preset threshold value, and the lease duration time is used for applying for lease renewal to the metadata server;
the returning module is used for returning and utilizing the time monitoring module to monitor the lease duration of the directory operation authority if the lease is successful;
the recovery module is used for recovering the directory operation authority and the lease by using the metadata server when the lease duration reaches a second preset threshold which is larger than the first preset threshold;
the apparatus also includes means for performing the steps of:
monitoring the idle duration of the directory in which the client stops operating by using a second timing task;
and if the idle duration reaches a third preset threshold, recovering the directory operation authority and the lease by using the metadata server.
8. A computer device, comprising:
at least one processor; and
a memory storing a computer program operable in the processor, the processor when executing the program performing the method of any of claims 1-6.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 6.
CN202110179207.XA 2021-02-09 2021-02-09 Directory lease management method, device, equipment and storage medium for distributed system Active CN112905556B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110179207.XA CN112905556B (en) 2021-02-09 2021-02-09 Directory lease management method, device, equipment and storage medium for distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110179207.XA CN112905556B (en) 2021-02-09 2021-02-09 Directory lease management method, device, equipment and storage medium for distributed system

Publications (2)

Publication Number Publication Date
CN112905556A CN112905556A (en) 2021-06-04
CN112905556B true CN112905556B (en) 2022-11-15

Family

ID=76123169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110179207.XA Active CN112905556B (en) 2021-02-09 2021-02-09 Directory lease management method, device, equipment and storage medium for distributed system

Country Status (1)

Country Link
CN (1) CN112905556B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115580610B (en) * 2022-09-22 2024-03-19 广州文远知行科技有限公司 Batch file uploading method, device, equipment and readable storage medium
CN115373905B (en) * 2022-10-24 2023-02-03 北京奥星贝斯科技有限公司 Lease transfer method, device and equipment between main copy and standby copy
CN115665175B (en) * 2022-12-26 2023-03-31 江苏苏宁银行股份有限公司 Distributed gateway system and transaction processing method thereof

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521224A (en) * 2010-09-17 2012-06-27 微软公司 Directory Leasing
CN107516048A (en) * 2016-06-16 2017-12-26 阿里巴巴集团控股有限公司 The method and apparatus of file access in a kind of control distributed file system
CN109274679A (en) * 2018-10-16 2019-01-25 郑州云海信息技术有限公司 A kind of access request recording method, device, equipment and readable storage medium storing program for executing
CN109583222A (en) * 2018-12-07 2019-04-05 浪潮(北京)电子信息产业有限公司 Distributed file system metadata service device recycles client jurisdiction method and device
CN110661902A (en) * 2019-09-26 2020-01-07 浪潮商用机器有限公司 Method for monitoring client renewal
CN110928841A (en) * 2019-11-27 2020-03-27 深信服科技股份有限公司 File operation control method, device, equipment and storage medium
CN111158597A (en) * 2019-12-28 2020-05-15 浪潮电子信息产业股份有限公司 Metadata reading method and device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103714183B (en) * 2014-01-10 2017-02-15 浪潮(北京)电子信息产业有限公司 Dynamic acquisition method and system for metadata lease time
CN106648903B (en) * 2017-01-03 2019-03-26 北京百度网讯科技有限公司 The method and apparatus for calling distributed file system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521224A (en) * 2010-09-17 2012-06-27 微软公司 Directory Leasing
CN107516048A (en) * 2016-06-16 2017-12-26 阿里巴巴集团控股有限公司 The method and apparatus of file access in a kind of control distributed file system
CN109274679A (en) * 2018-10-16 2019-01-25 郑州云海信息技术有限公司 A kind of access request recording method, device, equipment and readable storage medium storing program for executing
CN109583222A (en) * 2018-12-07 2019-04-05 浪潮(北京)电子信息产业有限公司 Distributed file system metadata service device recycles client jurisdiction method and device
CN110661902A (en) * 2019-09-26 2020-01-07 浪潮商用机器有限公司 Method for monitoring client renewal
CN110928841A (en) * 2019-11-27 2020-03-27 深信服科技股份有限公司 File operation control method, device, equipment and storage medium
CN111158597A (en) * 2019-12-28 2020-05-15 浪潮电子信息产业股份有限公司 Metadata reading method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112905556A (en) 2021-06-04

Similar Documents

Publication Publication Date Title
CN112905556B (en) Directory lease management method, device, equipment and storage medium for distributed system
US10896102B2 (en) Implementing secure communication in a distributed computing system
US10642694B2 (en) Monitoring containers in a distributed computing system
US9607001B2 (en) Automated failover of a metadata node in a distributed file system
US8499004B2 (en) File system with optimistic I/O operations on shared storage
CN108710681B (en) File acquisition method, device, equipment and storage medium
CN112052264B (en) Business data query method and device, electronic equipment and readable storage medium
CN109684273A (en) A kind of snapshot management method, apparatus, equipment and readable storage medium storing program for executing
CN104735091A (en) Linux system-based user access control method and device
CN106936623A (en) The management method of distributed cache system and cache cluster
CN112632029B (en) Data management method, device and equipment of distributed storage system
CN109460345B (en) Real-time data calculation method and system
CN111198856A (en) File management method and device, computer equipment and storage medium
CN101771671A (en) Method and device for interactive processing between content identity management servers
CN109697112B (en) Distributed intensive one-stop operating system and implementation method
CN110955492A (en) Service processing method and device based on container technology and computer equipment
CN105183799B (en) Authority management method and client
CN114138549A (en) Data backup and recovery method based on kubernets system
CN112632375B (en) Session information processing method, server and storage medium
CN115221156A (en) Database cluster capacity expansion method and device, computer equipment and storage medium
CN110471897B (en) File management method and device
CN111291300B (en) Webpage data processing method and device, webpage system and server
CN112698926A (en) Data processing method, device, equipment, storage medium and system
CN114048443A (en) User identity verification method and device and computer storage medium
CN114172903A (en) Node capacity expansion method, device, equipment and medium of slarm scheduling system

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