A data request processing method and apparatus based on metadata loading
By retrieving and loading inode information in the metadata cache and according to the data request processing scheme, the problem of metadata performance degradation in the cache miss scenario is solved, and the system processing capability and speed are improved.
Patent Information
- Application Number
- CN202110998402.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-27
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-08-27
AI Technical Summary
In the cache miss scenario, metadata performance is degraded and the existing technology lacks effective solutions.
By obtaining the file name of the directory item cache, the first inode information is retrieved in the metadata cache, if it is missed, the second inode information is loaded from the underlying object storage device, and the data request is processed based on the inode information. In addition, the heat of the metadata shard is periodically adjusted and unnecessary inode information is cleared.
Improves the metadata loading performance in cache miss scenarios, and improves the overall processing capability and speed of the system.
Smart Images

Figure CN113821479B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of metadata loading, and more specifically, to a data request processing method and device based on metadata loading. Background Art
[0002] Distributed file systems are widely used in many current big data scenarios (such as video surveillance, radio and television media assets, high performance, etc.). Their performance is a key factor in evaluating distributed file systems, and the current metadata performance is highly dependent on metadata cache. In the case of tens of billions or even hundreds of billions of massive small files, it is impossible to cache all metadata, which leads to reduced metadata performance in cache miss scenarios.
[0003] There is currently no effective solution to the problem in the prior art that the metadata performance of the cache is degraded in a cache miss scenario. Summary of the invention
[0004] In view of this, the purpose of an embodiment of the present invention is to propose a data request processing method and device based on metadata loading, which can improve the metadata loading performance in a cache miss scenario, thereby improving the overall processing capability and speed of the system.
[0005] Based on the above purpose, a first aspect of an embodiment of the present invention provides a data request processing method based on metadata loading, comprising executing the following steps in response to receiving a data request:
[0006] Get the file name of the directory entry cache based on the data request;
[0007] Using the file name, retrieve the first index node information of the file name in the metadata cache;
[0008] In response to not retrieving the first index node information from the metadata cache, loading second index node information of the file name from the underlying object storage device into the metadata cache;
[0009] In response to the first index node information being retrieved from the metadata cache or the second index node information having been loaded into the metadata cache, the data request is processed based on the first index node information or the second index node information.
[0010] In some embodiments, the method further comprises periodically performing the following steps:
[0011] Reduce the heat of all metadata shards by half;
[0012] In response to the amount of stored data in the metadata cache reaching a first storage threshold, the first index node information and the second index node information are selectively cleared according to the heat of all metadata shards.
[0013] In some implementations, in response to a ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being less than a heat threshold, the second index node information of the file name is determined as the first index node information of the file name.
[0014] In some implementations, while the second index node information of the file name is loaded from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is also increased by one.
[0015] In some embodiments, in response to the ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being greater than a heat threshold, the second index node information of the file name is determined as the first index node information of the file name and the first index node information of all other file names of the metadata shard where the file name is located.
[0016] In some implementations, while the second index node information of the file name is loaded from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is also cleared.
[0017] In some embodiments, the heat threshold is 1%.
[0018] In some embodiments, selectively clearing the first index node information and the second index node information based on the popularity of all metadata shards includes: sorting all metadata shards in ascending order of popularity, and clearing the first index node information and the second index node information of the file names in all metadata shards in sequence until the amount of stored data in the metadata cache is reduced to no more than a second storage threshold.
[0019] In some implementations, the second storage threshold is less than the first storage threshold.
[0020] A second aspect of an embodiment of the present invention provides a data request processing device based on metadata loading, comprising:
[0021] processor;
[0022] The controller stores program codes executable by the processor, and the processor executes the following steps in response to receiving a data request when executing the program codes:
[0023] Get the file name of the directory entry cache based on the data request;
[0024] Using the file name, retrieve the first index node information of the file name in the metadata cache;
[0025] In response to not retrieving the first index node information from the metadata cache, loading second index node information of the file name from the underlying object storage device into the metadata cache;
[0026] In response to the first index node information being retrieved from the metadata cache or the second index node information having been loaded into the metadata cache, the data request is processed based on the first index node information or the second index node information.
[0027] In some embodiments, the method further comprises periodically performing the following steps:
[0028] Reduce the heat of all metadata shards by half;
[0029] In response to the amount of stored data in the metadata cache reaching a first storage threshold, the first index node information and the second index node information are selectively cleared according to the heat of all metadata shards.
[0030] In some implementations, in response to a ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being less than a heat threshold, the second index node information of the file name is determined as the first index node information of the file name.
[0031] In some implementations, while the second index node information of the file name is loaded from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is also increased by one.
[0032] In some embodiments, in response to the ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being greater than a heat threshold, the second index node information of the file name is determined as the first index node information of the file name and the first index node information of all other file names of the metadata shard where the file name is located.
[0033] In some implementations, while the second index node information of the file name is loaded from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is also cleared.
[0034] In some embodiments, the heat threshold is 1%.
[0035] In some embodiments, selectively clearing the first index node information and the second index node information based on the popularity of all metadata shards includes: sorting all metadata shards in ascending order of popularity, and clearing the first index node information and the second index node information of the file names in all metadata shards in sequence until the amount of stored data in the metadata cache is reduced to no more than a second storage threshold.
[0036] In some implementations, the second storage threshold is less than the first storage threshold.
[0037] The present invention has the following beneficial technical effects: the data request processing method and device based on metadata loading provided by the embodiment of the present invention obtain the file name of the directory item cache based on the data request; use the file name to retrieve the first index node information of the file name in the metadata cache; in response to the first index node information not being retrieved from the metadata cache, the second index node information of the file name is loaded from the underlying object storage device to the metadata cache; in response to the first index node information being retrieved from the metadata cache, or the second index node information having been loaded into the metadata cache, the technical solution of processing the data request based on the first index node information or the second index node information can improve the metadata loading performance in the cache miss scenario, thereby improving the overall processing capability and speed of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A schematic diagram of the flow of a data request processing method based on metadata loading provided by the present invention;
[0040] Figure 2 The overall flow chart of the data request processing method based on metadata loading provided by the present invention;
[0041] Figure 3 A flowchart of a metadata loading method and a heat adjustment method of a data request processing method based on metadata loading provided by the present invention;
[0042] Figure 4 A line graph showing the random read and write loading effect of the data request processing method based on metadata loading provided by the present invention;
[0043] Figure 5 A line graph showing the sequential read and write loading effect of the data request processing method based on metadata loading provided by the present invention. DETAILED DESCRIPTION
[0044] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0045] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.
[0046] Based on the above objectives, the first aspect of an embodiment of the present invention proposes an embodiment of a data request processing method based on metadata loading, which improves the metadata loading performance in a cache miss scenario, thereby improving the overall processing capability and speed of the system. Figure 1 Shown is a flow chart of a data request processing method based on metadata loading provided by the present invention.
[0047] The data request processing method based on metadata loading is as follows: Figure 1 As shown, the steps include executing the following steps in response to receiving a data request:
[0048] Step S101, obtaining the file name of the directory entry cache based on the data request;
[0049] Step S103, using the file name to retrieve the first index node information of the file name in the metadata cache;
[0050] Step S105, in response to not retrieving the first index node information from the metadata cache, loading the second index node information of the file name from the underlying object storage device into the metadata cache;
[0051] Step S107 , in response to retrieving the first index node information from the metadata cache or loading the second index node information into the metadata cache, processing the data request based on the first index node information or the second index node information.
[0052] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The embodiment of the computer program can achieve the same or similar effect as any of the above-mentioned method embodiments corresponding thereto.
[0053] The step of the method or algorithm described in conjunction with the disclosure here can be directly included in hardware, in a software module executed by a processor, or in a combination of the two. The software module can reside in a storage medium of any other form known in the art, such as a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or a storage medium. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium or write information to the storage medium. In an alternative, the storage medium can be integrated with the processor. The processor and the storage medium can reside in an ASIC. The ASIC can reside in a user terminal. In an alternative, the processor and the storage medium can reside in a user terminal as a discrete component.
[0054] In some embodiments, the method further comprises periodically performing the following steps:
[0055] Reduce the heat of all metadata shards by half;
[0056] In response to the amount of stored data in the metadata cache reaching a first storage threshold, the first index node information and the second index node information are selectively cleared according to the heat of all metadata shards.
[0057] In some implementations, in response to a ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being less than a heat threshold, the second index node information of the file name is determined as the first index node information of the file name.
[0058] In some implementations, while the second index node information of the file name is loaded from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is also increased by one.
[0059] In some embodiments, in response to the ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being greater than a heat threshold, the second index node information of the file name is determined as the first index node information of the file name and the first index node information of all other file names of the metadata shard where the file name is located.
[0060] In some implementations, while the second index node information of the file name is loaded from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is also cleared.
[0061] In some embodiments, the heat threshold is 1%.
[0062] In some embodiments, selectively clearing the first index node information and the second index node information based on the popularity of all metadata shards includes: sorting all metadata shards in ascending order of popularity, and clearing the first index node information and the second index node information of the file names in all metadata shards in sequence until the amount of stored data in the metadata cache is reduced to no more than a second storage threshold.
[0063] In some implementations, the second storage threshold is less than the first storage threshold.
[0064] Various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the described function in various ways for every specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0065] The various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure herein may be implemented or executed using the following components designed to perform the functions described herein: a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general-purpose processor may be a microprocessor, but alternatively, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and / or any other such configuration.
[0066] The specific implementation of the present invention is further described below based on specific examples.
[0067] See also Figure 2First, the client initiates a request and enters the request queue. MDS (metadata server) obtains DentryName (file name of the directory entry cache) according to the request content, and first obtains the inode (index node) information in MDCache (metadata cache). If the inode cannot be obtained in MDCache, the underlying OSD is loaded. The general loading solution is to load the entire Dir (metadata shard) and put the loaded content into MDCache. After the loading is completed and the inode is obtained, the business is processed and the request is responded to. When the cache in MDCache reaches the upper limit, the excess cache needs to be trimmed (cleared) to prevent excessive memory usage.
[0068] However, when loading in full shards, extra content will be loaded. This scenario is more suitable for sequential scenarios, but it will bring extra overhead for highly random businesses. When only one inode is needed, loading in the full shard will result in extra loading content, which will frequently trigger cache trim and consume extra resources.
[0069] The main process of mixed loading in the embodiment of the present invention is as follows: each dir records the heat value pop of its own single loading. Figure 3 , when the cache search fails, first load only one metadata information under the Dir according to Dentryname, and pop+1, the Pop value is half-decayed according to time, and the decay period is the same as trim (default 5 seconds). When the number of pop / dir>threshold (for example, 0.01, that is, a single load occupies one percent of the total number of dir), it is considered that the loading heat of the Dir is relatively high, and the entire Dir needs to be loaded. Otherwise, the single load method is still adopted. Therefore, according to the heat ratio of dir loading, it is automatically selected to load a single item or load the entire shard to control the metadata cache loading amount and trim amount to improve the performance of cache miss scenarios.
[0070] The performance of loading the entire shard, loading a single entry, and the mixed loading method described in this article in different cache hit scenarios in random and sequential scenarios are as follows: Figure 4 and Figure 5 As shown in the figure, it can be seen that the performance of loading the entire shard is extremely low in the cache miss scenario, and the performance of loading a single record is poor in the sequential scenario. The hybrid loading method proposed in this paper is compatible with both sequential and random scenarios, and has stable performance.
[0071] In one or more exemplary designs, the functions can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored on a computer-readable medium or transmitted via a computer-readable medium as one or more instructions or codes. Computer-readable media include computer storage media and communication media, and the communication media include any media that helps to transfer a computer program from one location to another. The storage medium can be any available medium that can be accessed by a general or special-purpose computer. As an example and not limiting, the computer-readable medium can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, disk storage devices or other magnetic storage devices, or can be used to carry or store the required program code in the form of instructions or data structures and can be accessed by a general or special-purpose computer or a general or special-purpose processor. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwaves are used to send software from a website, server or other remote source, the above-mentioned coaxial cable, optical fiber cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwaves are all included in the definition of the medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, Blu-ray disc, wherein disks usually reproduce data magnetically, while optical discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0072] In addition, the method disclosed in the embodiment of the present invention can also be implemented as a computer program executed by a CPU, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the CPU, the above functions defined in the method disclosed in the embodiment of the present invention are performed. The above method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.
[0073] It can be seen from the above embodiments that the data request processing method based on metadata loading provided by the embodiments of the present invention obtains the file name of the directory item cache based on the data request; uses the file name to retrieve the first index node information of the file name in the metadata cache; in response to the first index node information not being retrieved from the metadata cache, the second index node information of the file name is loaded from the underlying object storage device to the metadata cache; in response to the first index node information being retrieved from the metadata cache, or the second index node information having been loaded into the metadata cache, the technical solution of processing the data request based on the first index node information or the second index node information can improve the metadata loading performance in the cache miss scenario, thereby improving the overall processing capability and speed of the system.
[0074] It should be pointed out in particular that the various steps in the various embodiments of the above-mentioned data request processing method based on metadata loading can be cross-linked, replaced, added, and deleted. Therefore, these reasonable permutations, combinations and transformations of the data request processing method based on metadata loading should also belong to the protection scope of the present invention, and the protection scope of the present invention should not be limited to the embodiments.
[0075] Based on the above purpose, the second aspect of the embodiment of the present invention proposes an embodiment of a data request processing device based on metadata loading, which improves the metadata loading performance in a cache miss scenario, thereby improving the overall processing capability and speed of the system. The device includes:
[0076] processor;
[0077] The controller stores program codes executable by the processor, and the processor executes the following steps in response to receiving a data request when executing the program codes:
[0078] Get the file name of the directory entry cache based on the data request;
[0079] Using the file name, retrieve the first index node information of the file name in the metadata cache;
[0080] In response to not retrieving the first index node information from the metadata cache, loading second index node information of the file name from the underlying object storage device into the metadata cache;
[0081] In response to the first index node information being retrieved from the metadata cache or the second index node information having been loaded into the metadata cache, the data request is processed based on the first index node information or the second index node information.
[0082] In some embodiments, the steps further include periodically performing the following steps:
[0083] Reduce the heat of all metadata shards by half;
[0084] In response to the amount of stored data in the metadata cache reaching a first storage threshold, the first index node information and the second index node information are selectively cleared according to the heat of all metadata shards.
[0085] In some implementations, in response to a ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being less than a heat threshold, the second index node information of the file name is determined as the first index node information of the file name.
[0086] In some implementations, while the second index node information of the file name is loaded from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is also increased by one.
[0087] In some embodiments, in response to the ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being greater than a heat threshold, the second index node information of the file name is determined as the first index node information of the file name and the first index node information of all other file names of the metadata shard where the file name is located.
[0088] In some implementations, while the second index node information of the file name is loaded from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is also cleared.
[0089] In some embodiments, the heat threshold is 1%.
[0090] In some embodiments, selectively clearing the first index node information and the second index node information based on the popularity of all metadata shards includes: sorting all metadata shards in ascending order of popularity, and clearing the first index node information and the second index node information of the file names in all metadata shards in sequence until the amount of stored data in the metadata cache is reduced to no more than a second storage threshold.
[0091] In some implementations, the second storage threshold is less than the first storage threshold.
[0092] The devices and equipment disclosed in the examples of the present invention may be various electronic terminal devices, such as mobile phones, personal digital assistants (PDAs), tablet computers (PADs), smart TVs, etc., or large terminal devices, such as devices, etc. Therefore, the protection scope disclosed in the embodiments of the present invention should not be limited to a certain type of device or equipment. The client disclosed in the embodiments of the present invention may be applied to any of the above electronic terminal devices in the form of electronic hardware, computer software, or a combination of the two.
[0093] It can be seen from the above embodiments that the data request processing device based on metadata loading provided by the embodiments of the present invention obtains the file name of the directory item cache based on the data request; uses the file name to retrieve the first index node information of the file name in the metadata cache; in response to the first index node information not being retrieved from the metadata cache, the second index node information of the file name is loaded from the underlying object storage device to the metadata cache; in response to the first index node information being retrieved from the metadata cache, or the second index node information having been loaded into the metadata cache, the technical solution of processing the data request based on the first index node information or the second index node information can improve the metadata loading performance in the cache miss scenario, thereby improving the overall processing capability and speed of the system.
[0094] It should be particularly pointed out that the embodiment of the above-mentioned device adopts the embodiment of the data request processing method based on metadata loading to specifically illustrate the working process of each module. Those skilled in the art can easily think of applying these modules to other embodiments of the data request processing method based on metadata loading. Of course, since the various steps in the embodiment of the data request processing method based on metadata loading can be mutually crossed, replaced, added, and deleted, these reasonable permutations, combinations, and transformations of the device should also fall within the scope of protection of the present invention, and the scope of protection of the present invention should not be limited to the embodiments.
[0095] The embodiment of the present invention may also include a corresponding computer device. The computer device includes a memory, at least one processor, and a computer program stored in the memory and executable on the processor, and the processor executes any one of the above methods when executing the program.
[0096] Among them, the memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules corresponding to the data request processing method based on metadata loading in the embodiment of the present application. The processor executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory, that is, realizing the data request processing method based on metadata loading in the above method embodiment.
[0097] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0098] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The embodiment of the computer program can achieve the same or similar effect as any of the above-mentioned method embodiments corresponding thereto.
[0099] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0100] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as described above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A data request processing method based on metadata loading, characterized in that: The method comprises executing the following steps in response to receiving a data request: Obtaining a file name of a directory entry cache based on the data request; Retrieving first index node information of the file name in the metadata cache using the file name; In response to not retrieving the first index node information from the metadata cache, loading second index node information of the file name from an underlying object storage device into the metadata cache; In response to retrieving the first index node information from the metadata cache or having loaded the second index node information into the metadata cache, processing the data request based on the first index node information or the second index node information; Among them, all metadata shards record the heat of their own single loading; Periodically perform the following steps: Reduce the heat of all metadata shards by half; In response to the amount of stored data in the metadata cache reaching a first storage threshold, the first index node information and the second index node information are selectively cleared according to the heat of all metadata shards; In response to a ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being less than a heat threshold, determining the second index node information of the file name as the first index node information of the file name; While loading the second index node information of the file name from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is increased by one; or, In response to a ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being greater than a heat threshold, determining the second index node information of the file name as the first index node information of the file name and the first index node information of all other file names of the metadata shard where the file name is located; While loading the second index node information of the file name from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is also cleared.
2. The method according to claim 1, characterized in that The heat threshold is 1%.
3. The method according to claim 1, characterized in that Selectively clearing the first index node information and the second index node information according to the heat of all the metadata shards includes: sorting all the metadata shards from small to large according to heat, and clearing the first index node information and the second index node information of the file name in all the metadata shards in sequence until the amount of stored data in the metadata cache is reduced to no more than a second storage threshold.
4. The method according to claim 3, characterized in that The second storage threshold is smaller than the first storage threshold.
5. A data request processing device based on metadata loading, characterized in that: include: processor; A controller stores program codes executable by the processor, wherein the processor executes the following steps in response to receiving a data request when executing the program codes: Obtaining a file name of a directory entry cache based on the data request; Retrieving first index node information of the file name in the metadata cache using the file name; In response to not retrieving the first index node information from the metadata cache, loading second index node information of the file name from an underlying object storage device into the metadata cache; In response to retrieving the first index node information from the metadata cache or having loaded the second index node information into the metadata cache, processing the data request based on the first index node information or the second index node information; Among them, all metadata shards record the heat of their own single loading; Periodically perform the following steps: Reduce the heat of all metadata shards by half; In response to the amount of stored data in the metadata cache reaching a first storage threshold, the first index node information and the second index node information are selectively cleared according to the heat of all metadata shards; In response to a ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being less than a heat threshold, determining the second index node information of the file name as the first index node information of the file name; While loading the second index node information of the file name from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is increased by one; or, In response to a ratio of the heat of the metadata shard where the file name is located to the total number of all metadata shards being greater than a heat threshold, determining the second index node information of the file name as the first index node information of the file name and the first index node information of all other file names of the metadata shard where the file name is located; While loading the second index node information of the file name from the underlying object storage device into the metadata cache, the heat of the metadata shard where the file name is located is also cleared.
Citation Information
Patent Citations
Distributed data processing method and system
CN110046062A