A storage method, device, equipment and storage medium for directory index nodes
By adding timestamp and version fields to the directory access metadata and content metadata, the cross-MDS request problem when modifying directory metadata is solved, and more efficient metadata modification request efficiency is achieved.
Patent Information
- Application Number
- CN202311623929.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-28
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2043-11-28
AI Technical Summary
When processing massive files, modifying directory metadata requires cross-MDS requests, resulting in increased network interaction and affecting the efficiency of metadata requests.
Adding timestamp fields to both the access metadata and content metadata of the directory, and introducing version fields to manage the multi-version situation of the timestamp field. The local clock synchronization service ensures that the value of the version field is order-keeping, thereby avoiding cross-MDS requests.
It effectively reduces the overhead of access metadata modification and improves the efficiency of metadata modification requests.
Smart Images

Figure CN117520267B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of step-by-step storage, and in particular to a storage method, device, equipment and storage medium for a directory index node. Background Art
[0002] Distributed file systems need to support the processing requirements of massive files. Therefore, different files and directories need to be broken up and split into different MDS (metadata server, MDS for short) nodes, and load balancing is performed in this way. The current common processing method is to divide directory metadata into access (access metadata) and content (content metadata), where access metadata is responsible for id (IDentity, identity number), permission (authorization information), and content metadata is responsible for timestamp (timestamp), link (link), etc. Then, the content metadata of each directory is hashed to a different MDS, and the access metadata of the subdirectory is stored in the content metadata of the parent directory. Finally, all metadata information is persisted by the MDS to the underlying distributed KV storage system.
[0003] For the above processing method, file semantics requires that when any metadata such as access or link is modified, its timestamp must also be updated synchronously. However, if the timestamp is placed in the content, the access modification request must also be sent synchronously from the MDS where the access metadata is located to the MDS where the content is located through a cross-MDS request. Therefore, it will increase a network interaction and affect the efficiency of metadata requests. Summary of the invention
[0004] The present application provides a storage method, device, equipment and storage medium for a directory index node, which can effectively improve the efficiency of metadata modification requests.
[0005] In a first aspect, an embodiment of the present application provides a method for storing a directory index node, the method for storing a directory index node comprising:
[0006] Add a timestamp field to both the access metadata and content metadata of the directory, and a version field to determine whether the timestamp field should be retained when obtaining the directory metadata for splicing operations;
[0007] Assign the current value of the local clock to the version field and update the timestamp field;
[0008] Write the updated timestamp field and access metadata into KV to implement metadata writing.
[0009] In combination with the first aspect, in one implementation,
[0010] The value of the version field is determined by the local clock of each MDS, and a clock synchronization service is established between the MDSs to maintain the order of the value of the version field;
[0011] When performing the concatenation operation, the timestamp field in the metadata where the version field with the larger value is located is retained according to the value of the version field.
[0012] In combination with the first aspect, in one implementation, the writing of the metadata includes a request initiated by the file client to modify directory access metadata.
[0013] In combination with the first aspect, in one implementation, the request initiated by the file client to modify the directory access metadata is specifically:
[0014] The file client initiates a request to modify the directory access metadata;
[0015] The MDS assigns the current value of the local clock to the version field in the access metadata, and the MDS updates the timestamp field;
[0016] MDS writes the updated timestamp field and access metadata to KV in a transactional manner, thereby implementing metadata writing.
[0017] In combination with the first aspect, in one implementation,
[0018] After the metadata is written, the following steps are also included: reading the metadata;
[0019] The metadata reading specifically includes the following steps:
[0020] The file client initiates a request to read all metadata from the MDS where the access metadata is located;
[0021] Based on the request to read all metadata, the MDS where the access metadata is located initiates a request to the content MDS to obtain the content metadata;
[0022] The MDS where the access metadata is located performs the concatenation of the access metadata and the content metadata;
[0023] The MDS where the access metadata is located returns the spliced directory metadata to the file client.
[0024] In combination with the first aspect, in one implementation, when the MDS where the access metadata is located performs concatenation of the access metadata and the content metadata, the version field in the access metadata and the content metadata is specifically:
[0025] Compare the values of the version field in the access metadata and the content metadata. Based on the comparison result, discard the timestamp field of the metadata where the version field with the smaller value is located, and retain the timestamp field of the metadata where the version field with the larger value is located.
[0026] In a second aspect, an embodiment of the present application provides a storage device for a directory index node, the storage device for a directory index node comprising:
[0027] Add a module to add the timestamp field to both the access metadata and content metadata of the directory, and obtain the version field to determine whether the timestamp field should be retained when performing splicing operations on the directory metadata;
[0028] The update module is used to assign the current value of the local clock to the version field and update the timestamp field;
[0029] The writing module is used to write the updated timestamp field and access metadata into KV to implement metadata writing.
[0030] In conjunction with the second aspect, in one implementation,
[0031] The value of the version field is determined by the local clock of each MDS, and a clock synchronization service is established between the MDSs to maintain the order of the value of the version field;
[0032] When performing the concatenation operation, the timestamp field in the metadata where the version field with the larger value is located is retained according to the value of the version field.
[0033] In a third aspect, an embodiment of the present application provides a storage device for a directory index node, wherein the storage device for the directory index node comprises a processor, a memory, and a storage program for the directory index node stored on the memory and executable by the processor, wherein when the storage program for the directory index node is executed by the processor, the steps of the above-mentioned directory index node storage method are implemented.
[0034] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a storage program for a directory index node is stored. When the storage program for the directory index node is executed by a processor, the steps of the above-mentioned directory index node storage method are implemented.
[0035] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:
[0036] By adding a timestamp field to both the access metadata and content metadata of the directory, and obtaining the version field that determines whether the timestamp field is retained when the directory metadata is spliced, the problem of cross-MDS requests generated by modifying the access metadata is addressed. This application utilizes the timestamp multi-version mechanism to process the timestamp and access metadata together. In order to solve the multi-version decision problem of multi-copy timestamps, a version field is introduced into the timestamp field for management, and the local clock of each MDS node that has undergone clock synchronization is used to determine the version field. In addition, this application can avoid cross-MDS requests when modifying access metadata, effectively reduce the overhead of access metadata modification, and effectively improve the efficiency of metadata modification requests. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flowchart of a method for storing directory index nodes for this application;
[0038] Figure 2 This is a schematic diagram of the structure of metadata;
[0039] Figure 3 A schematic diagram of the structure of a storage device for a directory index node of the present application;
[0040] Figure 4 A schematic diagram of the hardware structure of the storage device of the directory index node of this application. DETAILED DESCRIPTION
[0041] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0043] In the first aspect, an embodiment of the present application provides a storage method for a directory index node, by adding a timestamp field to both the access metadata and the content metadata of the directory, and obtaining a version field that determines whether the timestamp field is retained when performing a splicing operation on the directory metadata. In order to address the problem that modifying the access metadata will generate cross-MDS requests, the present application utilizes a timestamp multi-version mechanism to process the timestamp and access metadata together, and in order to solve the multi-copy timestamp multi-version decision problem, introduces a version field into the timestamp field for management, and uses the local clock of each MDS node that has undergone clock synchronization to determine the version field. The present application can avoid cross-MDS requests when modifying the access metadata, effectively reduce the overhead of modifying the access metadata, and effectively improve the efficiency of metadata modification requests.
[0044] In one embodiment, referring to Figure 1 , Figure 1 This is a flowchart of the storage method of the directory index node of this application. Figure 1 As shown, the storage method of the directory index node includes:
[0045] S1: Add a timestamp field to both the access metadata and content metadata of the directory, and a version field to determine whether the timestamp field should be retained when obtaining the directory metadata for splicing operations;
[0046] Specifically, based on the existing solution, add a timestamp field and a version field to the directory's access metadata, and add a version field to the content metadata. Figure 2 As shown, for the metadata after adding fields, the access metadata includes permission, timestamp field and version field, and the content metadata includes nlink (new link) field, timestamp field and version field. And the access metadata and content metadata are each located in one MDS.
[0047] It should be noted that when the file client obtains the directory metadata, it needs to obtain the access metadata and content metadata separately and then splice them. Since there are timestamp fields in both the access metadata and the content metadata, it is necessary to compare the latest values and return them. If the comparison is based on the size of the timestamp field value itself, it is impossible to cope with the scenario of modifying the timestamp field in the file semantics. Therefore, this application introduces the version field in both the access metadata and the content metadata. When performing a comparison operation to determine which metadata's timestamp field to retain, it is determined by the size of the version field in each metadata.
[0048] Furthermore, in one embodiment, the value of the version field is determined by the local clock of each MDS, and a clock synchronization service is established between each MDS to maintain the order of the value of the version field. That is, the local clock of each service node (MDS node) is used to determine the value of the version field in each MDS, and a clock synchronization service is established between each service node to maintain the order of the version value.
[0049] In this application, when performing the splicing operation, the timestamp field of the metadata where the version field with the larger value is located is retained according to the value of the version field. That is, when the file client obtains the directory metadata and performs the splicing operation on the access metadata and the content metadata, the value of the version field in the access metadata is compared with the value of the version field in the content metadata. If the value of the version field in the access metadata is greater than the value of the version field in the content metadata, the timestamp field in the access metadata is retained and the timestamp field in the content metadata is discarded; if the value of the version field in the content metadata is greater than the version field in the access metadata, the timestamp field in the content metadata is retained and the timestamp field in the access metadata is discarded.
[0050] S2: Assign the current value of the local clock to the version field and update the timestamp field; that is, the MDS assigns the current value of the local clock to the version field in the access metadata and updates the timestamp field at the same time.
[0051] S3: Write the updated timestamp field and access metadata to KV to implement metadata writing. That is, MDS writes the updated timestamp field and access metadata to KV in a transactional manner to implement metadata writing.
[0052] Furthermore, the storage method of the directory index node of the present application, for writing metadata, specifically includes a request initiated by the file client to modify the directory access metadata, that is, the writing of metadata includes a request initiated by the file client to modify the directory access metadata.
[0053] In the metadata writing process, the request initiated by the file client to modify the directory access metadata is as follows:
[0054] S301: The file client initiates a request to modify directory access metadata; specifically, the file client initiates a request to modify directory access metadata to the MDS where the access metadata is located.
[0055] S302: The MDS assigns the current value of the local clock to the version field in the access metadata, and the MDS updates the timestamp field; specifically, the MDS where the access metadata is located receives a request to modify the directory access metadata, and then the MDS where the access metadata is located assigns the current value of the local clock to the version field in the access metadata, and at the same time, the MDS where the access metadata is located updates the timestamp field.
[0056] S303: The MDS writes the updated timestamp field and access metadata into the KV in a transactional manner, thereby implementing metadata writing. Specifically, the MDS where the access metadata is located writes the updated timestamp field and access metadata into the KV in a transactional manner.
[0057] Furthermore, in one embodiment, after the metadata is written, the method further includes: reading the metadata.
[0058] The specific steps for reading metadata include:
[0059] S401: The file client initiates a request to read all metadata from the MDS where the access metadata is located;
[0060] S402: Based on the request to read all metadata, the MDS where the access metadata is located initiates a request to obtain the content metadata to the content MDS; specifically, when the MDS where the access metadata is located receives the request to read all metadata sent by the file client, the MDS where the access metadata is located initiates a request to obtain the content metadata to the MDS where the content metadata is located.
[0061] S403: the MDS where the access metadata is located performs a splicing operation on the access metadata and the content metadata; specifically, when the MDS where the content metadata is located receives the request, the MDS where the access metadata is located performs a splicing operation on the access metadata and the content metadata.
[0062] S404: The MDS where the access metadata is located returns the spliced directory metadata to the file client. Specifically, when the access metadata and the content metadata are spliced, the MDS where the access metadata is located returns the spliced directory metadata to the file client.
[0063] It should be noted that when the MDS where the access metadata is located concatenates the access metadata and the content metadata, for the version field in the access metadata and the content metadata, specifically: a size comparison is performed on the value of the version field in the access metadata and the content metadata, and based on the comparison result, the timestamp field of the metadata where the version field with the smaller value is located is discarded, and the timestamp field of the metadata where the version field with the larger value is located is retained.
[0064] That is, the value of the version field in the access metadata is compared with the value of the version field in the content metadata. If the value of the version field in the access metadata is greater than the value of the version field in the content metadata, the timestamp field in the access metadata is retained and the timestamp field in the content metadata is discarded; if the value of the version field in the content metadata is greater than the version field in the access metadata, the timestamp field in the content metadata is retained and the timestamp field in the access metadata is discarded.
[0065] The storage method of the directory index node in the embodiment of the present application adds a timestamp field to both the access metadata and the content metadata of the directory, and obtains the version field that determines whether the timestamp field is retained when the directory metadata is spliced. In order to solve the problem that modifying the access metadata will generate cross-MDS requests, the present application uses the timestamp multi-version mechanism to process the timestamp and access metadata together. In order to solve the multi-version decision problem of multi-copy timestamps, the version field is introduced into the timestamp field for management, and the local clock of each MDS node after clock synchronization is used to determine the version field. In addition, the present application can avoid cross-MDS requests when modifying the access metadata, effectively reduce the overhead of modifying the access metadata, and effectively improve the efficiency of metadata modification requests.
[0066] In a second aspect, an embodiment of the present application also provides a storage device for a directory index node.
[0067] In one embodiment, referring to Figure 3 , Figure 3 This is a functional module diagram of an embodiment of a storage device for a directory index node of the present application. Figure 3 As shown, the storage device of the directory index node includes an adding module, an updating module and a writing module.
[0068] The adding module is used to add the timestamp field to the access metadata and content metadata of the directory, and to obtain the version field that determines whether the timestamp field is retained when the directory metadata is spliced; the updating module is used to assign the current value of the local clock to the version field and update the timestamp field; the writing module is used to write the updated timestamp field and access metadata into KV to realize metadata writing.
[0069] Add a timestamp field and a version field to the access metadata of the directory, and add a version field to the content metadata. For the metadata after the fields are added, the access metadata includes permission, timestamp field and version field, and the content metadata includes nlink field, timestamp field and version field. And the access metadata and content metadata are each located in an MDS. Because the file client needs to obtain the access metadata and content metadata separately when obtaining the directory metadata, and then splice them. Since there is a timestamp field in both the access metadata and the content metadata, it is necessary to compare the latest value and return it. If the comparison is based on the size of the timestamp field value itself, it cannot cope with the scenario of modifying the timestamp field in the file semantics. Therefore, this application introduces the version field in both the access metadata and the content metadata. When performing a comparison operation to determine which metadata to retain the timestamp field, it is determined by the size of the version field in each metadata.
[0070] Furthermore, in one embodiment, the value of the version field is determined by the local clock of each MDS, and a clock synchronization service is established between each MDS to maintain the order of the value of the version field. That is, the local clock of each service node is used to determine the value of the version field in each MDS, and a clock synchronization service is established between each service node to maintain the order of the version value.
[0071] Furthermore, in one embodiment, when performing the splicing operation, the timestamp field of the metadata where the version field with the larger value is located is retained according to the value of the version field. That is, when the file client obtains the directory metadata and performs the splicing operation on the access metadata and the content metadata, the value of the version field in the access metadata is compared with the value of the version field in the content metadata. If the value of the version field in the access metadata is greater than the value of the version field in the content metadata, the timestamp field in the access metadata is retained and the timestamp field in the content metadata is discarded; if the value of the version field in the content metadata is greater than the version field in the access metadata, the timestamp field in the content metadata is retained and the timestamp field in the access metadata is discarded.
[0072] Further, in one embodiment, the writing of metadata includes a request initiated by the file client to modify the directory access metadata. That is, the writing of metadata includes a request initiated by the file client to modify the directory access metadata.
[0073] For a request initiated by a file client to modify directory access metadata, specifically:
[0074] The file client initiates a request to modify the directory access metadata; that is, the file client initiates a request to modify the directory access metadata to the MDS where the access metadata is located;
[0075] The MDS assigns the current value of the local clock to the version field in the access metadata, and the MDS updates the timestamp field; that is, the MDS where the access metadata is located receives a request to modify the directory access metadata, and then the MDS where the access metadata is located assigns the current value of the local clock to the version field in the access metadata, and at the same time, the MDS where the access metadata is located updates the timestamp field;
[0076] The MDS writes the updated timestamp field and access metadata to the KV in a transactional manner, thereby implementing the writing of metadata. That is, the MDS where the access metadata is located writes the updated timestamp field and access metadata to the KV in a transactional manner.
[0077] Furthermore, in one embodiment, after the metadata is written, the process further includes: reading the metadata; the specific steps of reading the metadata include:
[0078] The file client initiates a request to read all metadata from the MDS where the access metadata is located;
[0079] Based on the request to read all metadata, the MDS where the access metadata is located initiates a request to the content MDS to obtain the content metadata;
[0080] The MDS where the access metadata is located performs the concatenation of the access metadata and the content metadata;
[0081] The MDS where the access metadata is located returns the spliced directory metadata to the file client.
[0082] It should be noted that when the MDS where the access metadata is located receives the request to read all metadata sent by the file client, the MDS where the access metadata is located initiates a request to obtain the content metadata from the MDS where the content metadata is located. When the MDS where the content metadata is located receives the request, the MDS where the access metadata is located performs a splicing operation on the access metadata and the content metadata. When the splicing of the access metadata and the content metadata is completed, the MDS where the access metadata is located returns the spliced directory metadata to the file client.
[0083] Furthermore, in one embodiment, when the MDS where the access metadata is located performs concatenation of the access metadata and the content metadata, for the version fields in the access metadata and the content metadata, specifically: a size comparison is performed on the values of the version fields in the access metadata and the content metadata, and based on the comparison result, the timestamp field of the metadata where the version field with the smaller value is located is discarded, and the timestamp field of the metadata where the version field with the larger value is located is retained.
[0084] That is, the value of the version field in the access metadata is compared with the value of the version field in the content metadata. If the value of the version field in the access metadata is greater than the value of the version field in the content metadata, the timestamp field in the access metadata is retained and the timestamp field in the content metadata is discarded; if the value of the version field in the content metadata is greater than the version field in the access metadata, the timestamp field in the content metadata is retained and the timestamp field in the access metadata is discarded.
[0085] The storage device of the directory index node in the embodiment of the present application adds a timestamp field to both the access metadata and the content metadata of the directory, and obtains the version field that determines whether the timestamp field is retained when the directory metadata is spliced. In order to solve the problem that modifying the access metadata will generate cross-MDS requests, the present application uses a timestamp multi-version mechanism to process the timestamp and access metadata together. In order to solve the multi-version decision problem of multi-copy timestamps, a version field is introduced into the timestamp field for management, and the local clock of each MDS node that has undergone clock synchronization is used to determine the version field. In addition, the present application can avoid cross-MDS requests when modifying the access metadata, effectively reduce the overhead of modifying the access metadata, and effectively improve the efficiency of metadata modification requests.
[0086] In a third aspect, an embodiment of the present application provides a storage device for a directory index node. The storage device for the directory index node may be a personal computer (PC), a laptop computer, a server, or other device having a data processing function.
[0087] Reference Figure 4 , Figure 4 The hardware structure diagram of the storage device of the directory index node involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the storage device of the directory index node may include a processor, a memory, a communication interface, and a communication bus.
[0088] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0089] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces, which are used to interconnect the devices inside the storage device of the directory index node, and interfaces used to interconnect the storage device of the directory index node with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0090] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0091] The processor may be a general-purpose processor, and the general-purpose processor may call the storage program of the directory index node stored in the memory, and execute the storage method of the directory index node provided by the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the storage program of the directory index node is called may refer to the various embodiments of the storage method of the directory index node of the present application, and will not be repeated here.
[0092] Those skilled in the art will understand that Figure 4 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0093] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.
[0094] The computer-readable storage medium of the present application stores a storage program for a directory index node, wherein when the storage program for the directory index node is executed by a processor, the steps of the above-mentioned directory index node storage method are implemented.
[0095] Among them, the method implemented when the storage program of the directory index node is executed can refer to the various embodiments of the storage method of the directory index node of the present application, and will not be repeated here.
[0096] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0097] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0098] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0099] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0100] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0101] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0102] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for storing a directory index node, characterized in that: The storage method of the directory index node includes: Add a timestamp field to both the access metadata and content metadata of the directory, and a version field to determine whether the timestamp field should be retained when obtaining the directory metadata for splicing operations; Assign the current value of the local clock to the version field and update the timestamp field; Write the updated timestamp field and access metadata into KV to implement metadata writing; in, The value of the version field is determined by the local clock of each MDS, and a clock synchronization service is established between the MDSs to maintain the order of the value of the version field; When performing the concatenation operation, the timestamp field in the metadata where the version field with the larger value is located is retained according to the value of the version field.
2. A method for storing a directory index node according to claim 1, characterized in that: The metadata writing includes a request initiated by the file client to modify the directory access metadata.
3. A method for storing a directory index node according to claim 2, characterized in that: For a request initiated by a file client to modify directory access metadata, specifically: The file client initiates a request to modify the directory access metadata; The MDS assigns the current value of the local clock to the version field in the access metadata, and the MDS updates the timestamp field; MDS writes the updated timestamp field and access metadata to KV in a transactional manner, thereby implementing metadata writing.
4. A method for storing a directory index node according to claim 1, characterized in that: After the metadata is written, the following steps are also included: reading the metadata; The metadata reading specifically includes the following steps: The file client initiates a request to read all metadata from the MDS where the access metadata is located; Based on the request to read all metadata, the MDS where the access metadata is located initiates a request to the content MDS to obtain the content metadata; The MDS where the access metadata is located performs the concatenation of the access metadata and the content metadata; The MDS where the access metadata is located returns the spliced directory metadata to the file client.
5. A method for storing a directory index node as claimed in claim 4, characterized in that: When the MDS where the access metadata is located concatenates the access metadata and the content metadata, the version fields in the access metadata and the content metadata are as follows: Compare the values of the version field in the access metadata and the content metadata. Based on the comparison result, discard the timestamp field of the metadata where the version field with the smaller value is located, and retain the timestamp field of the metadata where the version field with the larger value is located.
6. A storage device for a directory index node, characterized in that: The storage device of the directory index node includes: Add a module to add the timestamp field to both the access metadata and content metadata of the directory, and obtain the version field to determine whether the timestamp field should be retained when performing splicing operations on the directory metadata; The update module is used to assign the current value of the local clock to the version field and update the timestamp field; The writing module is used to write the updated timestamp field and access metadata into KV to implement metadata writing; in, The value of the version field is determined by the local clock of each MDS, and a clock synchronization service is established between the MDSs to maintain the order of the value of the version field; When performing the concatenation operation, the timestamp field in the metadata where the version field with the larger value is located is retained according to the value of the version field.
7. A storage device for a directory index node, characterized in that: The storage device of the directory index node includes a processor, a memory, and a storage program of the directory index node stored in the memory and executable by the processor, wherein when the storage program of the directory index node is executed by the processor, the steps of the storage method of the directory index node as described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a storage program for a directory index node, wherein when the storage program for the directory index node is executed by a processor, the steps of the directory index node storage method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Systems and methods providing metadata for tracking of information on a distributed file system of storage devices
CN101515273A
Path segmentation mapping method and device for distributed memory namespace
CN106682003A