CN115510016A - Client response method, device and medium based on directory fragmentation - Google Patents

Client response method, device and medium based on directory fragmentation Download PDF

Info

Publication number
CN115510016A
CN115510016A CN202211295543.1A CN202211295543A CN115510016A CN 115510016 A CN115510016 A CN 115510016A CN 202211295543 A CN202211295543 A CN 202211295543A CN 115510016 A CN115510016 A CN 115510016A
Authority
CN
China
Prior art keywords
directory
metadata request
fragment
metadata
client
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
Application number
CN202211295543.1A
Other languages
Chinese (zh)
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.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data 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 Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202211295543.1A priority Critical patent/CN115510016A/en
Publication of CN115510016A publication Critical patent/CN115510016A/en
Pending legal-status Critical Current

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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/134Distributed indices

Abstract

The application discloses a client response method, a client response device and a client response medium based on directory fragments, which relate to the field of distributed file systems and are used for carrying out fragment processing on files in the distributed file system in advance in order to improve the client metadata response processing capacity of the distributed system, judging whether a directory fragment lock of each directory fragment is occupied or not according to the corresponding directory fragment after a metadata request sent by a client is received, and processing the metadata request if the directory fragment lock of each directory fragment is not occupied. Only whether the directory fragment corresponding to the metadata request is occupied needs to be judged, other directory fragments do not need to be considered, in the same time domain, the directory fragments are processed in parallel, the directory fragments in different time domains are not affected mutually, and the time domains are processed in parallel. The client side performs concurrent processing according to the number of the directory fragments, so that the metadata response concurrent processing capacity of the client side is improved, the consistency and the effectiveness of the metadata of the file are ensured, and the concurrent processing capacity of the distributed system is improved.

Description

