A storage pool space management method and electronic device
By introducing logical space bitmaps into the Ceph distributed storage system, a multi-node shared storage pool is realized, which solves the high cost and complex management problems caused by independent OSD configuration, improves the flexibility and utilization of resource scheduling, and meets diverse business needs.
Patent Information
- Application Number
- CN202511519835.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-10-23
AI Technical Summary
In existing Ceph distributed storage systems, each OSD requires independent configuration of hardware resources and software environment, resulting in high deployment and maintenance costs, complex storage pool management, insufficient resource reusability, and an inability to meet the efficient storage needs of diverse businesses.
By introducing a logical space bitmap, multiple nodes can share the same storage pool. Worker nodes can autonomously determine the target logical space address based on the bitmap, and management nodes can dynamically allocate logical space based on the global bitmap, supporting on-demand resource allocation and avoiding resource idleness or uneven load.
It reduces hardware resource investment and operation and maintenance costs, improves the flexibility of resource scheduling and overall utilization, and meets the efficient storage needs of diverse businesses.
Smart Images

Figure CN120994142B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of distributed storage systems, and particularly relates to a storage pool space management method and an electronic device. BACKGROUND
[0002] With the rapid development of cloud computing and big data technology, the amount of data is exponentially increasing, and higher requirements are put forward for the capacity, reliability and performance of distributed storage systems. As one of the mainstream solutions, the Ceph distributed storage system realizes the storage and management of data through an object storage device (OSD), and its core mechanism has been widely applied in the industry.
[0003] However, in the existing Ceph distributed storage system, each OSD needs to be independently configured with hardware resources and software environments, and a large number of redundant OSD nodes are configured to meet the reliability requirements, resulting in high deployment and maintenance costs of the OSD. In addition, in the actual deployment and operation process of the Ceph distributed storage system, different business scenarios or nodes often need to be independently configured with dedicated storage pools, which increases the complexity of storage pool management, makes it difficult to reuse existing storage resources across scenarios, reduces the flexibility and overall utilization of system resource scheduling, and cannot meet the efficient storage needs of diversified businesses. SUMMARY
[0004] The present application provides a storage pool space management method and an electronic device to at least solve the problem of insufficient storage pool reusability and inability to meet the multi-node sharing requirements in the related art.
[0005] The present application provides a storage pool space management method applied to a cluster file system, the cluster file system including a plurality of nodes and a storage pool, the plurality of nodes sharing the storage pool, and the storage pool being used to store node data and metadata of the plurality of nodes; the method comprising: acquiring, by a worker node, a logical space bitmap of the storage pool, the logical space bitmap being used to indicate logical space addresses corresponding to the plurality of nodes; determining, by the worker node, a target logical space address to be processed by the worker node according to the logical space bitmap; generating, by the worker node, a space management request according to the target logical space address; and sending, by the worker node, the space management request to a management node to request the management node to manage a logical space corresponding to the target logical space address.
[0006] The present application also provides a storage pool space management device, comprising:
[0007] An acquisition module is configured to acquire, by a worker node, a logical space bitmap of a storage pool, the logical space bitmap being used to indicate logical space addresses corresponding to a plurality of nodes;
[0008] The determination module is used to determine the target logical space address to be processed by the working node based on the logical space bitmap.
[0009] The request generation module is used to generate space management requests based on the target logical space address through worker nodes;
[0010] The sending module is used to send space management requests from worker nodes to management nodes, requesting the management nodes to manage the logical space corresponding to the target logical space address.
[0011] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the above-described method for managing the memory pool space when executing the computer program.
[0012] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described storage pool space management method.
[0013] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described storage pool space management method.
[0014] In this application, multiple nodes share the same storage pool, eliminating the need to build separate storage pools and supporting OSD environments for different nodes or services. This reduces hardware resource investment and the workload of independent configuration and maintenance. The shared storage pool design also reduces reliance on redundant nodes, lowering overall costs in both hardware deployment and software maintenance. A logical space bitmap is introduced to abstractly manage the space within the storage pool. Worker nodes obtain and use their respective logical spaces through the logical space bitmap, achieving logical isolation of business data and avoiding the creation, configuration, and maintenance of multiple storage pools. Furthermore, the unified storage pool allows for flexible resource allocation across different scenarios, breaking down existing resource reuse barriers. Worker nodes can autonomously determine the target logical space address to be processed based on the logical space bitmap and send requests to the management node for space management. The management node can dynamically allocate logical spaces based on the global bitmap, supporting on-demand resource allocation. This effectively avoids the resource idleness or uneven load issues caused by independent storage pools in the original Ceph, improving the flexibility of resource scheduling and overall utilization, ultimately meeting the efficient storage needs of diverse services. Attached Figure Description
[0015] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 A schematic diagram of a specific hardware architecture on which the execution of a method for managing a storage pool space according to an embodiment of the application relies;
[0017] Figure 2 A flowchart of a method for managing a storage pool space according to an embodiment of the application;
[0018] Figure 3A A schematic diagram of a physical storage pool according to an embodiment of the application;
[0019] Figure 3B A logical space bitmap according to an embodiment of the application;
[0020] Figure 4 Another logical space bitmap according to an embodiment of the application;
[0021] Figure 5A An interaction diagram of a worker node and a manager node according to an embodiment of the application;
[0022] Figure 5B Another interaction diagram of a worker node and a manager node according to an embodiment of the application;
[0023] Figure 5C Yet another interaction diagram of a worker node and a manager node according to an embodiment of the application;
[0024] Figure 6 A structural diagram of a device for managing a storage pool space according to an embodiment of the application;
[0025] Figure 7 A structural diagram of an electronic device according to an embodiment of the application. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0027] It should be noted that in the description of the present application, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0028] In order to more clearly illustrate the embodiments of the present application, the technical terms required to be used in the embodiments will be briefly introduced as follows:
[0029] Object Storage Daemon (OSD): In a distributed storage system such as Ceph, OSD is a daemon responsible for storing data. Each OSD manages a storage device such as a hard disk or a Solid State Drive (SSD), performs read and write operations on data, and is responsible for data replication, recovery, rebalancing and other operations to ensure data reliability and load balancing of the cluster. In addition, OSD monitors its own health status and exchanges heartbeat information with other OSDs to maintain the stability of the cluster.
[0030] Metadata Server (MDS): In a distributed file system, MDS is a server responsible for managing file system metadata. It stores the hierarchy of files and directories, permission information, file attributes, quota information, etc. MDS is also responsible for handling namespace management operations such as file and directory creation, deletion, renaming, ensuring file system consistency, handling concurrent access and updates, and assisting in recovering file system metadata in the event of system failure.
[0031] Ceph distributed storage system realizes dynamic data distribution through Controlled Replication Under Scalable Hashing (CRUSH) algorithm, ensures balanced storage of data among cluster nodes, adopts multi-copy redundancy or erasure code strategy to resist node failure risk and guarantee data reliability, and directly manages bare devices with BlueStore storage engine to reduce the intermediate overhead of traditional file systems and effectively improve storage performance. In addition, Ceph system adopts a design architecture that separates data pool and metadata pool, stores file data and metadata describing data attributes and location separately, and further optimizes data access efficiency.
[0032] However, the existing Ceph distributed storage system still has many technical problems to be solved in the actual deployment and operation process: First, the deployment and maintenance cost of OSD is high. Each OSD needs to be independently configured with hardware resources and software environment, and the risk of single point failure is high. A single OSD failure can cause the corresponding data replica to fail, and the data reconstruction and recovery process needs to be triggered immediately, increasing the operation complexity. At the same time, in order to meet the reliability requirements, the system needs to configure a large number of redundant OSD nodes, resulting in low utilization of hardware resources and serious waste of resources. Second, the cluster scalability is poor, and node changes can easily cause performance fluctuations. When adding or removing OSD nodes, the CRUSH algorithm will trigger large-scale data migration within the cluster to realize the balanced distribution of data again. This process will occupy a large amount of network bandwidth and storage I / O resources, causing I / O pressure to concentrate, not only causing the cluster performance to drop significantly, but also in extreme cases, it may cause service interruption due to resource exhaustion, affecting business continuity. Finally, the storage pool reusability is insufficient, and the adaptability is limited. In the existing system, different business scenarios or nodes often need to be independently configured with dedicated storage pools, and it is not possible to realize the sharing of a unified storage pool by all nodes. This design not only increases the management complexity of the storage pool, but also makes it difficult to reuse the existing storage resources across scenarios, reducing the flexibility and overall utilization of the system's resource scheduling, and failing to meet the efficient storage needs of diversified businesses.
[0033] To address all or part of the aforementioned technical problems, this application provides a storage pool space management method. Addressing the high deployment and maintenance costs in Ceph due to the need for independent hardware and software configuration for each OSD and the presence of numerous redundant nodes, this method allows multiple nodes to share the same storage pool. This eliminates the need to build separate storage pools and supporting OSD environments for different nodes or services, reducing hardware resource investment and the workload of independent configuration and maintenance. Furthermore, the shared storage pool design reduces dependence on redundant nodes, lowering overall costs from both hardware deployment and software maintenance perspectives. For the management complexity and difficulty in resource reuse across scenarios caused by the need for independent configuration of dedicated storage pools for different business scenarios, the method introduces a logical space bitmap to abstractly manage the space within the storage pool. The logical space bitmap clearly indicates the logical space address corresponding to each node. Nodes in different business scenarios do not need dedicated storage pools; they only need to obtain and use their respective logical spaces through the bitmap. This achieves logical isolation of business data and avoids the creation, configuration, and maintenance of multiple storage pools. Simultaneously, the unification of the storage pool allows for flexible resource allocation across different scenarios, breaking down the original barriers to resource reuse. In addition, to address the shortcomings of insufficient resource scheduling flexibility and low overall utilization, the working nodes can autonomously determine the target logical space address to be processed based on the logical space bitmap and send a request to the management node to achieve space management. The management node can dynamically allocate logical space based on the global bitmap, supporting on-demand resource allocation. This effectively avoids the resource idleness or uneven load problems caused by independent storage pools in the original Ceph, improves the flexibility of resource scheduling and overall utilization, and ultimately meets the efficient storage needs of diverse businesses.
[0034] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0035] The specific application environment architecture or specific hardware architecture on which the execution of the storage pool space management method depends is described here.
[0036] like Figure 1 As shown, Figure 1 This is a schematic diagram of the specific hardware architecture on which the execution of a storage pool space management method provided in this application embodiment depends.
[0037] All nodes in a cluster file system share a logically unified storage pool.
[0038] The management node (NODE 0) contains the metadata management component MDS0, which includes a global space allocator (HugeBlock Alloc) and a metadata allocator (Meta-0 Alloc). The global space allocator manages the allocation of all available space; the metadata allocator manages the allocation of metadata space. The node data allocator (Data-0 Alloc) manages and allocates node data space.
[0039] Each worker node (such as NODE 1) contains a metadata management component, MDS1. MDS1 includes a metadata allocator (Meta-1 Alloc) used to allocate and manage the metadata space of worker node NODE 1. A node data allocator (Data-1Alloc) is used to allocate and manage the node data of worker node NODE 1.
[0040] Figure 2 A flowchart illustrating a storage pool space management method provided in this application embodiment is shown below. Figure 2 As shown, the method includes the following steps S201~S204:
[0041] S201. Obtain the logical space bitmap of the storage pool through the worker node.
[0042] The logical space bitmap is used to indicate the logical space corresponding to multiple nodes. The storage pool is a shared storage pool among multiple nodes in the cluster file system.
[0043] This application divides the shared storage pool into multiple block spaces according to a preset spatial granularity, and saves the block spaces using a bitmap to obtain a logical space bitmap. For example... Figure 3A and 3B As shown, the physical storage pool is divided into numerous discrete block spaces, each with a 1GB unit. When constructing the logical storage pool, these 1GB blocks from the physical space are evenly distributed within it. The logical storage pool is divided into different intervals, such as 0-8PB, 8-16PB, etc., with each interval corresponding to one node.
[0044] like Figure 3B The logical space bitmap shown indicates that there is one management node and three worker nodes in the cluster file system. MDS0 is the metadata management component of the management node, and MDS1-3 are the metadata management components of the three worker nodes. The logical space bitmap shows that the cluster file system shares a logical storage pool of 32PB. In this logical storage pool, the 0-8PB range is allocated to the management node, the 8-16PB range is allocated to the worker node corresponding to MDS1, the 16-24PB range is allocated to the worker node corresponding to MDS2, and the 24-32PB range is allocated to the worker node corresponding to MDS3.
[0045] The present application designs two small block allocators bound on a work node: a metadata allocator and a node data allocator. The metadata allocator is used to manage the metadata space; and the node data allocator is used to manage the node data space.
[0046] Correspondingly, a global space allocator is bound on the management node, which is used to uniformly manage the metadata space and the node data space of the work node. The global space allocator cuts the shared storage pool according to a preset space granularity to obtain a plurality of discrete block spaces of a preset size, and saves these block spaces in a bitmap manner to obtain a logical space bitmap of the storage pool. The metadata allocator or the node data allocator of each work node can apply for space from the global space allocator on the management node.
[0047] The Bit structure used to describe the storage-related information in the logical space bitmap is defined as shown in Table 1:
[0048] Table 1
[0049]
[0050] In Table 1, Bit 7 represents the state, "1" represents occupation, and "0" represents idle, which is used to identify the use state of the corresponding storage unit; Bits 6-5 define the large block length, and different two-bit combinations correspond to different length specifications, "00" corresponds to 1024M, "01" corresponds to 256M, "10" corresponds to 512M, and "11" corresponds to 768M, to determine the size of the storage block; Bit 4 is used to distinguish the storage type, "1" represents metadata, and "0" represents node data, to explicitly identify the type of the storage content. Bits 3-0 indicate the belonging instance id, which is rank_id for metadata, and member_id for node data, to determine the specific instance to which the storage unit belongs.
[0051] S202, determining, by the work node, a target logical space address to be processed by the work node according to the logical space bitmap.
[0052] The target logical space address to be processed by the work node refers to the logical space address applied for by the work node, or the logical space address that needs to be recycled by the work node.
[0053] In some embodiments, the work node first determines the block space offset address belonging to itself, and then determines the block space bitmap belonging to the work node according to the block space offset address and the logical space bitmap. In the case where the remaining space of the node data of the work node is less than a first preset threshold, the first logical space address to be processed by the work node is determined according to the block space bitmap.
[0054] The node data remaining space is the remaining space of the working node in the shared storage pool for storing node data, and the node data allocated space is the available amount of space that has been allocated to the working node for storing node data. The first preset threshold is a minimum value of the available amount of node data space, and less than the first preset threshold indicates that the space of the working node for storing node data is insufficient. The first logical space address is used to indicate the range of the storage unit allocated by the management node to the working node for storing node data. After obtaining the first logical space address, the management node can first determine all logical space addresses allocated to the working node for storing node data, and further determine the first logical space address requested this time from the all logical space addresses, so as to allocate the logical space corresponding to the first logical space address to the working node, thereby ensuring that the working node can completely store its node data.
[0055] As shown in Figure 4 , it is assumed that the 8-16PB interval in the logical space bitmap of the logical storage pool is the interval of the working node corresponding to the MDS1. The working node corresponding to the MDS1 determines the metadata space bitmap from the 8-16PB interval according to the block space offset address of the metadata, as shown in the red marked part.
[0056] The working node determines the block space bitmap that is exclusively its own from the entire logical space bitmap according to its own block space offset address, avoids address overlap or boundary ambiguity problem in space use of different nodes, and makes the space belonging of each working node more clear. The first preset threshold is set, and the node data remaining space is monitored to realize real-time perception of the insufficient space state of the working node. It is judged whether the node data remaining space is less than the first preset threshold. If yes, it indicates that the space of the working node for storing node data is in urgent need, and the first logical space address to be processed of the working node is determined according to the block space bitmap of the working node, that is, the address range of the storage unit needed to be requested from the management node for storing node data is determined, so that the management node can allocate the corresponding storage unit to the working node for storing the node data of the working node according to the first logical space address, and realize the on-demand dynamic allocation of resources.
[0057] In combination with Figure 1 , when the node data allocator of the working node is insufficient, the available space for storing node data is applied to the global space allocator bound to the management node.
[0058] In a case where the metadata remaining space of the worker node is less than the preset threshold, it indicates that the space for storing metadata of the worker node is in shortage, and then the logical space address to be processed of the worker node is determined according to the block space bitmap of the worker node, that is, the address range of the storage unit for storing metadata which needs to be requested from the management node is determined, so that the management node can allocate the corresponding storage unit to the worker node according to the address range, and thus the worker node can have enough space to store metadata.
[0059] In combination Figure 1 When the metadata allocator space of the worker node is insufficient, the metadata space for storing metadata is applied from the global space allocator bound to the management node.
[0060] By monitoring the relationship between the metadata remaining space and the preset threshold, the state of the metadata storage space in shortage is accurately captured, and problems such as disordered directory structure of the file system and lost file attributes caused by insufficient metadata storage space are avoided, which provides an early warning mechanism for metadata storage and ensures that the space supplement request is initiated in time at the critical node.
[0061] The logical space address to be processed is determined according to the block space bitmap of the worker node, and the address range is specially used for storing metadata, which realizes on-demand positioning and special-purpose use, avoids the confusion of metadata and node data in space allocation, ensures that the management node can accurately allocate the storage unit that meets the metadata storage demand, meets the requirements of continuity of storage location and high efficiency of access of metadata, and does not occupy the storage space of node data, and realizes the reasonable division of metadata and node data storage resources.
[0062] S203, generating a space management request by the worker node according to the target logical space address.
[0063] The space management request is used to request the logical space of other nodes, or is used to request the idle logical space of the worker node.
[0064] In some embodiments, in a case where the metadata remaining space of the worker node is greater than a second preset threshold, a second logical space address to be processed of the worker node is determined according to the block space bitmap of the worker node.
[0065] The metadata remaining space of the worker node is the remaining space for storing metadata of the worker node in the shared storage pool. The second preset threshold is a threshold for recycling metadata space, and greater than the second preset threshold indicates that the space for storing metadata of the worker node is excessive and can be recycled. The second logical space address is used to request the management node to recycle the range of storage units for storing metadata from the worker node.
[0066] After determining the block space bitmap of the worker node from the entire logical space bitmap according to the block space offset address of the worker node, the worker node determines whether the remaining metadata space is greater than a second preset threshold. If yes, it means that the space of the worker node for storing metadata is redundant. Then, the worker node determines the second logical space address to be processed according to the block space bitmap of the worker node, that is, determines the address range of the storage unit that needs to be requested from the management node for recycling from the worker node, so that the management node can recycle the corresponding storage unit from the worker node according to the second logical space address. This avoids the risk of metadata storage caused by blind recycling and ensures that the recycled metadata storage unit is truly idle. At the same time, the explicit address range also enables the management node to quickly locate and perform the recycling operation, thereby improving the recycling efficiency.
[0067] By recycling the excess space and re-integrating it into the global resource pool of the storage pool, the excess space can be used by other worker nodes that need metadata or node data storage, breaking the resource occupation barrier and improving the space utilization of the entire storage pool. Recycling and redistribution of excess metadata space helps to avoid the unbalanced state of long-term occupation of excessive resources by some worker nodes and resource shortage by other nodes. The management node can flexibly allocate the recycled space to the demand nodes based on the recycled space, balance the resource occupation of each node, reduce the system load tilt problem caused by uneven resource allocation, and further improve the running efficiency and stability of the entire cluster file system, thereby ensuring the efficient storage needs of diversified businesses in the dynamic resource scenario.
[0068] In the case where the remaining metadata space of the worker node is greater than the second preset threshold, after determining the second logical space address to be recycled of the worker node, it is determined whether the second logical space address contains a reserved logical space address. The reserved logical space address is the logical space address of at least one block space reserved in advance and is always used for metadata storage and is not included in the recycling mechanism. If the second logical space address does not contain the reserved logical space address, it means that all logical spaces corresponding to the second logical space address support recycling, and then a request containing the second logical space address is directly sent to the management node, so that the management node recycles the storage unit corresponding to the second logical space address from the worker node in response to the request.
[0069] The reserved logical space address is a superblock space reserved in advance for storing metadata. The superblock space refers to a specific storage area in the file system that is used to store superblock and backup data, and is an important part of ensuring the normal mounting of the file system and data consistency. The superblock is the core metadata structure of the file system, which is used to record key information of the entire file system, such as file system size, inode total number, free block number, block size, etc. In this application, two superblock spaces can be reserved in advance.
[0070] The second logical space address does not contain the reserved logical space address, indicating that recovering the logical space directly from the worker node does not affect the normal work of the worker node, so a request containing the second logical space address is sent to the management node, and it is not necessary to regenerate an additional request, thereby reducing unnecessary delay. At the same time, the explicit address range division enables the management node to quickly locate and recover the releasable storage unit, thereby improving the response speed of resource reallocation. The key metadata space is ensured not to be affected by recovery, and the truly idle storage space is maximally released, so that these resources can be timely reused by other nodes.
[0071] If it is judged that the second logical space address contains the reserved logical space address, the reserved logical space address is first removed from the second logical space address to obtain a third logical space address, and then a request containing the third logical space address is sent to the management node, so that the management node recovers the storage unit corresponding to the third logical space address from the worker node in response to the request.
[0072] The second logical space address contains the reserved logical space address, indicating that if the storage unit corresponding to the second logical space address is directly recovered, the normal work of the worker node will be affected. To avoid adverse effects on the worker node, the reserved logical space address needs to be removed from the second logical space address to generate a new third logical space address. The storage unit corresponding to the third logical space address is recoverable, and then a space recovery request is generated according to the third logical space address and sent to the management node, so that the management node recovers the idle and safe storage unit from the worker node according to the third logical space address.
[0073] By removing the key addresses to obtain a third logical space address when it is detected that the second logical space address to be recovered contains the reserved logical space address, and then performing the recovery operation, the risk of mistakenly recovering the key metadata storage space is effectively prevented, and the reserved logical space is ensured to remain in a usable state, thereby providing a security guarantee for the continuous storage of metadata. By accurately removing the unrecoverable reserved space, other idle metadata storage units can be maximally recovered, and these resources are brought back into the shared storage pool for use by other nodes, thereby avoiding the problem of large-area space being unable to be recovered due to the existence of the reserved logical space, and improving the overall utilization rate of storage resources. The system is allowed to flexibly cope with changing storage demands while maintaining the necessary safety margin, thereby achieving the best balance between safety and flexibility.
[0074] The judgment mechanism of introducing the reserved logical space address in the metadata space recycling process of the above embodiment improves the safety of the recycling operation and the stability of the system. By judging whether the second logical space address to be recycled contains a reserved logical space address before recycling, metadata loss or file system abnormalities caused by mistakenly recycling critical metadata space can be effectively prevented. The reserved logical space as a safe area for metadata always remains available, ensuring the continuity and reliability of metadata storage, and even in the frequent space recycling and allocation process, the core functions of the system are not affected.
[0075] S204, sending a space management request to the management node through the worker node to request the management node to manage the logical space corresponding to the target logical space address.
[0076] As shown in Figure 5A , the worker node first acquires the logical space bitmap of the storage pool, then determines the target logical space address to be processed according to the logical space bitmap, and further generates a space management request according to the target logical space address and sends it to the management node. After receiving the space management request, the management node manages the logical space corresponding to the target logical space address.
[0077] In combination with Figure 1 , a metadata management component MDS0 is arranged on the management node, which is used to manage the available space of all nodes of the cluster file. The worker node applies for using metadata (mds) space or node data (client) space to the management node.
[0078] As in the foregoing embodiment, the space management request includes but is not limited to: a request containing a first logical space address, used to request allocation of a storage unit corresponding to the first logical space address; a request containing a second logical space address, used to request recycling of a storage unit corresponding to the second logical space address; a request containing a third logical space address, used to request recycling of a storage unit corresponding to the third logical space address.
[0079] If the worker node sends a request containing a first logical space address to the management node, the management node responds to the request to apply for a logical space corresponding to the first logical space address. On the basis of the foregoing embodiment, the first logical space address is a range of storage units for storing node data requested by the worker node from the management node. The management node determines the corresponding logical space according to the first logical space address, and allocates this part of space to the worker node, so that the worker node can store node data using this part of space.
[0080] As shown in Figure 5BAs shown, the worker node first acquires the logical space bitmap of the storage pool, then determines the first logical space address that it needs to apply according to the logical space bitmap, and further generates a space management request according to the first logical space address and sends it to the management node. After receiving the space management request, the management node applies the logical space corresponding to the first logical space address, first updates the logical space bitmap of the storage pool according to the first logical space address, and then allocates the logical space corresponding to the first logical space address to the worker node.
[0081] Considering the atomicity of bitmap update, the logical space bitmap of the present application is saved in the mode of bitmap file header, bitmap and bitmap copy. The separation design of bitmap copy and file header allows the worker node to efficiently complete the calculation and modification of the bitmap locally, and only switches into effect through the file header when necessary, which can reduce the overhead of cross-node coordination and synchronization.
[0082] Optionally, the worker node updates the bitmap copy of the logical space bitmap and / or the block space bitmap according to the first logical space address, and updates the bitmap file header of the logical space bitmap and / or the block space bitmap according to the first logical space to complete the update of the logical space bitmap. The bitmap file header is used to save the pointer of the block space position, which provides an index for fast positioning and accessing the block space, can reduce the addressing overhead, and is conducive to improving the system response speed. The centralized management of the block space position pointer can reduce the delay of random access, making the space allocation and recycling operation more efficient.
[0083] When updating the logical space bitmap, the bitmap copy of the logical space bitmap is first updated, and the bitmap file header is updated after the disk writing is successful, which improves the reliability and consistency of the logical space bitmap management. Specifically, the existence of the bitmap copy provides redundancy protection for the bitmap file. Even if node downtime or storage medium failure occurs during the update process, the bitmap state can be recovered from the copy, reducing the risk of damage to node data and metadata. After the new bitmap content is persisted, it is converted into a valid version by updating the file header, thereby avoiding the problem of inconsistent bitmap versions caused by failure in the middle of the process, and ensuring the correctness of logical space allocation and recycling.
[0084] If the worker node sends a request containing the first logical space address to the management node, the management node responds to the request by first determining at least one block space according to the first logical space address according to a preset space granularity, and then allocating the at least one block space to the worker node.
[0085] The at least one block space contains the storage unit corresponding to the first logical space address. The preset space granularity is a pre-set space size, for example, 1G.
[0086] It can be understood that the management node allocates space for the worker node to store node data according to a preset space granularity as a minimum allocation unit, simplifies the complexity of space management, and enables the management node to efficiently and consistently process various space requests. This fixed-granularity allocation method reduces fragmentation, improves storage utilization, and facilitates system load balancing and resource scheduling.
[0087] In the above embodiments, the fixed space granularity makes the resource allocation process more transparent and facilitates monitoring and management, and also reduces the metadata update overhead caused by frequent small-granularity allocation. The management node can process space requests in batches, reducing communication and computing burden and improving the overall performance of the system.
[0088] If the worker node sends a request containing the second logical space address to the management node, the management node recovers the logical space corresponding to the second logical space address in response to the request. Based on the foregoing embodiments, the second logical space address is a range of storage units requested by the worker node from the management node to recover for storing metadata. The management node determines the logical space corresponding to the second logical space address according to the second logical space address, recovers this part of space from the worker node, releases the idle space, and re-integrates the idle space into the shared storage pool for use by other nodes.
[0089] As shown in Figure 5C , the worker node first obtains the logical space bitmap of the storage pool, then determines the second logical space address that it needs to recover according to the logical space bitmap, and further generates a space management request according to the second logical space address and sends it to the management node. After receiving the space management request, the management node first locates the logical space corresponding to the second logical space address, then updates the logical space bitmap of the storage pool according to the second logical space address, and then recovers the logical space corresponding to the second logical space address from the worker node.
[0090] Optionally, the worker node determines a fourth logical space address according to the second logical space address and the preset space granularity, and the range of the fourth logical space address is less than or equal to the range of the second logical space address. Then, the worker node sends a request containing the fourth logical space address to the management node, so that the management node recovers the block space corresponding to the fourth logical space address in response to the request.
[0091] It can be understood that the management node recovers idle space from the worker node according to a preset space granularity as a minimum recovery unit. Aligning the recovery unit to the preset space granularity avoids frequent recovery operations on fragmented address space, reduces the number of metadata updates and communication overhead of the management node, and improves the overall performance of the system. By extending the recovery range to the granularity boundary, the integrity of the recovered block space is ensured, which facilitates efficient reuse of these block spaces in subsequent allocation, reduces the generation of storage fragmentation, and improves space utilization.
[0092] in combination Figure 1 When the remaining space inside the metadata allocator of the worker node exceeds the second preset threshold, the free block space of the preset size is returned to the global space allocator of the management node.
[0093] If the worker node sends a request containing a third logical space address to the management node, the management node recovers the logical space corresponding to the third logical space address in response to the request. On the basis of the foregoing embodiment, the third logical space address does not contain the reserved logical space address, and normal recovery is supported. The management node determines the corresponding logical space according to the third logical space address, and then recovers the space from the worker node, thereby preventing the risk caused by mistakenly recovering the key metadata storage space corresponding to the logical space address.
[0094] Similarly, the worker node determines the logical space address to be recovered according to the third logical space address and the preset space granularity, the logical space address to be recovered is less than or equal to the third logical space address in unit, and does not contain the reserved logical space address. Then, the worker node sends a request containing the logical space address to be recovered to the management node, so that the management node recovers the free and safe block space from the worker node in response to the request.
[0095] In summary, the management method of the storage pool space provided in the present application is based on multi-node sharing of a unified storage pool, and the block space is divided according to a fixed granularity during allocation to avoid fragmentation. During recovery, the address to be recovered is expanded to the granularity boundary to ensure the integrity of the recovered block, which not only reduces the idle resources caused by traditional independent storage pools, but also re-integrates the idle resources into global scheduling through dynamic recovery of excess metadata space, thereby improving the overall utilization rate of the storage pool and the cross-scene reuse capability. In data management, the first preset threshold is used to monitor whether the node data space is insufficient, and the second preset threshold is used to identify whether the metadata space is excessive, thereby realizing dynamic adaptation of node data and metadata storage, preventing mistaken recovery through reserved logical space addresses, and ensuring metadata safety. The logical space bitmap adopts a storage mode of file header, bitmap, and copy, and the update follows the order of first copying to disk and then updating the file header, thereby avoiding data loss and version inconsistency and providing reliable metadata support for space management. Before block space allocation, the target address is determined through the bitmap to ensure that the addresses of all nodes are not overlapped, thereby further ensuring the stability of data storage. The unified storage pool replaces the traditional multiple dedicated storage pools, thereby reducing the complexity of independent configuration and maintenance. The worker node initiates a request according to the bitmap and the threshold, and the management node uniformly processes allocation and recovery according to the granularity, thereby reducing the cross-node coordination cost. Meanwhile, the preset space granularity can be adjusted according to business requirements to adapt to different scale storage scenarios, so that the system can flexibly cope with the efficient storage requirements of diversified businesses, and the problems of high deployment and maintenance cost and rigid resource scheduling of the traditional Ceph system are improved.
[0096] Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software on a general hardware platform necessary, and of course can also be realized by hardware, but in many cases the former is a better embodiment.
[0097] As shown in Figure 6 The embodiments of the present application also provide a storage pool space management device, which comprises:
[0098] The acquisition module 601 is configured to acquire, by the working node, a logical space bitmap of the storage pool, the logical space bitmap being used to indicate logical space addresses corresponding to the plurality of nodes.
[0099] The determination module 602 is configured to determine, by the working node, a target logical space address to be processed by the working node according to the logical space bitmap.
[0100] The request generation module 603 is configured to generate, by the working node, a space management request according to the target logical space address.
[0101] The sending module 604 is configured to send, by the working node, the space management request to the management node, so as to request the management node to manage the logical space corresponding to the target logical space address.
[0102] As an optional embodiment provided by the embodiments of the present application, the determination module 602 is specifically configured to: determine, by the working node, a block space offset address belonging to the working node; determine, according to the block space offset address and the logical space bitmap, a block space bitmap of the working node; and in a case where a node data remaining space of the working node is less than a first preset threshold, determine, according to the block space bitmap, a first logical space address to be processed by the working node; wherein the first logical space address is used to indicate a range of storage units allocated by the management node to the working node to store node data.
[0103] As an optional embodiment provided by the embodiments of the present application, after determining, according to the block space offset address and the logical space bitmap, the block space bitmap of the working node, the determination module 602 is further configured to: in a case where a metadata remaining space of the working node is greater than a second preset threshold, determine, according to the block space bitmap, a second logical space address to be processed by the working node; wherein the second logical space address is used to indicate a range of storage units recovered from the working node by the management node to store metadata.
[0104] As an optional implementation of the embodiment provided in the present application, the determining module 602 is further configured to, in the case that the metadata remaining space of the worker node is greater than the second preset threshold, determine the second logical space address to be processed by the worker node according to the block space bitmap, and is further configured to: determine whether the second logical space address contains a reserved logical space address, the reserved logical space address being a logical space address of at least one block space reserved in advance; and if the second logical space address does not contain the reserved logical space address, send a request containing the second logical space address to the management node, so that the management node recycles the storage unit corresponding to the second logical space address from the worker node in response to the request.
[0105] As an optional implementation of the embodiment provided in the present application, the determining module 602 is further configured to, in the case that the metadata remaining space of the worker node is greater than the second preset threshold, determine the second logical space address to be processed by the worker node according to the block space bitmap, and is further configured to: determine whether the second logical space address contains a reserved logical space address, the reserved logical space address being a logical space address of at least one block space reserved in advance; and if the second logical space address does not contain the reserved logical space address, send a request containing the second logical space address to the management node, so that the management node recycles the storage unit corresponding to the second logical space address from the worker node in response to the request.
[0106] As an optional implementation of the embodiment provided in the present application, the sending module 604 is specifically configured to: send, by the worker node, a request containing the first logical space address to the management node; and allocate, by the management node, at least one block space to the worker node according to the first logical space address in response to the request containing the first logical space address.
[0107] As an optional implementation of the embodiment provided in the present application, the apparatus further comprises an updating module configured to: update, by the worker node, the bitmap copy of the logical space bitmap and / or the block space bitmap according to the first logical space address; and update, by the worker node, the bitmap file header of the logical space bitmap and / or the block space bitmap according to the first logical space address, so as to complete the updating of the logical space bitmap.
[0108] As an optional implementation of the embodiment provided in the present application, the sending module 604 is specifically configured to: send, by the worker node, a request containing the first logical space address to the management node; and allocate, by the management node, at least one block space to the worker node according to the first logical space address in response to the request containing the first logical space address.
[0109] As an optional implementation of the embodiments of the present application, the sending module 604 is specifically configured to: determine, by the worker node, a fourth logical space address according to the second logical space address and the preset space granularity, the range of the fourth logical space address being less than or equal to the range of the second logical space address; and send, by the worker node, a request containing the fourth logical space address to the management node, so that the management node recycles the block space corresponding to the fourth logical space address in response to the request.
[0110] The features of the embodiments of the management apparatus of the storage pool space can be referred to the related descriptions of the embodiments of the management method of the storage pool space, which will not be repeated here.
[0111] As shown in Figure 7 The embodiments of the present application further provide an electronic device, including a memory 701 and a processor 702, the memory 701 stores a computer program, and the processor 702 is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the management method of the storage pool space.
[0112] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any of the above-mentioned embodiments of the management method of the storage pool space when running.
[0113] In an exemplary embodiment, the above-mentioned computer readable storage medium can include, but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0114] The embodiments of the present application further provide a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the steps in any of the above-mentioned embodiments of the management method of the storage pool space.
[0115] The embodiments of the present application further provide another computer program product, which includes a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in any of the above-mentioned embodiments of the management method of the storage pool space.
[0116] Those skilled in the art will further realize that the mere concepts, teachings, and embodiments described herein are merely meant to provide an enabling description of the applications and are not intended to limit the scope of the applications. Therefore, embodiments or examples described herein are not meant to be limiting, but merely to aid in the understanding of the overall more complete disclosure of the applications. Accordingly, the scope of the applications should be determined by the appended claims and equivalents thereof, rather than by the descriptions contained herein.
[0117] The above provides a kind of storage pool space management method and electronic equipment provided by the present application in detail. The principle and implementation of the present application are described in the specific examples herein, and the above description of the embodiments is only applicable to help understand the method and its core idea of the present application. It should be pointed out that, for those skilled in the art, without departing from the principle of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A method for managing storage pool space, characterized in that, The method is applied to a clustered file system, which includes multiple nodes and a storage pool, wherein the multiple nodes share the storage pool, and the storage pool is used to store node data and metadata of the multiple nodes; the method includes: The logical space bitmap of the storage pool is obtained through the worker node, and the logical space bitmap is used to indicate the logical space address corresponding to the plurality of nodes; The target logical space address to be processed by the working node is determined by the working node based on the logical space bitmap. The working node generates a space management request based on the target logical space address; The working node sends the space management request to the management node to request the management node to manage the logical space corresponding to the target logical space address; The step of determining the target logical space address to be processed by the working node based on the logical space bitmap includes: determining the block space offset address belonging to the working node; determining the block space bitmap of the working node based on the block space offset address and the logical space bitmap; and determining the first logical space address to be processed by the working node based on the block space bitmap when the remaining node data space of the working node is less than a first preset threshold; wherein the first logical space address is used to indicate the range of storage units allocated by the management node to the working node for storing node data.
2. The method according to claim 1, characterized in that, After determining the block space bitmap of the working node based on the block space offset address and the logical space bitmap, the method further includes: If the remaining metadata space of the working node is greater than the second preset threshold, the second logical space address to be processed by the working node is determined according to the block space bitmap. The second logical space address is used to indicate the range of storage units that the management node reclaims from the worker node to store metadata.
3. The method according to claim 2, characterized in that, When the remaining metadata space of the working node is greater than a second preset threshold, after determining the second logical space address to be processed by the working node based on the block space bitmap, the method further includes: Determine whether the second logical space address contains a reserved logical space address, wherein the reserved logical space address is the logical space address of at least one block space that has been reserved in advance; If the second logical space address does not contain the reserved logical space address, a request containing the second logical space address is sent to the management node, so that the management node responds to the request and reclaims the storage unit corresponding to the second logical space address from the worker node.
4. The method according to claim 3, characterized in that, After determining whether the second logical space address contains a reserved logical space address, the method further includes: If the second logical space address contains the reserved logical space address, then the reserved logical space address is removed from the second logical space address to obtain the third logical space address; A request containing the third logical space address is sent to the management node, so that the management node responds to the request to reclaim the storage unit corresponding to the third logical space address from the worker node.
5. The method according to claim 1, characterized in that, The step of sending the space management request from the working node to the management node, requesting the management node to manage the logical space corresponding to the target logical space address, includes: The working node sends a request containing the first logical space address to the management node; The management node responds to a request containing the first logical space address and requests the logical space corresponding to the first logical space address.
6. The method according to claim 1, characterized in that, When the remaining node data space of the working node is less than a first preset threshold, after determining the first logical space address to be processed by the working node according to the block space bitmap, and before sending the space management request to the management node through the working node to request the management node to manage the logical space corresponding to the target logical space address, the method further includes: The working node updates the bitmap of the logical space and / or the bitmap copy of the block space bitmap according to the first logical space address; The working node updates the bitmap file header of the logical space bitmap and / or the block space bitmap according to the first logical space address to complete the update of the logical space bitmap.
7. The method according to claim 1, characterized in that, The step of sending the space management request from the working node to the management node, requesting the management node to manage the logical space corresponding to the target logical space address, includes: The working node sends a request containing the first logical space address to the management node; In response to a request containing the first logical space address, the management node determines at least one block space according to the first logical space address and a preset space granularity, and allocates the at least one block space to the working node.
8. The method according to claim 2, characterized in that, The step of sending the space management request from the working node to the management node, requesting the management node to manage the logical space corresponding to the target logical space address, includes: The working node determines the fourth logical space address based on the second logical space address and the preset space granularity, wherein the range of the fourth logical space address is less than or equal to the range of the second logical space address; The working node sends a request containing the fourth logical space address to the management node, so that the management node responds to the request to reclaim the block space corresponding to the fourth logical space address.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the storage pool space management method as described in any one of claims 1 to 8 when executing the computer program.
Citation Information
Patent Citations
Computing node system, data acquisition method thereof and electronic equipment
CN111414130A
Storage space distribution method and server
CN118193478A