Method, apparatus and computer program product for processing metadata
By directly modifying metadata in the metadata storage device according to the busyness of the computing device, the problem of low metadata processing performance in traditional technology is solved, and efficient processing in busy states and fast response in non-busy states are achieved, improving improve the overall execution performance of the system.
Patent Information
- Application Number
- CN202010037217.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-14
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-01-14
AI Technical Summary
The traditional metadata processing method cannot achieve efficient processing performance when the computing device is busy, resulting in newly triggered modification transactions not being processed in time, affecting the execution performance of the system.
According to the busyness of the computing device, the metadata is modified directly in the metadata storage device without generating a log of the modification transaction in the log storage device, or the metadata is processed with the help of the log in a non-busy state to ensure that the modification transaction is executed in a timely manner.
It improves the IOPS performance of computing devices in busy conditions, ensures that newly triggered modification transactions can be executed in time, and improves the overall execution performance of the system.
Smart Images

Figure CN113190332B
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to storage technology, and more particularly, to methods, electronic devices, and computer program products for processing metadata. Background Art
[0002] In traditional data storage systems, data is divided into actual data and metadata. Actual data corresponds to real data stored by users (such as documents, audio, video, pictures, etc.). Metadata refers to data used to describe the characteristics of actual data, such as access rights, actual data owners, and distribution information of actual data blocks. During the operation of computing devices, a large number of operations on metadata are involved, such as the creation, deletion, update / modification of metadata, etc. The computing device is at different busy levels depending on the tasks it performs. Especially when the computing device is in a busy state, the traditional metadata processing method cannot achieve good processing performance. Therefore, an efficient and reliable mechanism is needed to achieve metadata maintenance. Summary of the invention
[0003] An embodiment of the present disclosure provides a solution for processing metadata.
[0004] In a first aspect of the present disclosure, a method for processing metadata is provided. The method includes: in response to receiving a modification transaction for metadata on a computing device, obtaining information related to the busyness of the computing device; and directly modifying the metadata in a metadata storage device of the computing device without generating a log related to the modification transaction in a log storage device of the computing device based on at least determining that the busyness is higher than a threshold level.
[0005] In a second aspect of the present disclosure, an electronic device is provided. The electronic device includes a processor and a memory coupled to the processor, the memory having instructions stored therein, and when the instructions are executed by the processor, the device performs an action, the action including: in response to receiving a modification transaction for metadata on a computing device, obtaining information related to the busyness of the computing device; and directly modifying metadata in a metadata storage device of the computing device, at least based on determining that the busyness is higher than a threshold level, without generating a log related to the modification transaction in a log storage device of the computing device.
[0006] In a third aspect of the present disclosure, a computer program product is provided. The computer program product is tangibly stored on a computer-readable medium and includes computer-executable instructions. When the computer-executable instructions are executed, a device is caused to perform the method according to the above first aspect.
[0007] This Summary is provided to introduce a selection of concepts in a simplified form that are further described in the Detailed Description below. This Summary is not intended to identify key features or essential features of the disclosure, nor is it intended to limit the scope of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present disclosure.
[0009] Figure 1 A schematic block diagram of a storage system in which some embodiments of the present disclosure can be implemented is shown;
[0010] Figure 2 A flowchart showing a process of processing metadata according to some embodiments of the present disclosure;
[0011] Figure 3 A schematic block diagram showing a storage system in which some embodiments of the present disclosure can be implemented; and
[0012] Figure 4 A block diagram of an example device that may be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0013] The principles of the present disclosure will be described below with reference to several example embodiments shown in the accompanying drawings. Although preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that these embodiments are described only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way.
[0014] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0015] The term "transaction" as used herein refers to an atomic unit of execution of a task in a storage system (such as a file system, etc.). A transaction as a whole is in a state of success or failure when executing a task. A "modification transaction" is usually associated with an operation on data (i.e., a file) in a system (e.g., operations such as creating, modifying, deleting, copying, cutting, and pasting files in a file system).
[0016] The term "metadata storage device" used in this document refers to a storage device in a storage system (such as a file system, etc.) for storing metadata, including but not limited to memory / cache, magnetic disk, and hard disk, etc.
[0017] The term “log storage device” used herein refers to a storage device in a storage system (such as a file system, etc.) for storing logs related to modification transactions with respect to metadata.
[0018] In traditional technologies, in addition to storing metadata on disk, computing devices also store some metadata in memory / cache (usually in the form of a metadata mirror) to ensure efficient operation of the system. Therefore, the modification of metadata usually involves the modification of the corresponding storage areas in memory / cache and disk. In addition, operations on metadata are time-sensitive operations. Metadata modification transactions need to be executed in sequence according to the time sequence of metadata modification events to ensure the correctness of metadata modifications.
[0019] In traditional solutions, metadata processing (such as metadata modification, etc.) is usually implemented with the help of logs related to modification transactions. However, traditional solutions rely too much on the creation of logs, so that when the computing device is in a busy state (especially when the storage space of the log storage device is insufficient), the newly triggered modification transaction cannot be processed in time, resulting in low execution performance of the computing device.
[0020] According to the implementation of the present disclosure, an improved scheme for processing metadata is proposed. According to the present disclosure, when the computing device is in a busy state, the computing device directly modifies the metadata in the metadata storage device of the computing device, thereby improving the IOPS of the computing device in a busy state. When the computing device is in a non-busy state, the metadata is processed with the help of logs related to the modification transaction, thereby achieving a fast input and output response. As a result, the computing device can execute the newly triggered modification transaction for metadata in a timely manner regardless of whether it is in a busy or non-busy state (especially when the computing device is in a busy state), and the IOPS performance of the computing device is improved.
[0021] Figure 1 Schematic diagram of a storage system 100 in which embodiments of the present disclosure may be implemented is shown. The exemplary data storage system 100 includes a computing device 110. The computing device 110 is a core processing device of the data storage system 100 and is used to perform various logical operations in the storage system 100.
[0022] The computing device 110 includes a log storage device 120. The log storage device 120 is used to store logs 140-1, 140-2, ..., 140-N (hereinafter collectively referred to as logs 140) of modification transactions for metadata, where N is the number of generated logs. According to some example embodiments of the present disclosure, the log storage device 120 is a power-off non-loss type storage device.
[0023] The computing device 110 further includes a metadata storage device 130 for storing metadata 150-1, 150-1, ..., 150-M (hereinafter collectively referred to as metadata 150) of the computing device 110, where M is the number of metadata stored. According to some example embodiments of the present disclosure, the metadata storage device 130 may include at least two independent storage devices, for example, a memory / cache and a disk. The memory / cache is used only when the computing device 110 is running to store a mirror of the metadata 150, so as to achieve fast access and processing of the metadata 150. The disk is used to store all metadata 150. Some examples of disks include, but are not limited to, solid-state drives (SSDs), hard disk drives (HDDs), serial advanced technology attachment (SATA) disks, serial connection (SA) small computer system interface (SCSI) disks SAS disks, and the like.
[0024] It should be understood that although Figure 1 A specific number of computing devices 110, log storage devices 120, and metadata storage devices 130 are shown. The log storage device 120 stores a specific number of logs 140, and the metadata storage device 130 stores a specific number of metadata 150. In some other example embodiments, the number of computing devices, log storage devices, metadata storage devices, logs, and metadata may vary, and the scope of the present disclosure is not limited in this respect.
[0025] Furthermore, it should be understood that the arrangement between the computing device 110 and the log storage device 120 and the metadata storage device 130 is not limited to Figure 1 Specific examples shown. In some other example embodiments, the log storage device 120 may be arranged outside the computing device 110, or even arranged in the metadata storage device 130. Alternatively or additionally, the log storage device 120 may also be a remote storage device, or a cloud storage device, etc., and the scope of the present disclosure is not limited in this respect. The metadata storage device 130 may include multiple storage devices of various types, and the multiple storage devices may be partially or completely arranged inside the computing device 110, outside the computing device 110, or even a remote storage device, or a cloud storage device, etc., and the scope of the present disclosure is not limited in this respect.
[0026] In addition, it should be understood that the connection relationship between the computing device 110 and the log storage device 120 and the metadata storage device 130 can also be in various forms, such as wired, wireless or Internet, etc., and the scope of the present disclosure is not limited in this respect.
[0027] As discussed above, metadata storage 130 may include both memory / cache and disk types of storage.
[0028] The inventors realize that one possible solution for processing metadata 150 (such as modifying metadata 150) is to first generate a log 140 related to the modification transaction in the log storage device 120 of the computing device 110, and then the computing device 110 modifies the metadata 150 in the metadata storage device 130 (i.e., memory / cache and disk) of the computing device 110, i.e., updates the storage area corresponding to the metadata 150 in the metadata storage device 130. For example, when the host (such as, CPU) of the computing device 110 receives a modification transaction for metadata 150, it first generates a log 140 related to the modification transaction in the log storage device 120 of the computing device 110. The log 140 briefly records the information of the metadata modification operation corresponding to the modification transaction. In addition, a mapping relationship can be established between the log storage device 120 and the disk of the computing device 110, so that once the metadata modification transaction is recorded in the log storage device 120, the corresponding metadata in the disk will be updated subsequently. Subsequently, the computing device 110 first updates the metadata 150 in the memory / cache, and records the updated metadata 150 in the dirty cache area. The data in the dirty cache area is finally written to the disk through the background program to implement the modification of the metadata 150.
[0029] In the above operation, the operation of returning a response to the host can be performed immediately after generating the log 140 related to the modification transaction or after updating the metadata 150 in the memory / cache. The advantage of this solution is that, since the metadata 150 in the disk is not actually modified when returning a response to the host, the time required to return a response to the host is greatly shortened, thereby improving the number of read / write operations per second (IOPS) of the computing device 110.
[0030] The inventor further realizes that the capacity of the log storage device 120 of the computing device 110 is limited. When the computing device 110 is in a busy state, the number of modification transactions for the metadata 150 will increase sharply, resulting in a serious shortage of storage space in the log storage device 120 of the computing device 110. At this time, if a new modification transaction for the metadata 150 is triggered, the newly triggered modification transaction cannot be executed immediately because there is no available storage space in the log storage device 120. The computing device 110 needs to wait for the previous modification transaction to be completed and the computing device 110 removes the corresponding log 140 stored in the log storage device 120 before executing the newly triggered modification transaction. Therefore, when the computing device is in a busy state, the execution performance of this solution is poor.
[0031] The inventors also realize that another possible solution for processing the metadata 150 (such as modifying the metadata 150) is to directly modify the metadata 150 in the metadata storage 130 (i.e., memory / cache and disk) of the computing device 110 without generating a log 140 related to the modification transaction in the log storage 120 of the computing device 110. For example, when the host of the computing device 110 receives the metadata modification transaction, the metadata 150 in the memory / cache is first updated, and then the metadata 150 in the disk is updated.
[0032] In the above operation, the operation of returning a response to the host needs to be executed after the metadata in the disk is updated. Therefore, the time required to return a response to the host is relatively long. At the same time, the inventors further realize that the advantage of this solution is that the computing device 110 does not need to generate a log 140 related to the modification transaction in its log storage device 120, so even when the computing device 110 is in a busy state, or the log storage device 120 has no available storage space, the newly triggered metadata modification transaction can still be executed immediately.
[0033] The inventors have realized the advantages and disadvantages of the above two possible solutions and have further proposed a solution of the present disclosure. The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0034] Figure 2 FIG. 2 is a flowchart showing a process 200 for processing metadata 150 according to some embodiments of the present disclosure. The process 200 may be performed by Figure 1 For ease of explanation, refer to Figure 1 The process 200 is described below.
[0035] At block 210, computing device 110 receives a modification transaction for metadata 150 on computing device 110. The modification transaction may be triggered by a variety of operations, including but not limited to, for example, creation, modification, deletion, copy, paste, cut, etc., of files / folders stored on computing device 110.
[0036] At block 220 , when the computing device 110 determines that a modification transaction for the metadata 150 on the computing device 110 is received, information related to the busyness of the computing device 110 is obtained.
[0037] According to some embodiments of the present disclosure, the computing device 110 may obtain information related to the busyness of the computing device 110 by specifically obtaining information indicating the occupancy of the storage resources of the log storage device 120. It should be understood that in this specific example embodiment, the information indicating the busyness of the computing device 110 may have multiple representations, such as the usage percentage of the storage resources of the log storage device 120, the number of remaining available storage resources of the log storage device 120, or any other information that may indicate the usage of the storage resources of the log storage device 120.
[0038] Since there is a direct correlation between the information on the occupancy of the storage resources of the log storage device 120 and whether the log 140 of the modification transaction can be generated immediately, according to this embodiment, the computing device 110 can more reasonably determine how to execute the modification transaction for the metadata 150.
[0039] Alternatively or additionally, according to some embodiments of the present disclosure, the computing device 110 may obtain information related to the busyness of the computing device 110 by specifically obtaining information indicating the usage of the central processing unit (CPU) of the computing device 110 or the computing resources of the host. It should be understood that in this specific example embodiment, the information indicating the busyness of the computing device 110 may have multiple representations, such as the usage percentage of the computing resources of the CPU or the host, the number of remaining available computing resources of the CPU or the host, or any other information that may indicate the usage of the computing resources of the CPU or the host.
[0040] Alternatively or additionally, according to some other embodiments of the present disclosure, the information indicating the busyness of the computing device 110 may also be the IOPS value of the computing device 110, etc., and the present disclosure does not limit the specific parameters indicating the information related to the busyness. It should also be understood that in other example embodiments, the information related to the busyness may also be a combination of multiple parameters.
[0041] In block 230 , when it is determined that the busyness is higher than the threshold level, computing device 110 directly modifies metadata 150 in metadata storage 130 of computing device 110 without generating log 140 related to the modification transaction in log storage 120 of computing device 110 .
[0042] It should be understood that the threshold level may have a variety of different representations according to different representations of information related to the busyness of the computing device 110. It should also be understood that the threshold level may be pre-configured by an administrator of the storage system 100, or may be dynamically generated by the computing device 110 based on historical data, and the present disclosure does not limit the configuration method of the threshold level.
[0043] According to some example embodiments of the present disclosure, the computing device 110 directly modifies the metadata 150 in the metadata storage device 130 of the computing device 110. Specifically, the computing device 110 first modifies the storage space corresponding to the metadata 150 in the memory / cache (i.e., the mirror of the metadata 150), and then the corresponding process modifies the storage space corresponding to the metadata 150 in the disk.
[0044] Additionally, when the storage space corresponding to the metadata 150 in the disk is updated, the process executing the task returns a response to the computing device 110 (usually the host of the computing device 110) to indicate that the modification transaction has been completed.
[0045] In this way, even if the computing device 110 is in a busy state, it can still execute modification transactions for the metadata 150 in a timely manner, thereby improving the IOPS of the computing device 110 when it is busy.
[0046] According to some example embodiments of the present disclosure, when it is determined that the busyness is not higher than a threshold level, the computing device 110 first generates a log 140 related to the modification transaction in the log storage device 120 of the computing device 110 , and then modifies the corresponding metadata 150 in the metadata storage device 130 of the computing device 110 .
[0047] An example implementation in which the computing device 110 performs the above operations will be given below. It should be understood that the implementation is only provided as an example and should not be construed as a limitation to the present disclosure.
[0048] According to some example embodiments of the present disclosure, the computing device 110 first generates a log 140 related to the modification transaction in the log storage device 120 of the computing device 110; then, the computing device 110 modifies the storage space corresponding to the metadata 150 in the memory / cache (i.e., the mirror of the metadata 150) and stores the updated metadata 150 in the dirty buffer area. The process executing the modification transaction may return a response to the computing device 110 (usually the host of the computing device 110) after generating the log 140 related to the modification transaction or after completing the update of the metadata 150 in the memory / cache, so as to indicate to the computing device 110 that the modification transaction has been executed. The metadata stored in the dirty buffer may be finally written to the disk through the background program to complete the modification of the storage space corresponding to the metadata 150 in the disk.
[0049] According to this example embodiment, when the computing device 110 is in a non-busy state, metadata is processed by generating a log 140 related to the modification transaction, so that the time required to return a response to the host is greatly shortened, thereby improving the IOPS of the computing device 110 in a non-busy state.
[0050] According to the above embodiments of the present disclosure, when executing a modification transaction for metadata 150, the computing device 110 obtains information related to the busyness of the computing device 110, and performs different operations for the modification transaction according to the obtained busyness information, so that the computing device 110 can execute the modification transaction in a timely manner in any case, thereby improving the IOPS performance of the computing device 110. In particular, when the system is in a busy state, the present disclosure can well improve the IOPS performance of the computing device 110.
[0051] Furthermore, the inventors have also noticed that in some scenarios, the user may perform multiple operations on the same file in the storage system 100 in a short period of time, so that there are multiple modification transactions for the same metadata 150 in the storage system 100 in a short period of time. As discussed above, the modification transactions for the metadata 150 are time-sensitive. Therefore, the computing device 110 needs to execute the modification transactions for the metadata 150 in sequence according to the time sequence of the metadata modification events to ensure the correctness of the modification of the metadata 150.
[0052] In order to ensure the accuracy of metadata modification, the present disclosure further proposes a solution to ensure that modification transactions are executed sequentially in chronological order. Specifically, when the computing device 110 executes a modification transaction for metadata 150, in addition to obtaining information related to the busyness of the computing device 110, it further obtains a modification record of the metadata 150. The modification record can indicate whether there are other modification transactions for the metadata 150 that have not yet been completed. The computing device 110 directly modifies the metadata 150 in the metadata storage device 130 of the computing device 110 only when the computing device 110 is in a busy state and there are no other unfinished modification transactions, without generating a log 140 related to the modification transaction in the log storage device 120 of the computing device 110. In this way, it can be better ensured that the modification transactions are executed sequentially in chronological order. The scheme is described in detail below.
[0053] According to some example embodiments of the present disclosure, when it is determined that the busyness is higher than the threshold, the computing device 110 further obtains a modification record of the metadata 150. The modification record may be stored in any storage space accessible to the computing device 110, such as in the memory / cache of the computing device 110.
[0054] It should be understood that the modification record can be represented in various ways. One possible representation is that, for each metadata 150, 1 bit of information is used to indicate whether there are other modification transactions for the metadata 150 that have not been completed. Another possible representation is to record the number of other modification transactions for the metadata 150 that have not been completed. Yet another possible representation is that, for each modification transaction, a modification entry is generated that includes at least the identification information of the metadata 150, so that the computing device 110 can determine the execution status information of the modification transaction of the metadata 150 based on the recorded identification information. It should be understood that in other embodiments, other methods may be used to record modification records, and the present disclosure does not limit this. In addition, it should also be understood that modification records can be recorded in various ways such as hash tables, linked lists, etc., and the present disclosure does not limit this.
[0055] According to some example implementations disclosed, the execution status may include: being processed / not yet completed, completed, etc. As another alternative implementation embodiment, the execution status may also be the execution progress expressed in percentage form. It should be understood that the execution status may have a variety of representations, and the scope of the present disclosure is not limited in this respect.
[0056] According to some example embodiments of the present disclosure, when the computing device 110 determines that the modification record indicates that there are no other modification transactions that have not been completed, the computing device 110 directly modifies the metadata 150 in the metadata storage 130 of the computing device 110. Specifically, the computing device 110 first modifies the storage space corresponding to the metadata 150 in the memory / cache (that is, the mirror of the metadata 150), and then modifies the storage space corresponding to the metadata 150 in the disk.
[0057] In this way, when the computing device 110 directly modifies the metadata 150 in the metadata storage device 130 of the computing device 110, the modification transaction can still be executed sequentially according to time, thereby ensuring the correctness of the metadata 150 processing.
[0058] Additionally, according to some example embodiments of the present disclosure, when the computing device 110 determines that the modification record indicates that there are other modification transactions that have not been completed, the computing device 110 cannot directly modify the metadata in the metadata storage device 120 of the computing device 110. At this time, if the computing device 110 is in a busy device (such as, there is no available storage space in the log storage device 120), the computing device needs to wait. When the previous modification transaction is completed and the log 140 corresponding to the modification transaction in the log storage device 120 is removed, and there is available remaining space in the log storage device 120, the modification transaction can be executed. When executing the modification transaction, the computing device first generates a log 140 related to the modification transaction in the log storage device 120 of the computing device 110; then, the computing device 110 modifies the storage space corresponding to the metadata 150 in the memory / cache (that is, the mirror of the metadata 150) and the corresponding process records the updated metadata 150 to the dirty cache area. After generating the log 140 related to the modification transaction or updating the metadata 150 in the memory / cache, the process executing the modification transaction returns a response to the computing device 110 (usually the host of the computing device 110) to indicate to the computing device 110 that the modification transaction has been completed. The data recorded in the dirty buffer is finally written to the disk through the background program to complete the modification of the storage space corresponding to the metadata 150 in the disk of the computing device 110.
[0059] In this way, when there are other modification transactions that have not been completed, the modification transactions will be recorded in the log storage device 120 of the computing device 110 in chronological order (when there is available storage space in the log storage device 120). This ensures that modification transactions for the same metadata 150 can be executed in sequence in the chronological order of the metadata modification events in any case.
[0060] According to some example implementations of the present disclosure, the computing device 110 further includes an operation of maintaining a modification record. Specifically, the computing device 110 determines the execution status of the modification transaction during operation, and dynamically updates the modification record of the metadata 150 based on the determined execution status.
[0061] Furthermore, the inventors note that when the computing device 110 directly modifies the metadata 150 in the metadata storage device 130 , there is no problem of delayed execution of the modification transaction. Therefore, the operation of maintaining the modification record can be performed only when the computing device 110 needs to generate the log 140 .
[0062] According to some example embodiments of the present invention, the computing device 110 may determine that the modification transaction has not been completed after generating the log 140 or completing the update operation of the metadata 150 in the memory / cache, and update the modification record according to the determined state that the modification transaction has not been completed. Accordingly, when the computing device 110 completes the update operation of the metadata 150 in the disk, it is determined that the modification transaction has been completed. According to the determined state that the modification transaction has been completed, the computing device 110 removes the log 140 corresponding to the modification transaction in the log storage device 120, and performs an operation to update the modification record.
[0063] In this way, the execution status of the unfinished modification transaction can be dynamically updated in real time. Therefore, even if the computing device 110 directly modifies the metadata 150 in the metadata storage device 130, it can still be ensured that the modification transaction is executed in sequence according to the time sequence.
[0064] To further illustrate the solution of the present disclosure, Figure 3 Describe some specific application examples of the present disclosure. It should be understood that Figure 3 The specific application examples described are presented for illustrative purposes only and should not be construed as limitations of the present disclosure.
[0065] Figure 3 1 shows a schematic block diagram of a storage system 100 in which some embodiments of the present disclosure can be implemented. Figure 3 As shown, the storage system 100 includes a computing device 110, which is a core processing device of the storage system and is used to perform various logical operations in the storage system 100. The computing device 110 further includes a host 310, a log storage device 120, a modification record storage device 320, and metadata storage devices 130-1 and 130-2. In this specific embodiment, the metadata storage device 130-1 is a memory / cache, and the metadata storage device 130-2 is a disk. Further, as shown in FIG. Figure 3As shown, the log storage device 120 stores logs 140-1, 140-2, ..., 140-N related to the modification transaction, the metadata storage devices 130-1 and 130-2 store metadata 150-1, 150-2, ..., 150-M, and the modification record storage device 320 stores modification records 322-1-322-2, ..., 322-L (hereinafter collectively referred to as modification records 322), where L is the number of modification records. The computing device also includes a metadata refresh engine 330, which is used to assist in implementing the refresh operation of the metadata 150 in the memory.
[0066] It should be understood that although Figure 3 A specific number of computing devices 110, log storage devices 120, metadata refresh engines 330, hosts 310, modification record storage devices 320, and metadata storage devices 130 are shown. The log storage device 120 stores a specific number of logs 140, the metadata storage device 130 stores a specific number of metadata 150, and the modification record storage device stores modification records 322 of specific data. In some other example embodiments, the number of computing devices, log storage devices, metadata storage devices, metadata refresh engines, hosts, modification record storage devices, logs, modification records, and metadata may vary, and the scope of the present disclosure is not limited in this respect.
[0067] It should also be understood that the arrangement and connection relationship between the computing device 110, the log storage device 120, the metadata refresh engine 330, the host 310, the modification record storage device 320 and the metadata storage device 130 is not limited to Figure 3 The specific arrangement and connection relationship shown. In addition, the above components can be separated or combined in other embodiments.
[0068] Figure 3 The operation sequence of the computing device 110 when processing metadata is further shown. It should be understood that this specific operation sequence is only provided as an example, and in other embodiments, operations may be added or omitted, and the execution order of operations may also be changed.
[0069] In an application example, the host 310 of the computing device 110 receives a modification transaction for metadata 150, for example, the modification transaction is to modify metadata 150-1. The host 310 obtains information related to the busyness of the computing device 110. In this specific embodiment, the host 310 can obtain storage resource usage information indicating the log storage device 120. The computing device 110 determines the busy state of the computing device 110 based on the obtained information. If the host 310 determines that the busyness of the computing device 110 is higher than the threshold level, the host 310 obtains 350 a modification record 322 from the modification record storage device 320. In this specific embodiment, the modification record 322-1 can be used to indicate the modification record for the metadata 150-1. If the modification record 322-1 indicates that there are no other modification transactions for metadata 150-1 that have not been completed, the host 310 directly modifies 352 the metadata 150-1 in the metadata storage 130-1 (i.e., memory / cache), and further modifies 354 the metadata 150-1 in the metadata storage 130-2 (i.e., disk). Subsequently, the corresponding process that executes the modification transaction returns 356 a response to the host 310 to indicate that the modification transaction for metadata 150-1 is completed.
[0070] In another application example, the host 310 of the computing device 110 receives a modification transaction for metadata 150, for example, the modification transaction is to modify metadata 150-2. The host 310 obtains information related to the busyness of the computing device 110. In this specific embodiment, the host 310 can obtain storage resource usage information indicating the log storage device 120, and determine the busy state of the computing device 110 based on the obtained information. If the host 310 determines that the busyness of the computing device 110 is not higher than the threshold level, the host 310 first generates a log 140 in the log recording device 120. In this specific embodiment, the host 310 generates 360 a log 140-1 in the log device 120, and the log 140-1 is used to record the modification transaction for the metadata 150-2. The corresponding process executing the modification transaction then modifies 362 the metadata 150-2 in the metadata storage device 130-1 (i.e., memory / cache), which can be assisted by refreshing 364 the metadata 150-2 in the metadata storage device 130-1 through the metadata refresh reference 330. At this time, the modification transaction for metadata 150-2 is determined to be in an uncompleted state, and based on the determined state, the corresponding process executing the modification transaction updates the modification record 322 in the modification record storage device 320. In this particular embodiment, the modification record 322-2 is used to indicate the execution status of the modification transaction for metadata 150-2. The corresponding process executing the modification transaction will update the modification record 322-2 so that the modification record 322-2 indicates that there are other modification transactions for metadata 150-2 that have not been completed. Subsequently, the host 310 receives 368 a response.
[0071] The updated metadata 150-2 in the metadata storage device 130-1 will be stored in the dirty buffer area. The metadata stored in the dirty buffer area can be finally written 370 to the metadata storage device 130-2 (i.e., disk) through the background program to complete the modification of the storage space corresponding to the metadata 150-2 in the metadata storage device 130-2.
[0072] Finally, the corresponding process executing the modification transaction removes 372 the log 140 (ie, log 140 - 1 ) corresponding to the modification transaction in the log storage device 120 , and performs an operation of updating 374 the modification record 322 (ie, modification record 322 - 2 ).
[0073] Figure 4 4 is a schematic block diagram of an example device 400 that can be used to implement an embodiment of the present disclosure. The device 400 can be implemented as Figure 1 The computing device 110 of FIG. 400 can be used to implement Figure 2 process 200.
[0074] As shown, the device 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 402 or loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0075] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0076] Processing unit 401 performs the various methods and processes described above, such as process 200. For example, in some embodiments, process 200 may be implemented as a computer software program or computer program product, which is tangibly contained in a machine-readable medium, such as a non-transitory computer-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by CPU 401, one or more steps of process 200 described above may be performed. Alternatively, in other embodiments, CPU 401 may be configured to perform process 200 in any other suitable manner (e.g., by means of firmware).
[0077] Those skilled in the art should understand that the various steps of the method disclosed above can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented with program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present disclosure is not limited to any specific combination of hardware and software.
[0078] It should be understood that although several devices or sub-devices of the device are mentioned in the detailed description above, this division is only exemplary and not mandatory. In fact, according to an embodiment of the present disclosure, the features and functions of two or more devices described above can be embodied in one device. Conversely, the features and functions of one device described above can be further divided into multiple devices to be embodied.
[0079] The above description is only an optional embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for processing metadata, comprising: In response to receiving a first modification transaction for metadata on a computing device, obtaining information related to a first busyness of the computing device; as well as Performing a first determination operation of determining whether the first busyness level is greater than a threshold level; as well as directly modifying first metadata in a metadata storage device of the computing device without generating a first log related to the first modification transaction in a log storage device of the computing device based at least on the first determination that the first busyness level is greater than the threshold level; Wherein modifying the first metadata comprises: Acquire a first modification record of the first metadata, where the first modification record indicates whether there is another modification transaction for the first metadata that has not been completed; as well as According to a first determination that the first modification record indicates that there are no other modification transactions that have not been completed, the first metadata is directly modified without generating the first log.
2. The method according to claim 1, further comprising: Second modification transaction for the second metadata: According to a second determination that the second busyness level is less than the threshold level, generating a second log related to the second modification transaction in the log storage device; as well as The second metadata in the metadata storage device is modified.
3. The method according to claim 1, further comprising: Second modification transaction for the second metadata: Acquire a second modification record of the second metadata, where the second modification record indicates whether there is another modification transaction for the second metadata that has not been completed; a second determination based on the second modification record indicating that there are other modification transactions that have not yet been completed, generating a second log related to the second modification transaction in the log storage device; as well as The second metadata in the metadata storage device is modified.
4. The method according to claim 3, further comprising: determining an execution status of the first modification transaction; as well as Based on the execution status, the first modification record of the first metadata is updated.
5. The method according to claim 1, wherein obtaining information related to the first busyness of the computing device comprises: Information indicating the occupancy of storage resources of the log storage device is obtained.
6. The method according to claim 1, further comprising: In response to receiving a second modification transaction for metadata on the computing device, obtaining information related to a second busyness of the computing device; performing a second determining operation of determining whether the second busyness level is greater than the threshold level; as well as At least based on the second determination that the second busyness is not greater than the threshold level, a log related to the second modification transaction is generated in the log storage device of the computing device, and after the log is generated in the log storage device, the second metadata in the metadata storage device of the computing device is modified.
7. The method of claim 6, wherein the first metadata in the metadata storage device is modified by a host; wherein the second metadata in the metadata storage device is modified by a process different from the host; as well as Wherein the method further comprises: After the first metadata in the metadata storage device is modified, the host modifies the first metadata in another metadata storage device, and After the second metadata in the metadata storage device is modified, the second metadata in the other metadata storage device is modified by a background program.
8. An electronic device comprising: processor; as well as a memory coupled to the processor, the memory having instructions stored therein, the instructions, when executed by the processor, causing the device to perform actions, the actions comprising: In response to receiving a first modification transaction for metadata on a computing device, obtaining information related to a first busyness of the computing device; and Performing a first determination operation of determining whether the first busyness level is greater than a threshold level; and directly modifying first metadata in a metadata storage device of the computing device without generating a first log related to the first modification transaction in a log storage device of the computing device based at least on the first determination that the first busyness level is greater than the threshold level; Wherein modifying the first metadata comprises: Acquire a first modification record of the first metadata, where the first modification record indicates whether there is another modification transaction for the first metadata that has not been completed; and According to a first determination that the first modification record indicates that there are no other modification transactions that have not been completed, the first metadata is directly modified without generating the first log.
9. The apparatus of claim 8, the actions further comprising: Second modification transaction for the second metadata: According to a second determination that the second busyness level is less than the threshold level, generating a second log related to the second modification transaction in the log storage device; as well as The second metadata in the metadata storage device is modified.
10. The apparatus of claim 8, the actions further comprising: Second modification transaction for the second metadata: Acquire a second modification record of the second metadata, where the second modification record indicates whether there is another modification transaction for the second metadata that has not been completed; a second determination based on the second modification record indicating that there are other modification transactions that have not yet been completed, generating a second log related to the second modification transaction in the log storage device; as well as The second metadata in the metadata storage device is modified.
11. The apparatus of claim 10, the actions further comprising: determining an execution status of the first modification transaction; as well as Based on the execution status, the first modification record of the first metadata is updated.
12. The device according to claim 8, wherein obtaining information related to the first busyness of the computing device comprises: Information indicating the occupancy status of storage resources of the log storage device is obtained.
13. The apparatus of claim 8, the actions further comprising: In response to receiving a second modification transaction for metadata on the computing device, obtaining information related to a second busyness of the computing device; performing a second determining operation of determining whether the second busyness level is greater than the threshold level; as well as At least based on the second determination that the second busyness is not greater than the threshold level, a log related to the second modification transaction is generated in the log storage device of the computing device, and after the log is generated in the log storage device, the second metadata in the metadata storage device of the computing device is modified.
14. The apparatus of claim 13, wherein the first metadata in the metadata storage device is modified by a host; wherein the second metadata in the metadata storage device is modified by a process different from the host; as well as The actions further include: After the first metadata in the metadata storage device is modified, the host modifies the first metadata in another metadata storage device, and After the second metadata in the metadata storage device is modified, the second metadata in the other metadata storage device is modified by a background program.
15. A computer program product tangibly stored on a non-transitory computer readable medium and comprising computer executable instructions that when executed cause a device to: In response to receiving a first modification transaction for metadata on a computing device, obtaining information related to a first busyness of the computing device; as well as Performing a first determination operation of determining whether the first busyness level is greater than a threshold level; as well as directly modifying first metadata in a metadata storage device of the computing device without generating a first log related to the first modification transaction in a log storage device of the computing device based at least on the first determination that the first busyness level is greater than the threshold level; Wherein modifying the first metadata comprises: Acquire a first modification record of the first metadata, where the first modification record indicates whether there is another modification transaction for the first metadata that has not been completed; as well as According to a first determination that the first modification record indicates that there are no other modification transactions that have not been completed, the first metadata is directly modified without generating the first log.
16. The computer program product of claim 15, wherein the computer executable instructions, when executed, further cause the device to: for a second modification transaction of the second metadata: According to a second determination that the second busyness level is less than the threshold level, generating a second log related to the second modification transaction in the log storage device; and The second metadata in the metadata storage device is modified.
17. The computer program product of claim 15, wherein the computer executable instructions, when executed, further cause the device to: for a second modification transaction of the second metadata: Acquire a second modification record of the second metadata, where the second modification record indicates whether there is another modification transaction for the second metadata that has not been completed; a second determination based on the second modification record indicating that there are other modification transactions that have not yet been completed, generating a second log related to the second modification transaction in the log storage device; as well as The second metadata in the metadata storage device is modified.
18. The computer program product of claim 17, wherein the computer executable instructions, when executed, further cause the device to: determining an execution status of the first modification transaction; and Based on the execution status, the first modification record of the first metadata is updated.
19. The computer program product of claim 15, wherein the computer executable instructions for the device to obtain information related to the first busyness of the computing device when executed further cause the device to: Information indicating the occupancy status of storage resources of the log storage device is obtained.
20. The computer program product of claim 15, wherein the computer executable instructions, when executed, further cause the device to: In response to receiving a second modification transaction for metadata on the computing device, obtaining information related to a second busyness of the computing device; performing a second determining operation of determining whether the second busyness level is greater than the threshold level; as well as At least based on the second determination that the second busyness is not greater than the threshold level, a log related to the second modification transaction is generated in the log storage device of the computing device, and after the log is generated in the log storage device, the second metadata in the metadata storage device of the computing device is modified.