Client response method, device and medium based on directory fragmentation
Technical Field
The present application relates to the field of distributed file systems, and in particular, to a client response method, apparatus, and medium based on directory fragmentation.
Background
Computers manage and store data through file systems, and data that people can acquire in the era of information explosion is exponentially increased, the method of expanding the storage capacity of the computer file system by simply increasing the number of hard disks is not satisfactory in the aspects of capacity size, capacity growth speed, data backup, data safety and the like. The distributed file system can effectively solve the storage and management problems of data: a certain file system fixed at a certain place is expanded to any multiple places/multiple file systems, and a plurality of nodes form a file system network. Each node may be distributed at different locations, with communication and data transfer between nodes over the network. When using a distributed file system, one does not need to care about which node the data is stored on or retrieved from, but only needs to manage and store the data in the file system as if using a local file system.
In order to ensure consistency and safety of metadata processing, a client response is currently processed in a single-threaded serial mode by adding a client lock, and meanwhile, order preservation of metadata requests and responses is improved. However, the single-thread serial processing causes the client metadata response processing concurrency capability to be low, which causes serious message blocking and is not beneficial to the high concurrency processing of the distributed file system.
Therefore, it is an urgent technical problem to be solved by those skilled in the art to improve the client metadata response processing capability of the distributed system.
Disclosure of Invention
The application aims to provide a client side concurrent response method, a client side concurrent response device and a client side concurrent response medium, wherein the client side metadata response processing capacity of a distributed system is improved.
In order to solve the technical problem, the present application provides a client side concurrent response method based on directory fragmentation, including:
receiving a metadata request sent by a client;
judging whether a directory fragment lock of a directory fragment corresponding to the metadata request is occupied;
if not, adding a directory fragment lock to the request file corresponding to the metadata request so that the request file processes the current metadata request.
Preferably, in the above concurrent client response method based on directory fragments, if a directory fragment lock of a directory fragment corresponding to the metadata request is occupied, the method further includes:
and adding the metadata request into a waiting task queue, and controlling a request file to process the current metadata request after the directory fragment lock is unoccupied.
Preferably, after receiving the metadata request sent by the client, the client concurrent response method based on the directory fragments further includes:
judging whether the metadata request relates to a time domain common variable;
and if so, adding a directory fragment lock to the directory fragment corresponding to the related time domain public variable.
Preferably, after receiving the metadata request sent by the client, the client concurrent response method based on the directory fragments further includes:
determining whether the metadata request relates to modifying the deleted content;
and if so, adding the current time domain to the time domain lock.
Preferably, after receiving the metadata request sent by the client, the client concurrent response method based on the directory shards further includes:
judging whether the metadata request is a query request;
if yes, only add the directory sharding lock to the current request file.
Preferably, the client concurrent response method based on the directory fragments receives a metadata request sent by a client, and before the method, the method further includes:
the directory file is fragmented and stored into the directory fragments;
a directory sharding lock is designed for each directory sharding, and the directory sharding locks are independent.
Preferably, the client side concurrent response method based on the directory fragment judges whether a directory fragment lock of a directory fragment corresponding to the metadata request is occupied, and includes:
acquiring the directory fragment where the metadata request is located according to the index information corresponding to the metadata request;
and judging whether the directory fragment lock of the directory fragment is occupied or not.
In order to solve the above technical problem, the present application further provides a client side concurrent response device based on directory fragments, including:
the receiving module is used for receiving a metadata request sent by a client;
the judging module is used for judging whether the directory fragment lock of the directory fragment corresponding to the metadata request is occupied or not; if not, triggering the processing module;
and the processing module is used for adding a directory fragment lock to the request file corresponding to the metadata request so as to enable the request file to process the current metadata request.
In order to solve the above technical problem, the present application further provides a client side concurrent response device based on directory fragments, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the client side concurrent response method based on the directory fragment when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the client-side concurrent response method based on directory shards are implemented.
The client side concurrent response method based on the directory shards comprises the steps of receiving a metadata request sent by a client side; judging whether a directory fragment lock of a directory fragment corresponding to the metadata request is occupied or not; if not, adding a directory fragment lock to the request file corresponding to the metadata request so that the request file processes the current metadata request. In advance, the files in the distributed file system are subjected to fragment processing, after a metadata request sent by a client is received, whether a directory fragment lock of the directory fragment is occupied or not is judged according to the corresponding directory fragment, and if the directory fragment lock of the directory fragment is not occupied, the metadata request can be processed. Only whether the directory fragment lock of the directory fragment corresponding to the metadata request is occupied needs to be judged, whether other directory fragments are processing other tasks does not need to be considered, namely, the directory fragments are processed in parallel in the same time domain, and the concurrency of client response is improved. In addition, the directory fragments in different time domains are not influenced mutually, and complete concurrence between the time domains can be realized. The client side performs concurrent processing according to the number of the directory fragments, so that the metadata response concurrent processing capacity of the client side is improved, and the consistency and the effectiveness of the metadata of the file are ensured, thereby improving the concurrent processing capacity of the distributed system.
In addition, the application also provides a device and a medium, which correspond to the method and have the same effects.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a client side concurrent response method based on directory fragmentation according to an embodiment of the present application;
fig. 2 is a structural diagram of a client side concurrent response apparatus based on directory fragmentation according to an embodiment of the present application;
fig. 3 is a structural diagram of another client side concurrent response apparatus based on directory fragmentation according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The core of the application is to provide a client side concurrent response method, device and medium based on directory fragmentation.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings.
Distributed File System (DFS) means that physical storage resources managed by a File System are not necessarily directly connected to a local node, but are connected to a node (which can be simply understood as a computer) through a computer network; or several different logical disk partitions or volume labels combined together to form a complete hierarchical file system. DFS provides a logical tree file system structure for resources distributed at any position on the network, so that users can access shared files distributed on the network more conveniently. The role of an individual DFS shared folder is relative to the access points through other shared folders on the network. The distributed file system disperses a large amount of data to different nodes for storage, thereby greatly reducing the risk of data loss. The distributed file system has redundancy, the failure of part of nodes does not affect the normal operation of the whole system, and even if the data stored in the failed computer is damaged, the damaged data can be recovered by other nodes. Thus, security is the most important feature of a distributed file system. The distributed file system connects a large number of scattered computers together through a network to form a huge computer cluster, so that all hosts can fully exert the value of the distributed file system. In addition, computers outside the cluster can be added into the distributed file system only through simple configuration, and the extensible capability is very strong.
The distributed file system architecture is mainly oriented to a set of strategy schemes adopted by a cluster system. Mainly considered are read-write performance, data disaster recovery backup, single-point failure avoidance, data backup, data fault-tolerant recovery and the like. The distributed file system client refers to a distributed file system, and a matched access terminal is needed to enable a user to access the distributed file system, and at present, two methods are mainstream, one is a Native client (Native client), and the other is a protocol gateway proxy service.
In order to ensure that a method or attribute can only be executed by the same thread at the same time under the high concurrency condition, the mutual exclusion control can be performed by using the functions related to the concurrent processing under the condition of single-body application single-machine deployment in the prior art. However, with the need of business development, after the original single-unit deployed system is evolved into a distributed cluster system, since the distributed system is multi-threaded and multi-process and is distributed on different machines, the metadata response processing concurrency capability of the client is low, the message blocking is serious, and the high concurrency processing of the distributed file system is not facilitated.
To solve the above problem, this embodiment provides a client side concurrent response method based on directory shards, as shown in fig. 1, including:
s11: receiving a metadata request sent by a client;
s12: judging whether a directory fragment lock of a directory fragment corresponding to the metadata request is occupied or not;
if not, S13: and adding a directory fragment lock to a request file corresponding to the metadata request so that the request file processes the current metadata request.
The metadata request mentioned in this embodiment may be access, modification, deletion, and the like, and this embodiment is not particularly limited, and may be set according to actual needs.
It should be noted that the present application is implemented based on a C + +, operating system kernel (linux) environment, and a distributed file system.
In advance, the files in the distributed file system are subjected to fragment processing, after a metadata request sent by a client is received, whether a directory fragment lock of the directory fragment is occupied or not is judged according to the corresponding directory fragment, and if the directory fragment lock of the directory fragment is not occupied, the metadata request can be processed.
In this embodiment, it is only necessary to determine whether the directory fragment lock of the directory fragment corresponding to the metadata request is occupied, and it is not necessary to consider whether other directory fragments are processing other tasks, that is, in the same time domain, the directory fragments are processed in parallel, so that concurrency of client response is improved. In addition, the directory fragments in different time domains are not influenced mutually, and complete concurrence between the time domains can be realized.
The time domain mentioned in this embodiment refers to Session: in computers, and in network applications in particular, the term "session control" is generally translated into the time domain. In computer terminology, session refers to the time interval between an end user communicating with an interactive system, and generally refers to the time elapsed between registering into the system and deregistering from the system. And possibly some operating space, if required. The Session object stores the attributes and configuration information needed for a particular user Session. Thus, when a user jumps between Web pages of an application, the variables stored in the Session object will not be lost, but will persist throughout the user Session. When a user requests a Web page from an application, a World Wide Web (Web) server will automatically create a Session object if the user has not already a Session. When a session expires or is abandoned, the server will terminate the session. One of the most common uses of Session objects is to store user preferences. It should be noted that the concept of a Session needs to include a specific client, a specific server, and an uninterrupted operating time. The Session where the user A and the server C establish connection is two different sessions with the Session where the user B and the server C establish connection.
Therefore, the client side concurrent response method based on the directory fragments provided by the embodiment is improved, and the method comprises the steps of receiving a metadata request sent by a client side; judging whether a directory fragment lock of a directory fragment corresponding to the metadata request is occupied or not; if not, adding a directory fragment lock to the request file corresponding to the metadata request so that the request file processes the current metadata request. In advance, the files in the distributed file system are subjected to fragment processing, after a metadata request sent by a client is received, whether a directory fragment lock of the directory fragment is occupied or not is judged according to the corresponding directory fragment, and if the directory fragment lock of the directory fragment is not occupied, the metadata request can be processed. Only whether the directory fragment lock of the directory fragment corresponding to the metadata request is occupied needs to be judged, and whether other directory fragments are processing other tasks does not need to be considered, that is, in the same time domain, the directory fragments are processed in parallel, so that the concurrency of client response is improved. In addition, the directory fragments in different time domains are not influenced mutually, and complete concurrence between the time domains can be realized. The client side performs concurrent processing according to the number of the directory fragments, so that the metadata response concurrent processing capacity of the client side is improved, and the consistency and the effectiveness of the metadata of the file are ensured, thereby improving the concurrent processing capacity of the distributed system.
Preferably, the client-side concurrent response method based on the directory fragments further includes, if the directory fragment lock of the directory fragment corresponding to the metadata request is occupied:
and adding the metadata request into a waiting task queue, and controlling a request file to process the current metadata request after the directory fragment lock is unoccupied.
If the directory fragment lock of the directory fragment corresponding to the metadata request is occupied, that is, the directory fragment is processing other metadata requests, the current metadata request needs to join the waiting task queue until the directory fragment lock of the current directory fragment is unoccupied, and then the current metadata request is processed. That is, within the same directory fragment, files can only be processed serially, that is, the fragment lock is equivalent to a single-row channel of the fragment directory, and only one file can be processed at a time. The ordering of processing tasks and the order of metadata requests and responses are guaranteed.
According to the foregoing embodiment, in different directory fragments in the same time domain, some common variables may be involved at the same time, and this embodiment provides an optimal scheme, where the client-side concurrent response method based on directory fragments further includes, after receiving a metadata request sent by a client side:
judging whether the metadata request relates to a time domain common variable;
and if so, adding a directory fragment lock to the directory fragment corresponding to the related time domain public variable.
After receiving the metadata request, judging whether the metadata request relates to a time domain common variable or not; and if so, adding a directory fragment lock to the directory fragment corresponding to the related time domain public variable. The accuracy of public variable data and the consistency and the effectiveness of metadata are ensured when the current metadata request task is processed.
According to the foregoing embodiment, if the metadata request relates to modifying content or deleting content, this embodiment provides a preferred scheme, and after receiving the metadata request sent by the client, the method further includes:
determining whether the metadata request relates to modifying the deleted content;
and if so, adding the current time domain to the time domain lock.
After receiving a metadata request, if the current metadata request relates to modifying or deleting content, a time-domain lock needs to be added to the current time domain to ensure consistency and validity of metadata processed by the current metadata request task.
According to the foregoing embodiment, if the metadata request only relates to query content, and does not modify the content of the metadata, this embodiment provides an optimal solution, and after receiving the metadata request sent by the client, the method further includes:
judging whether the metadata request is a query request;
if yes, only add the directory sharding lock to the current request file.
After receiving the metadata request, judging whether the metadata request is a query request; if yes, only adding a directory fragment lock to the current request file to ensure the consistency and the validity of the processed metadata of the current metadata request task.
According to the above embodiment, the client side concurrent response method based on the directory shard receives the metadata request sent by the client side, and before this, the method further includes:
the directory file is fragmented and stored into the directory fragments;
a directory sharding lock is designed for each directory sharding, and the directory sharding locks are independent.
The directory file is fragmented in advance, and the embodiment does not limit the basis for performing directory fragmentation, and may be the number and the content, which are set according to actual needs.
According to the above embodiment, the method for client side concurrent response based on directory fragments for determining whether a directory fragment lock of a directory fragment corresponding to a metadata request is occupied includes:
acquiring the directory fragment where the metadata request is located according to the index information corresponding to the metadata request;
and judging whether the directory fragment lock of the directory fragment is occupied or not.
After receiving the metadata request, acquiring the directory fragment where the metadata request is located according to the index information corresponding to the metadata request; and judging whether the directory fragment lock of the directory fragment is occupied or not. If not, the metadata request may be processed. Only whether the directory fragment lock of the directory fragment corresponding to the metadata request is occupied needs to be judged, whether other directory fragments are processing other tasks does not need to be considered, namely, the directory fragments are processed in parallel in the same time domain, and the concurrency of client response is improved. In addition, the directory fragments in different time domains are not influenced mutually, and complete concurrence between the time domains can be realized. The client side performs concurrent processing according to the number of the directory fragments, so that the metadata response concurrent processing capacity of the client side is improved, and the consistency and the effectiveness of the metadata of the file are ensured, thereby improving the concurrent processing capacity of the distributed system.
In the foregoing embodiment, a client side concurrent response method based on a directory fragment is described in detail, and the present application also provides an embodiment corresponding to a client side concurrent response device based on a directory fragment. It should be noted that the present application describes the embodiments of the apparatus portion from two perspectives, one from the perspective of the function module and the other from the perspective of the hardware.
Based on the angle of the functional module, fig. 2 is a structural diagram of a client side concurrent response apparatus based on directory shards according to an embodiment of the present application, as shown in fig. 2, including:
a receiving module 21, configured to receive a metadata request sent by a client;
the judging module 22 is configured to judge whether a directory shard lock of a directory shard corresponding to the metadata request is occupied; if not, triggering the processing module 23;
the processing module 23 is configured to add a directory fragment lock to a request file corresponding to the metadata request, so that the request file processes the current metadata request.
Specifically, the receiving module 21 is configured to receive a metadata request sent by a client; the judging module 22 is configured to judge whether a directory shard lock of a directory shard corresponding to the metadata request is occupied; if not, the trigger processing module 23 adds a directory fragment lock to the request file corresponding to the metadata request, so that the request file processes the current metadata request. In advance, the files in the distributed file system are subjected to fragment processing, after a metadata request sent by a client is received, whether a directory fragment lock of the directory fragment is occupied or not is judged according to the corresponding directory fragment, and if the directory fragment lock of the directory fragment is not occupied, the metadata request can be processed. Only whether the directory fragment lock of the directory fragment corresponding to the metadata request is occupied needs to be judged, whether other directory fragments are processing other tasks does not need to be considered, namely, the directory fragments are processed in parallel in the same time domain, and the concurrency of client response is improved. In addition, the directory fragments in different time domains are not influenced mutually, and complete concurrence between the time domains can be realized. The client side performs concurrent processing according to the number of the directory fragments, so that the metadata response concurrent processing capacity of the client side is improved, and the consistency and the effectiveness of the metadata of the file are ensured, thereby improving the concurrent processing capacity of the distributed system.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
Fig. 3 is a structural diagram of another client side concurrent response device based on directory shards according to an embodiment of the present application, and as shown in fig. 3, the client side concurrent response device based on directory shards includes: a memory 30 for storing a computer program;
and a processor 31, configured to implement the steps of the method for acquiring the user operation habit information according to the above-mentioned embodiment (directory fragment based client side concurrent response method) when executing the computer program.
The client side concurrent response device based on the directory partition provided by the embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, or a desktop computer.
The processor 31 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The Processor 31 may be implemented in hardware using at least one of a Digital Signal Processor (DSP), a Field-Programmable Gate Array (FPGA), and a Programmable Logic Array (PLA). The processor 31 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 31 may be integrated with a Graphics Processing Unit (GPU) which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 31 may further include an Artificial Intelligence (AI) processor for processing computational operations related to machine learning.
Memory 30 may include one or more computer-readable storage media, which may be non-transitory. Memory 30 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 30 is at least used for storing the following computer program 301, wherein after being loaded and executed by the processor 31, the computer program can implement the relevant steps of the client side concurrent response method based on directory shards disclosed in any of the foregoing embodiments. In addition, the resources stored by the memory 30 may also include an operating system 302, data 303, and the like, and the storage may be transient storage or permanent storage. Operating system 302 may include Windows, unix, linux, and the like. Data 303 may include, but is not limited to, data involved in implementing a directory shard based client concurrent response method, and the like.
In some embodiments, the client side concurrent answering device based on directory shards may further include a display screen 32, an input/output interface 33, a communication interface 34, a power source 35, and a communication bus 36.
Those skilled in the art will appreciate that the architecture illustrated in fig. 3 does not constitute a limitation on directory shard based client concurrent answering machines, and may include more or fewer components than those illustrated.
The client side concurrent response device based on the directory shard provided by the embodiment of the application comprises a memory and a processor, wherein when the processor executes a program stored in the memory, the following method can be realized: client side concurrent response method based on directory fragmentation. Receiving a metadata request sent by a client; judging whether a directory fragment lock of a directory fragment corresponding to the metadata request is occupied or not; if not, adding a directory fragment lock to the request file corresponding to the metadata request so that the request file processes the current metadata request. In advance, the files in the distributed file system are subjected to fragment processing, after a metadata request sent by a client is received, whether a directory fragment lock of the directory fragment is occupied or not is judged according to the corresponding directory fragment, and if the directory fragment lock of the directory fragment is not occupied, the metadata request can be processed. Only whether the directory fragment lock of the directory fragment corresponding to the metadata request is occupied needs to be judged, whether other directory fragments are processing other tasks does not need to be considered, namely, the directory fragments are processed in parallel in the same time domain, and the concurrency of client response is improved. In addition, the directory fragments in different time domains are not influenced mutually, and complete concurrence between the time domains can be realized. The client side performs concurrent processing according to the number of the directory fragments, so that the metadata response concurrent processing capacity of the client side is improved, and the consistency and the effectiveness of the metadata of the file are ensured, thereby improving the concurrent processing capacity of the distributed system.
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps recited in the above embodiments of the directory fragment based client concurrent response method.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, which are essential or part of the prior art, or all or part of the technical solutions may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The present embodiment provides a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method of: the client side concurrent response method based on the directory fragments comprises the steps of receiving a metadata request sent by a client side; judging whether a directory fragment lock of a directory fragment corresponding to the metadata request is occupied; if not, adding a directory fragment lock to the request file corresponding to the metadata request so that the request file processes the current metadata request. In advance, the files in the distributed file system are subjected to fragment processing, after a metadata request sent by a client is received, whether a directory fragment lock of the directory fragment is occupied or not is judged according to the corresponding directory fragment, and if the directory fragment lock of the directory fragment is not occupied, the metadata request can be processed. Only whether the directory fragment lock of the directory fragment corresponding to the metadata request is occupied needs to be judged, and whether other directory fragments are processing other tasks does not need to be considered, that is, in the same time domain, the directory fragments are processed in parallel, so that the concurrency of client response is improved. In addition, the directory fragments in different time domains are not influenced mutually, and complete concurrence between the time domains can be realized. The client side performs concurrent processing according to the number of the directory fragments, so that the metadata response concurrent processing capacity of the client side is improved, and the consistency and the effectiveness of the metadata of the file are ensured, thereby improving the concurrent processing capacity of the distributed system.
The client-side response method, device and medium based on the directory fragments provided by the present application are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It should also be noted that, in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A client side concurrent response method based on directory fragmentation is characterized by comprising the following steps:
receiving a metadata request sent by a client;
judging whether a directory fragment lock of a directory fragment corresponding to the metadata request is occupied or not;
if not, adding a directory fragment lock to a request file corresponding to the metadata request so that the request file processes the current metadata request.
2. The client side concurrent response method based on directory fragments according to claim 1, wherein if the directory fragment lock of the directory fragment corresponding to the metadata request is occupied, the method further comprises:
and adding the metadata request into a waiting task queue, and controlling the request file to process the current metadata request after the directory fragment lock is unoccupied.
3. The client side concurrent response method based on directory shards according to claim 2, wherein after receiving the metadata request sent by the client side, the method further comprises:
determining whether the metadata request relates to a time domain common variable;
and if so, adding a directory fragment lock to the directory fragment corresponding to the related time domain public variable.
4. The client side concurrent response method based on directory shards according to claim 2, wherein after receiving the metadata request sent by the client side, the method further comprises:
determining whether the metadata request relates to modifying deleted content;
and if so, adding the current time domain to the time domain lock.
5. The client side concurrent response method according to claim 3, wherein after receiving the metadata request sent by the client side, the method further comprises:
judging whether the metadata request is a query request;
and if so, adding the directory fragment lock to the current request file.
6. The client side concurrent response method based on directory shards according to any one of claims 1 to 5, wherein the receiving a metadata request sent by a client side further comprises:
the directory file is fragmented and stored in the directory fragments;
and designing a directory sharding lock for each directory sharding, wherein the directory sharding locks are mutually independent.
7. The client side concurrent response method according to claim 1, wherein the determining whether the directory shard lock of the directory shard corresponding to the metadata request is occupied comprises:
acquiring the directory fragment where the metadata request is located according to the index information corresponding to the metadata request;
determining whether the directory shard lock of the directory shard is occupied.
8. A client side concurrent response device based on directory fragmentation is characterized by comprising:
the receiving module is used for receiving a metadata request sent by a client;
the judging module is used for judging whether the directory fragment lock of the directory fragment corresponding to the metadata request is occupied or not; if not, triggering a processing module;
the processing module is configured to add a directory fragment lock to a request file corresponding to the metadata request, so that the request file processes the current metadata request.
9. A client side concurrent response device based on directory fragmentation is characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the directory shard based client concurrent reply method according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the directory shard based client concurrent answer method according to any one of claims 1 to 7.
CN202211295543.1A 2022-10-21 2022-10-21 Client response method, device and medium based on directory fragmentation Pending CN115510016A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211295543.1A CN115510016A (en) 2022-10-21 2022-10-21 Client response method, device and medium based on directory fragmentation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211295543.1A CN115510016A (en) 2022-10-21 2022-10-21 Client response method, device and medium based on directory fragmentation

