Method for storage, electronic device and computer program product
By employing a key-value storage layout using hashing and balanced trees in the storage system, the problems of verbose page jumps and page contention are solved, thus improving storage performance.
Patent Information
- Application Number
- CN202410578820.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies in storage systems suffer from lengthy page jumps and page contention issues during read/write operations, leading to degraded storage performance.
A key-value storage layout based on hashing and balanced trees is adopted. By hashing the target key of the read operation, the target bucket page corresponding to the target key is determined in at least one bucket page, and the target address is searched in multiple records. In response to the target address being found, the target value is returned from the target entry page.
Significantly reduces page jump length, alleviates contention for pages during read/write operations, and improves storage performance.
Smart Images

Figure CN120929003A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this disclosure generally relate to the field of storage, and more specifically to methods, electronic devices, and computer program products for storage. Background Technology
[0002] A volume (also known as a storage volume) refers to a logically contiguous storage space in a storage system, which can contain files, directories, or other data. A storage system stores key-value pairs that identify a volume identifier (volume ID) and its corresponding volume's storage state. The volume identifier uniquely identifies a volume in the storage system. Volume identifier values have a large range, such as from 0 to 2^32, while the number of volume identifiers is finite, such as 778K.
[0003] Volume management involves creation, removal, and updates. The storage status of a volume, corresponding to a volume identifier, provides statistics about volume space usage. Each volume identifier indicates the storage status of the corresponding volume, such as how much data has been written to the volume. Summary of the Invention
[0004] The embodiments of this disclosure provide a storage solution that can reduce lengthy page jumps in related technologies, alleviate page contention for read / write operations, and thereby improve storage performance.
[0005] In a first aspect of this disclosure, a method for storage is provided, the method comprising determining a target bucket page corresponding to the target key in at least one bucket page by hashing the target key of a read operation. The method further comprises determining whether a target address corresponding to the target key exists among a plurality of records included in the target bucket page. The method further comprises, in response to determining that a target address exists among the plurality of records, returning a target value from the corresponding target entry page based on the target address.
[0006] In another aspect of this disclosure, an electronic device is provided, comprising a processor and a memory coupled to the processor and storing instructions thereon that, when executed by the processor, cause the electronic device to perform actions, including determining a target bucket page corresponding to the target key in at least one bucket page by hashing the target key of a read operation. These actions also include determining whether a target address corresponding to the target key exists among a plurality of records included in the target bucket page. Furthermore, these actions include returning a target value from the corresponding target entry page based on the target address in response to determining that the target address exists among the plurality of records.
[0007] In another aspect of this disclosure, a computer program product is provided. This computer program product is tangibly stored on a non-transitory computer-readable storage medium and includes machine-executable instructions that, when executed, cause a machine to perform a method or process according to embodiments of this disclosure.
[0008] Please note that the Summary of the Invention is provided to introduce a series of concepts in a simplified form, which will be further described below in the Detailed Description. The Summary of the Invention is not intended to identify key or essential features of this disclosure, nor is it intended to limit the scope of this disclosure. Attached Figure Description
[0009] The above and other objects, features, and advantages of this disclosure will become clearer through a more detailed description of the embodiments thereof in conjunction with the accompanying drawings, in which:
[0010] Figure 1 The illustration shows a schematic diagram of an example environment in which methods and / or processes according to embodiments of the present disclosure may be implemented;
[0011] Figure 2 A flowchart illustrating a method for storage according to an embodiment of the present disclosure is shown;
[0012] Figure 3 An example of a key-value storage layout based on hashing and a balanced tree according to an embodiment of the present disclosure is illustrated;
[0013] Figure 4 An example layout of a balanced tree indicated by a root page address according to an embodiment of the present disclosure is illustrated;
[0014] Figure 5 The illustration shows a process for creating an entry according to an embodiment of the present disclosure;
[0015] Figure 6 The illustration shows a process for removing an entry according to an embodiment of the present disclosure;
[0016] Figure 7 The illustration shows a diagram illustrating the process of updating entries according to an embodiment of the present disclosure; and
[0017] Figure 8 These are schematic block diagrams that can be used to implement example devices according to embodiments of the present disclosure.
[0018] In all the accompanying drawings, the same or similar reference numerals usually indicate the same or similar elements. Specific Implementation
[0019] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0020] In the description of embodiments of this disclosure, the term "comprising" and its variations should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects unless explicitly indicated otherwise.
[0021] As mentioned above, storage systems can store key-value pairs for a volume identifier (volume ID) and its corresponding volume storage state. Some related technologies utilize Log Structure Merging (LSM) tree-structured databases to store key-value pairs, where the LSM tree-structured database structures the data into parallel groups, each group being independent. This group layout has a natural advantage for concurrent writes to different groups but degrades in read scenarios. For example, in read scenarios, each parallel group (e.g., active tablets) needs to be locked to ensure consistency, and the values corresponding to a given key-value pair in each volume are aggregated during reads (depending on the characteristics of the LSM tree-structured database). Such locking causes long chains of locks and forces write waits. Furthermore, the B-tree layout within each of multiple groups causes lengthy page jumps. Thus, storage performance degrades.
[0022] To address at least some of the aforementioned and other potential problems, embodiments of this disclosure propose a storage scheme. The scheme includes determining a target bucket page corresponding to the target key within at least one bucket page by hashing the target key of a read operation. The scheme further includes determining whether a target address corresponding to the target key exists among multiple records included in the target bucket page. The scheme also includes returning a target value from the corresponding target entry page based on the target address in response to determining that a target address exists among the multiple records. In this manner, a hash- and balanced tree-based key-value storage layout is provided, which optimizes data access paths, significantly reduces page jump lengths, effectively alleviates page contention for read / write operations, and improves storage performance.
[0023] The following is for reference. Figures 1 to 8The present disclosure is provided to illustrate its basic principles and several exemplary implementations. It should be understood that these exemplary embodiments are given only to enable those skilled in the art to better understand and implement the embodiments of the present disclosure, and are not intended to limit the scope of the disclosure in any way.
[0024] Figure 1 A schematic diagram of an example environment 100 in which methods and / or processes according to embodiments of the present disclosure may be implemented is shown. Figure 1 As shown, the example environment 100 exemplarily illustrates an example storage system including a host 110 and multiple storage devices (i.e., storage devices 121-123), wherein the storage devices 121-123 may be coupled to the host 110 (e.g., via a network or line) to enable collaborative operation.
[0025] According to embodiments of this disclosure, host 110 may be a processing device with computing capabilities for processing input / output I / O requests. Applications may run on host 110, such as applications for accessing or managing storage devices 121-123, or applications based on data on storage devices 121-123, etc. Host 110 may send various requests to storage devices 121-123 for data thereon. For example, host 110 may send a request to storage devices 121-123 to retrieve target data, querying a read example.
[0026] By way of example and not limitation, host 110 may include, but is not limited to, computers, servers, mobile devices, or distributed computing environments that include any one or more of the aforementioned devices. It should be noted that the examples of host 110 and applications described herein are illustrative for purposes of understanding only, and embodiments of this disclosure are not limited to these examples and may include other different devices and applications.
[0027] According to embodiments of this disclosure, storage devices 121-123 can be configured to store data. For example, storage devices 121-123 can write new data in response to an IO request from host 100. By way of example and not limitation, storage devices 121-123 can be arranged locally or distributed, or a combination thereof, and they are coupled together via lines or networks, etc. Figure 1 As shown, storage device 121 is located locally, while storage devices 122 and 123 are located in the cloud.
[0028] It should be noted that the embodiments of this disclosure do not specifically limit the type, size, number, connection method, etc. of the storage devices 121-123. In some embodiments, the storage devices 121-123 may include, but are not limited to, hard disk drives (HDDs), solid-state drives (SSDs), hybrid hard drives (SSHDs), etc.
[0029] It should be understood that, for purposes of illustration and ease of depiction, limited components are shown in the example environment 100 used to implement embodiments of this disclosure, including one host (i.e., host 110) and three storage devices (i.e., storage devices 121-123). It should be understood that embodiments of this disclosure are not limited thereto. For example, example environment 100 may also include a cache (not shown) configured to store incremental values of a base value, etc.
[0030] The above combination Figure 1 A schematic diagram of an example environment 100 in which methods and / or processes according to embodiments of the present disclosure may be implemented is described. The following is in conjunction with... Figure 2 A flowchart is provided to describe a storage method 200 according to an embodiment of the present disclosure. To effectively prevent storage performance degradation caused by long chains of data and lengthy page jumps, a storage method 200 according to an embodiment of the present disclosure is proposed.
[0031] At box 210, the target bucket page corresponding to the target key is determined in at least one bucket page by hashing the target key of the read operation. According to embodiments of this disclosure, a hash function is used to hash the target key indicated by the IO request to the corresponding target bucket page in one or more bucket pages. This allows for rapid location of the target bucket page corresponding to the target key to retrieve the address information of the corresponding target entry page. Furthermore, this hash-based bucket page arrangement facilitates the execution of concurrent operations.
[0032] At box 220, it is determined whether a target address corresponding to the target key exists among the multiple records included in the target bucket page. According to embodiments of this disclosure, each bucket page in one or more bucket pages includes multiple records (also referred to as multiple slots), each record indicating a corresponding key and the address of the entry page corresponding to that key. The target address corresponding to the target key is searched among the multiple records included in the target bucket page.
[0033] At box 230, in response to determining that a target address exists in multiple records, the target value is returned from the corresponding target entry page based on the target address. According to embodiments of this disclosure, in the multiple records included in the target bucket page, if a target address corresponding to the target key is found, the corresponding target entry page can be addressed based on the found target address, and then the target value corresponding to the target key can be retrieved from the target entry page.
[0034] According to embodiments of this disclosure, a key-value storage layout based on hashing and a balanced tree is provided. This layout optimizes the data access path, significantly reduces page jump length, and effectively alleviates page contention for read / write operations, thereby improving storage performance. The key-value storage layout based on hashing and a balanced tree according to embodiments of this disclosure will be described in further detail below.
[0035] Figure 3 An example 300 of a key-value store layout based on hashing and a balanced tree according to an embodiment of the present disclosure is illustrated. The upper portion 310 of this example 300 shows the association between keys and bucket pages. By way of example and not limitation, a target bucket page 312 corresponding to a target key 311 is determined from a plurality of bucket pages based on the hash mapping from key to bucket page. The determined target bucket page includes address information of a target entry page 313 for addressing the target entry page 313.
[0036] Figure 3 The lower half 320 of example 300, which uses a hash-based and balanced tree key-value storage layout, illustrates the association between records (also referred to as slots) in bucket pages and entry pages. Using target bucket page 312 as an example, target bucket page 312 may include multiple records arranged linearly, where each record includes a key and a corresponding address indicating the entry page corresponding to the key in the entry. In some embodiments, there is a one-to-one correspondence between the key and address in each record.
[0037] According to embodiments of this disclosure, after target key 311 is hashed to target bucket page 312, the target address corresponding to target key 311 is searched among multiple records in target bucket page 312. For example, if the target key 311 indicated by the IO request matches record 321 (or the key in record 321) in the target bucket page, then the address in record 321 is determined as the target address, and the corresponding target entry page 313 can be addressed based on this address. Then, the target value is returned from target entry page 313. The method for returning the target value from target entry page 313 will be described in further detail below.
[0038] In some embodiments, based on a read operation associated with target key 311, an exclusive lock can be requested for target bucket page 312 and target entry page 313. When an operation holds an exclusive lock (also known as a write lock) on a resource, no other operation is allowed to access or take further action on that resource, ensuring data consistency and integrity during the operation. Furthermore, the target value can be generated by aggregating incremental values corresponding to target key 311 from the cache to disk. Whenever the base value is updated, the updated incremental values are not immediately flushed to disk; instead, the aggregation of these incremental values is delayed. One or more incremental values of the base value can be cached in a log or storage system (e.g., a cache) and aggregated in response to, for example, a read operation or a request for an exclusive lock on a page.
[0039] In some embodiments, based on a write operation associated with the target key 311, a shared lock can be requested for the target bucket page 312 and the target entry page 313. When one operation holds a shared lock (also referred to as a read lock) on a resource, other operations can also acquire a shared lock on that resource, allowing multiple operations to access or take further action on the resource simultaneously, which facilitates the execution of parallel operations. Furthermore, the incremental values corresponding to the target key 311 can be stored separately in caches, and the incremental values stored in the caches are aggregated in response to, for example, read operations or other I / O requests. When an update to the base value is required, the updated incremental value is not immediately flushed to disk but can be cached in a log or storage system (e.g., a cache). The incremental values stored in the caches are aggregated in response to predetermined trigger conditions.
[0040] Through the above mechanism, embodiments of this disclosure can handle contention between flush instances (e.g., flush writes). As described above, the hash-based and balanced tree-based key-value store according to embodiments of this disclosure can store key-value pairs for a volume identifier and its corresponding volume storage state, without requiring strong consistency for the underlying values in this use case. That is, each flush instance focuses on writing "increments" of the volume's storage state to the key-value store, so the aggregation of these increments can be postponed. Therefore, exclusive locks are not necessary in this case, while shared locks are necessary to complete the transaction of inserting such "increments" into the key-value store. Since each flush instance holds a shared lock on the page, there is no waiting between these shared lock operations, thus mitigating lock contention.
[0041] In related parallel grouping schemes, there are multiple groups, and the pages in each group are organized in a B-tree, resulting in multiple layers. According to the hash-based and balanced tree-based key-value storage layout and locking mechanism of embodiments of this disclosure, there is only a single group (on the order of 1) for bucket pages and entry pages. Thus, the length of the chain and page jumps is reduced to a relatively small size, thereby improving storage performance.
[0042] In some embodiments, among multiple records in a target bucket page 312, the last record can be used to indicate the total number of records in that bucket page (i.e., the record count). Furthermore, the last record may include the root page address 322 to indicate a balanced tree. An example of a balanced tree according to embodiments of this disclosure is a B-tree. It should be understood that this is exemplary and not limiting, and other different tree structures may also be employed. When hash collisions in a bucket page exceed a certain threshold, embodiments of this disclosure may utilize a balanced tree structure to mitigate such collisions among multiple records. Thus, a linear array with an appropriate hash bucket size configuration can handle most hash collisions, while more extreme cases are left to the balanced tree structure, thereby providing a better performance and coverage tradeoff. It should be understood that selecting the last record among multiple records to indicate the record count and the root page address of the balanced tree is exemplary and not limiting, and other records may also be selected.
[0043] In some embodiments, in response to determining that the target address 321 does not exist in any of the multiple records (from the first record to the penultimate record) included in the target bucket page 312, the balanced tree can be identified based on the root page address 322 in the last record. Figure 4 An example layout 400 of a balanced tree indicated by root page address 322 according to an embodiment of the present disclosure is illustrated. Figure 4 As shown, the balanced tree layout example 400 includes a root page 401, multiple index pages, and multiple data pages. It should be understood that... Figure 4 The layout example 400 shown is merely illustrative and not restrictive.
[0044] In some embodiments, a target index page corresponding to the target key 311, such as index page 402, can be determined in at least one index page in the balanced tree. Furthermore, based on the target index in the determined index page 402, the corresponding target data page, such as data page 403, can be located or addressed to retrieve the desired data.
[0045] Figure 5The diagram illustrates an entry creation process 500 according to an embodiment of the present disclosure. The process begins at 501, where an exclusive lock is requested on a bucket page. At 502, the bucket page is checked for empty records or records that have been released (e.g., marked FREE). At 503, in response to the discovery of an available record (also referred to as an available slot), the process proceeds to 504 to check if an entry page has been allocated for that record. At 505, in response to the allocation of an entry page, the process proceeds to 508 to request an exclusive lock on that entry page, and then updates the entry increment at 509. At 505, in response to the absence of an allocated entry page, the process proceeds to 506 to allocate a new entry page for the record from the container of free pages (FreeBin), and at 507, the record is marked as used and the key and the address of the allocated entry page are stored in the record, followed by the operations at 508 and 509.
[0046] At 503, in response to no available record, the process proceeds to 510 to check if a balanced tree is enabled, i.e., to check the last record of the bucket page, or if a page for the balanced tree has been allocated. At 511, in response to whether a balanced tree is enabled or a page for the balanced tree has been allocated, the process proceeds to 514 to request an exclusive lock on the root page of the balanced tree, and then at 515, the entry is incrementally added to the balanced tree. At 511, in response to whether a balanced tree is enabled or a page for the balanced tree has not been allocated, the process proceeds to 512 to allocate a new root page for the balanced tree from the container of free pages, and at 513, the last record of the bucket page is marked as used and the key along with the address of the allocated root page of the balanced tree is stored in the last record, and then the operations at 514 and 515 are performed respectively. The process ends.
[0047] Figure 6The diagram illustrates an entry removal process 600 according to an embodiment of the present disclosure. The process begins at 601, where an exclusive lock is requested on a bucket page. At 602, the bucket page is iteratively checked to find a used record containing a target key that corresponds to the entry to be removed. At 603, in response to finding a record containing the target key, the process proceeds to 604 to determine if the last entry on that bucket page has been used. In response to the last entry not being used, the found record containing the target key is released at 605 (e.g., marked as FREE), and the entry page corresponding to that record is retained. At 604, in response to the last entry on the bucket page being used, the process proceeds to 604 to request an exclusive lock on the root page of the balanced tree, and then the first entry of the balanced tree is updated to the found record containing the target key. In some embodiments, the balanced tree can be identified based on the root page address of the balanced tree included in the last record, and an exclusive lock can be requested for the root page of the balanced tree. Then, the index or address information of the first entry in the balanced tree, along with the entry data, can be populated into the found record containing the target key and the entry page corresponding to that record.
[0048] At 603, in response to the lack of a record containing the target key, the process proceeds to 608 to determine if the last entry of the bucket page has been used. At 609, an exclusive lock is requested on the root page of the balanced tree, and then at 610, the removal operation is performed from the balanced tree for the entry to be removed. The process ends.
[0049] Figure 7 The illustration shows an update process 700 for an entry according to an embodiment of the present disclosure. The process begins at 701, where a shared lock on a bucket page is requested. At 702, the bucket page is iteratively checked to find a matching key among the used entries that corresponds to the entry to be updated. At 703, in response to the matching record being found in the bucket page, the process proceeds to 704 to request a shared lock on the corresponding entry page, and then the entry is updated at 707. In some embodiments, the entry may be marked with a "reload-on-write" flag at 707.
[0050] At point 703, in response to the lack of a matching record in the bucket page, the process proceeds to point 705 to request a shared lock on the root page of the balanced tree, and searches for a matching key from the root page of the balanced tree that holds the shared lock. Then, the operations at point 707 are performed accordingly. The process ends.
[0051] According to embodiments of this disclosure, the multiple keys may include, but are not limited to, multiple volume identifiers, and each of the multiple volume identifiers may correspond to the storage state of a corresponding volume. Furthermore,
[0052] The size of the bucket page corresponds to the size limit for the key identifier (e.g., 778K). The lifecycle of system objects is limited to 778K, meaning the system can hold a maximum of 778K objects at a time. With this limit, coupled with an appropriate hash bucket size (778K), hash collisions can be kept to a limited extent in most scenarios.
[0053] Figure 8 A schematic block diagram is shown that can be used to implement some embodiments of the present disclosure. Figure 8 As shown, device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 802 or loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. CPU 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0054] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0055] The various processes and handling described above, such as method 200, can be executed by processing unit 801. For example, in some embodiments, method 200 can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by CPU 801, one or more actions of method 200 described above can be performed.
[0056] This disclosure can be a method, apparatus, system, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.
[0057] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0058] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to computer-readable storage media within the respective computing / processing device.
[0059] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0060] Various aspects of this disclosure have been described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0061] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0062] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0063] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0064] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for storage, comprising: By hashing the target key of the read operation, the target bucket page corresponding to the target key is determined in at least one bucket page; Determine whether a target address corresponding to the target key exists among the multiple records included in the target bucket page; as well as In response to determining that the target address exists in the plurality of records, the target value is returned from the corresponding target entry page based on the target address.
2. The method of claim 1, wherein returning the target value from the target entry page comprises: Based on the read operation, an exclusive lock is requested for the target bucket page and the target entry page; as well as The target value is generated by aggregating incremental values corresponding to the target key from the cache onto the disk.
3. The method according to claim 1, further comprising: Based on the write operation associated with the target key, a shared lock is requested for the target bucket page and the target entry page; The incremental values corresponding to the target key are stored in a cache, and the incremental values stored in the cache are aggregated in response to a request.
4. The method of claim 1, wherein the plurality of records are arranged linearly, and the last of the plurality of records includes a record count for the plurality of records and a root page address of the balanced tree for indicating the balanced tree.
5. The method according to claim 4, further comprising: In response to determining that the target address does not exist in the plurality of records, the balanced tree is identified based on the root page address; In at least one index page of the balanced tree, determine the target index page corresponding to the target key; as well as Based on the target index in the target index page, locate the corresponding target data page.
6. The method according to claim 1, further comprising: Request an exclusive lock on the target bucket page; Determine whether there are any unused empty records among the plurality of records; as well as In response to determining that an empty record exists among the plurality of records, an exclusive lock is requested for the entry page corresponding to the empty record for the purpose of creating a new entry.
7. The method according to claim 1, further comprising: Request an exclusive lock on the target bucket page; Determine whether there exists a used record containing the target key among the plurality of records; In response to determining that the record exists among the plurality of records, it is determined whether the last record among the plurality of records has been used; In response to determining that the last record has not been used, the record is released to allow for the removal of the entry. The entry page corresponding to the record is retained.
8. The method according to claim 7, further comprising: In response to determining that the last record has been used, the balanced tree is identified based on the root page address of the balanced tree included in the last record; as well as Request an exclusive lock on the root page of the balanced tree; as well as The index and data of the first entry in the balanced tree are populated into the record and the entry page corresponding to the record.
9. The method according to claim 1, wherein, The plurality of keys includes a plurality of volume identifiers, each of which corresponds to the storage state of a corresponding volume; and The size of the at least one bucket page corresponds to the size limit for the key identifier.
10. An electronic device, comprising: processor; as well as A memory coupled to the processor and storing instructions that, when executed by the processor, cause the device to perform actions, including: By hashing the target key of the read operation, the target bucket page corresponding to the target key is determined in at least one bucket page; Determine whether a target address corresponding to the target key exists among the multiple records included in the target bucket page; and In response to determining that the target address exists in the plurality of records, the target value is returned from the corresponding target entry page based on the target address.
11. The electronic device of claim 10, wherein returning the target value from the target entry page comprises: Based on the read operation, an exclusive lock is requested for the target bucket page and the target entry page; as well as The target value is generated by aggregating incremental values corresponding to the target key from the cache onto the disk.
12. The electronic device according to claim 10, wherein the action further includes: Based on the write operation associated with the target key, a shared lock is requested for the target bucket page and the target entry page; The incremental values corresponding to the target key are stored in a cache, and the incremental values stored in the cache are aggregated in response to a request.
13. The electronic device of claim 10, wherein the plurality of records are arranged linearly, and the last of the plurality of records includes a record count for the plurality of records and a root page address of a balanced tree for indicating the balanced tree.
14. The electronic device according to claim 13, wherein the action further includes: In response to determining that the target address does not exist in the plurality of records, the balanced tree is identified based on the root page address; In at least one index page of the balanced tree, determine the target index page corresponding to the target key; as well as Based on the target index in the target index page, locate the corresponding target data page.
15. The electronic device according to claim 10, further comprising: Request an exclusive lock on the target bucket page; Determine whether there are any unused empty records among the plurality of records; as well as In response to determining that an empty record exists among the plurality of records, an exclusive lock is requested for the entry page corresponding to the empty record for the purpose of creating a new entry.
16. The electronic device according to claim 10, further comprising: Request an exclusive lock on the target bucket page; Determine whether there exists a used record containing the target key among the plurality of records; In response to determining that the record exists among the plurality of records, it is determined whether the last record among the plurality of records has been used; In response to determining that the last record has not been used, the record is released to allow for the removal of the entry. The entry page corresponding to the record is retained.
17. The electronic device according to claim 16, further comprising: In response to determining that the last record has been used, the balanced tree is identified based on the root page address of the balanced tree included in the last record; as well as Request an exclusive lock on the root page of the balanced tree; as well as The index and data of the first entry in the balanced tree are populated into the record and the entry page corresponding to the record.
18. The electronic device according to claim 10, wherein, The plurality of keys includes a plurality of volume identifiers, each of which corresponds to the storage state of a corresponding volume; and The size of the at least one bucket page corresponds to the size limit for the key identifier.
19. A computer program product tangibly stored on a non-volatile computer-readable medium and comprising machine-executable instructions that, when executed, cause a machine to: By hashing the target key of the read operation, the target bucket page corresponding to the target key is determined in at least one bucket page; Determine whether a target address corresponding to the target key exists among the multiple records included in the target bucket page; and In response to determining that the target address exists in the plurality of records, the target value is returned from the corresponding target entry page based on the target address.
20. The computer program product of claim 19, wherein returning the target value from the target entry page comprises: Based on the read operation, an exclusive lock is requested for the target bucket page and the target entry page; as well as The target value is generated by aggregating incremental values corresponding to the target key from the cache onto the disk.