Publications (1)

Publication Number Publication Date
CN115510016A true CN115510016A (en) 2022-12-23

Family

ID=84510713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211295543.1A Pending CN115510016A (en) 2022-10-21 2022-10-21 Client response method, device and medium based on directory fragmentation

Country Status (1)

Country Link
CN (1) CN115510016A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117579700A (en) * 2024-01-11 2024-02-20 中国人民解放军国防科技大学 General micro-service processing method, system and equipment based on message queue

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117579700A (en) * 2024-01-11 2024-02-20 中国人民解放军国防科技大学 General micro-service processing method, system and equipment based on message queue
CN117579700B (en) * 2024-01-11 2024-04-02 中国人民解放军国防科技大学 General micro-service processing method, system and equipment based on message queue

Similar Documents

Publication Publication Date Title
US11809726B2 (en) Distributed storage method and device
US9983825B2 (en) Efficient data volume replication for block-based storage
US20170206260A1 (en) Reducing data volume durability state for block-based storage
US11296940B2 (en) Centralized configuration data in a distributed file system
JP2019519025A (en) Division and movement of ranges in distributed systems
CN111290826A (en) Distributed file system, computer system, and medium
US11080253B1 (en) Dynamic splitting of contentious index data pages
US20190095284A1 (en) Enhanced application write performance
US11397749B2 (en) Asynchronous replication of in-scope table data
CN102938784A (en) Method and system used for data storage and used in distributed storage system
CN104020961A (en) Distributed data storage method, device and system
US11797494B2 (en) Snapshot management in distributed file systems
US9075722B2 (en) Clustered and highly-available wide-area write-through file system cache
US20210349850A1 (en) Managing snapshotting of a dataset using an ordered set of b+ trees
CN109684270A (en) Database filing method, apparatus, system, equipment and readable storage medium storing program for executing
CN113806300A (en) Data storage method, system, device, equipment and storage medium
CN111225003B (en) NFS node configuration method and device
US20150220517A1 (en) Efficient conflict resolution among stateless processes
CN115510016A (en) Client response method, device and medium based on directory fragmentation
US10545667B1 (en) Dynamic data partitioning for stateless request routing
US8621260B1 (en) Site-level sub-cluster dependencies
US20150350315A1 (en) Zero copy volume reconstruction
CN115238006A (en) Retrieval data synchronization method, device, equipment and computer storage medium
CN115174596A (en) Equipment remote copying method, device and medium
CN114996053A (en) Remote volume replication transmission method, system, device and storage medium

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