Method, medium and product for page space reclamation of shared storage database cluster

CN122884974APending Publication Date: 2026-10-09CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611096496.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0006]本发明一个进一步的目的是解决传统数据库集群页面回收方式无法适配共享存储架构,存在死元组回收判定不准、集群节点事务水位不互通的问题

Benefits of technology

[0018]本发明的共享存储数据库集群的页面空间回收方法,基于集群全局事务水位完成死元组有效性判定,打破了单节点事务视野局限,能够精准识别跨节点全局不可见的死元组,避免出现单节点误判导致的回收遗漏或错误回收问题,大幅提升了共享存储数据库集群的页面回收准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122884974A_ABST
    Figure CN122884974A_ABST
Patent Text Reader

Abstract

The application provides a page space recycling method, medium and product of a shared storage database cluster. The page space recycling method of the shared storage database cluster comprises the following steps: monitoring the idle degree of a data page, starting a cluster page recycling process if the idle degree of the page is insufficient; reading the dead tuple associated transaction identifier stored in a target page, collecting the whole cluster transaction water level information through cluster broadcasting; comparing the dead tuple associated transaction identifier with the cluster global minimum transaction water level in the whole cluster transaction water level information, judging whether the target page has recyclable dead tuples; if yes, performing a cluster level exclusive check on the target page, and after the exclusive check is passed, screening the globally invisible dead tuples based on the multi-version concurrency control, and recycling the storage space occupied by the globally invisible dead tuples. According to the scheme of the application, the global transaction water level is used to determine the dead tuples, the recycling accuracy is improved, multiple checks and space optimization are used to avoid conflicts, and the cluster storage and operation efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology, and in particular to a method, medium, and product for page space reclamation in a shared storage database cluster. Background Technology

[0002] In databases, open-source object-relational databases (such as PostgreSQL) use a mechanism to break down an Update operation into a Delete operation followed by an Insert operation for Update statements. This mechanism is one of the mainstream solutions for databases to handle Update statements.

[0003] Under the above mechanism, executing an Update operation can easily lead to table bloat, causing abnormal and continuous expansion of the data table storage space. This is because executing a Delete operation does not physically delete the data tuple; it only marks the target tuple as invalid. Marked tuples are dead tuples and cannot be queried by any transaction. Over a long period, the data page will be filled with a large number of marked dead tuples, resulting in table bloat caused by the accumulation of dead tuples.

[0004] For single-machine databases using the aforementioned Update strategy, mature page space reclamation solutions already exist. However, for shared storage clusters using this Delete plus Insert strategy, this page space reclamation technology is still imperfect, and table bloat occurs much faster in a cluster environment than in a single-machine database scenario. In this scenario, table bloat is difficult to effectively suppress; the continuous accumulation of a large number of dead tuples will increase the cluster storage load and accelerate storage resource consumption. At the same time, pages filled with dead tuples will cause queries to frequently trigger disk I / O, significantly reducing database query performance. Summary of the Invention

[0005] One object of the present invention is to provide a method for page space reclamation in a shared storage database cluster that can solve any of the above-mentioned problems.

[0006] A further objective of this invention is to address the problem that traditional database cluster page reclamation methods cannot adapt to shared storage architectures, resulting in inaccurate dead tuple reclamation determination and lack of communication between cluster node transaction levels.

[0007] Another further objective of this invention is to accurately screen reclaimable dead tuples by relying on global transaction level verification and cluster-level exclusive verification mechanisms, thereby effectively improving the accuracy of database cluster page space reclamation and storage resource utilization.

[0008] Specifically, this invention provides a method for page space reclamation in a shared storage database cluster, comprising: monitoring the idle level of data pages; if the idle level of pages is insufficient, initiating a cluster page reclamation process; reading the transaction identifier associated with dead tuples stored in the target page, and summarizing the transaction level information of the entire cluster through cluster broadcast; comparing the transaction identifier associated with dead tuples with the cluster's global minimum transaction level in the cluster's global transaction level information to determine whether there are reclaimable dead tuples in the target page; and if so, performing a cluster-level exclusive verification on the target page, and after the exclusive verification passes, filtering globally invisible dead tuples based on multi-version concurrency control, and reclaiming the storage space occupied by globally invisible dead tuples.

[0009] Optionally, the steps for monitoring the idle level of data pages include: monitoring the idle level of pages during the execution of query, update, and delete data read / write statements.

[0010] Optionally, the dead tuple associated transaction identifier is a cleanup prompt transaction number pre-stored in the target page, and the cleanup prompt transaction number is the smallest transaction number corresponding to all dead tuples in the target page.

[0011] Optionally, each node in the cluster independently generates an incrementing transaction number, and transaction numbers from different nodes are not comparable. Any transaction snapshot in the cluster stores the transaction level information corresponding to all nodes. The transaction level information includes the lowest transaction level, the highest transaction level, and the active status marker of transactions between the lowest and highest transaction levels of the corresponding node.

[0012] Optionally, the steps of aggregating the transaction level information of the entire cluster through cluster broadcast include: the requesting node initiating a water level query broadcast to all nodes in the cluster; each node traversing all local active snapshots, calculating the local minimum transaction level, and feeding it back to the requesting node through a remote procedure call; and the requesting node aggregating the data returned by each node to obtain the global minimum transaction level of the cluster.

[0013] Optionally, the step of determining whether there are reclaimable dead tuples on the target page includes: determining whether the cleanup prompt transaction number is less than the cluster's global minimum transaction level; and if the determination result is yes, determining that there are reclaimable dead tuples on the target page.

[0014] Optionally, the steps for performing cluster-level exclusive verification on the target page include: performing four verifications sequentially: acquiring a distributed exclusive lock on the target page, acquiring a local content exclusive lock on the target page, verifying the local reference count of the target page, and broadcasting a query to check the total page reference count of the remaining nodes; and determining that the current process has exclusive access to the target page only when all four verifications pass; if any verification fails, the current cluster page reclamation process is terminated.

[0015] Optionally, after the step of reclaiming the storage space occupied by globally invisible dead tuples, the method further includes: compacting all valid tuples in the target page toward the end of the target page, and reserving continuous free space at the beginning of the target page for subsequent data writing.

[0016] According to another aspect of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the page space reclamation method of any of the above-described shared storage database clusters.

[0017] According to another aspect of the present invention, a computer program product is also provided, comprising a computer program, characterized in that, when executed by a processor, the computer program implements the steps of the page space reclamation method of any of the above-described shared storage database clusters.

[0018] The page space reclamation method for shared storage database clusters of the present invention determines the validity of dead tuples based on the cluster's global transaction watermark, breaking the limitation of single-node transaction visibility. It can accurately identify dead tuples that are not globally visible across nodes, avoiding reclamation omissions or erroneous reclamation caused by single-node misjudgments, and significantly improving the accuracy of page reclamation in shared storage database clusters.

[0019] Furthermore, the page space reclamation method for the shared storage database cluster of the present invention ensures the atomicity and security of the page reclamation process through a cluster-level multi-dimensional exclusive verification mechanism. At the same time, it effectively reduces the accumulation of database page fragments by compacting and regularizing the storage space with page tuples, continuously optimizes the utilization rate of cluster storage resources, and significantly improves the overall read and write performance of the database and the stability of the cluster.

[0020] The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description

[0021] The following sections will describe some specific embodiments of the invention in detail by way of example and not limitation, with reference to the accompanying drawings. The same reference numerals in the drawings denote the same or similar parts or portions. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings: Figure 1 This is a schematic flowchart of a page space reclamation method for a shared storage database cluster according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a computer program product according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention; and Figure 4This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0022] Those skilled in the art should understand that the embodiments described below are merely a part of the embodiments of the present invention, and not all of the embodiments of the present invention. These partial embodiments are intended to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of the present invention.

[0023] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0024] This embodiment provides a method for page space reclamation in a shared storage database cluster. It can determine reclaimable dead tuples by comparing the global transaction water level of the cluster, eliminating the limitations of single-node transaction determination and greatly improving the accuracy and reliability of page dead tuple reclamation in a shared storage cluster. Relying on multiple cluster exclusive verification and page space compaction optimization mechanisms, it effectively avoids concurrent reclamation conflicts, reduces page storage fragmentation, and significantly improves the storage utilization and overall operating efficiency of the database cluster. Figure 1 This is a schematic flowchart of a page space reclamation method for a shared storage database cluster according to an embodiment of the present invention, as shown below. Figure 1 As shown, the page space reclamation method for a shared storage database cluster generally includes the following steps: Step S102: Monitor the idle level of data pages. If the idle level of pages is insufficient, start the cluster page reclamation process.

[0025] Step S104: Read the dead tuple associated transaction identifier stored in the target page, and summarize the transaction level information of the entire cluster through cluster broadcast.

[0026] Step S106: Compare the dead tuple associated transaction identifier with the cluster's global lowest transaction level in the full cluster transaction level information.

[0027] Step S108: Determine whether there are recyclable dead tuples on the target page, and if the determination result is yes, execute step S110.

[0028] Step S110: Perform cluster-level exclusive verification on the target page, and after the exclusive verification passes, filter globally invisible dead tuples based on multi-version concurrency control and reclaim the storage space occupied by globally invisible dead tuples.

[0029] Specifically, the step of monitoring the idle level of the data page in step S102 may include: monitoring the idle level of the page during the execution of query, update, and delete data read / write statements.

[0030] Specifically, the dead tuple associated transaction identifier in step S104 is the cleanup prompt transaction number pre-stored in the target page, and the cleanup prompt transaction number is the smallest transaction number corresponding to all dead tuples in the target page.

[0031] Furthermore, each node in the cluster independently generates an incrementing transaction number, and transaction numbers from different nodes are not comparable. Any transaction snapshot in the cluster stores the transaction level information corresponding to all nodes. The transaction level information includes the lowest transaction level, the highest transaction level, and the active status marker of transactions between the lowest and highest transaction levels of the corresponding node.

[0032] Specifically, step S104, which involves summarizing the transaction level information of the entire cluster through cluster broadcast, may include: the requesting node initiating a water level query broadcast to all nodes in the cluster; each node traversing all local active snapshots, calculating the local minimum transaction level, and feeding it back to the requesting node through a remote procedure call; and the requesting node summarizing the data returned by each node to obtain the global minimum transaction level of the cluster.

[0033] Specifically, step S108, which involves determining whether the target page contains recyclable dead tuples, may include: determining whether the cleanup prompt transaction number is less than the cluster's global minimum transaction level. Furthermore, if the determination result is yes, i.e., the cleanup prompt transaction number is less than the cluster's global minimum transaction level, it is determined that the target page contains recyclable dead tuples, and then step S110 is executed.

[0034] Specifically, step S110, which involves performing cluster-level exclusive verification on the target page, may include: performing four verifications sequentially: acquiring a distributed exclusive lock on the target page, acquiring a local content exclusive lock on the target page, verifying the local reference count of the target page, and broadcasting a query to check the total page reference count of the remaining nodes. Furthermore, the current process is determined to have exclusive access to the target page only if all four verifications pass; if any verification fails, the current cluster page reclamation process is terminated.

[0035] Furthermore, if the judgment result in step S108 is negative, that is, if there are no recyclable dead tuples on the target page, the current cluster page recycling process is terminated directly.

[0036] Specifically, after step S110, which reclaims the storage space occupied by globally invisible dead tuples, the process may further include: compressing all valid tuples in the target page toward the end of the target page, and reserving continuous free space at the beginning of the target page for subsequent data writing.

[0037] It should be noted that the page space reclamation method for the shared storage database cluster in this embodiment aims to solve the problem of difficulty in reclamation of page space in shared storage database clusters that currently use the Update strategy. It proposes an efficient technique for reclamation of database page space based on the architecture of the shared storage database cluster.

[0038] Specifically, the page space reclamation method for the shared storage database cluster in this embodiment can include the following overall technical solution: For SELECT, UPDATE, and DELETE statements, if insufficient free space is detected on the page, the page space reclamation process is proactively triggered.

[0039] Each node has a unique transaction number. Within the same node, transaction numbers are incremented, with transactions having larger transaction numbers being created later. Transaction numbers from different nodes are not comparable. A snapshot of any transaction in the cluster stores the transaction numbers of all nodes. For the current snapshot, there is a lowest transaction watermark; transactions below this watermark have been committed or rolled back. There is also a highest transaction watermark; transactions above this watermark have not been committed. Transactions between these two watermarks require careful status assessment.

[0040] The page has a pre-defined cleanup prompt transaction number, which is the smallest transaction number corresponding to all dead tuples on the page.

[0041] When a process attempts to reclaim a page, it broadcasts a minimum transaction watermark. Transactions with transaction numbers below the cluster's global minimum transaction watermark have been committed or rolled back, while transactions with transaction numbers above the highest transaction watermark have not been committed. Transactions between the high and low watermarks need to be verified for their activity. The minimum transaction watermark is obtained by the process requesting it broadcasting a request. All nodes immediately collect their own minimum transaction numbers. This collection method involves each node traversing all active snapshots in the cluster, obtaining the minimum watermark for each snapshot on its own node, comparing the minimum watermarks of all snapshots, and finally obtaining the minimum watermark for its own transaction number—the minimum of the local minimum watermarks for all snapshots. If a tuple was inserted by this node and its transaction number is below the minimum watermark collected in this wave, then the tuple inserted in that transaction has definitely been committed. After obtaining this minimum watermark, it is sent to the requesting node via a Remote Procedure Call (RPC). The requesting node obtains the cluster's minimum transaction watermark after receiving replies from each node in this manner.

[0042] After obtaining the minimum watermark for a transaction, it needs to be compared with the transaction number of the cleanup prompt on the page. If the transaction number recorded in the cleanup prompt is less than the minimum watermark, then there are reclaimable tuples on the page, and the page is ready to be reclaimed.

[0043] Page recycling should ensure that cleanup is performed only when the recycling process has exclusive access to the page, to avoid the recycling operation interfering with other business transactions.

[0044] Once it is ensured that the process reclaiming a page is exclusively occupied by that page, the process will traverse the page, find every dead tuple on that page, and use Multi-Version Concurrency Control (MVCC) snapshots to determine whether the dead tuple is visible to other transactions. If the dead tuple is not visible to any transaction, the space occupied by that tuple will be reclaimed directly.

[0045] It should be emphasized that the page space reclamation method for the shared storage database cluster in this embodiment has the following essential key technical points: The shared storage cluster will proactively clean up pages with very little free space when executing Select, Update, and Delete operations.

[0046] The data pages of the shared storage database cluster have a pre-defined cleanup warning transaction number; this value is updated every time a dead tuple is generated on the page. If the transaction that generated the dead tuple and the cleanup warning transaction number belong to the same node, and the transaction number corresponding to the dead tuple is less than the current cleanup warning transaction number, then the cleanup warning transaction number on the page is updated.

[0047] Before initiating cleanup, it is necessary to broadcast to obtain the lowest transaction water level in the cluster: the requesting node initiates a broadcast to obtain the lowest water level; the responding node blocks the list of active snapshots in the cluster, checks the active snapshots one by one, and takes out the lowest water level of its own node in the transaction snapshot. The final result of the traversal should be the transaction water level of its own node with the smallest value among all transaction snapshots.

[0048] The page cleanup process is determined based on the minimum transaction watermark and the cleanup prompt transaction number. The minimum transaction watermark is a transaction vector, and the cleanup prompt transaction number is bound to the corresponding node identifier. The minimum transaction watermark corresponding to the node is extracted from the global transaction watermark vector of the cluster for comparison. The minimum transaction watermark corresponding to the node to which the cleanup prompt transaction number belongs is extracted from the transaction watermark vector. If the cleanup prompt transaction number is less than the minimum transaction watermark of the node, the page cleanup process is executed.

[0049] Before actually starting the cleanup, it's necessary to ensure that the cleanup of the page does not affect any process on any node in the cluster. Therefore, the process cleaning up the page needs to ensure that it can exclusively occupy the page to be cleaned. The process of determining exclusive page occupation within the cluster can be divided into two steps: four checks are executed sequentially. If any check fails, the current page recycling process is terminated, and no further checks are performed: 1. Attempt to acquire an exclusive distributed lock for the page to be cleaned; if this fails, the page cannot be cleaned. 2. Attempt to acquire an exclusive content lock for the page on this node; if this fails, the page cannot be cleaned. 3. Check the reference count of the page on this node; if the reference count is not strictly equal to 1, it indicates that other processes besides the process to be cleaned have references to the page, therefore it cannot be cleaned. 4. Initiate a broadcast to check the reference counts of other nodes besides this node; if the sum of their reference counts is not 0, it indicates that other nodes in the cluster besides this node have reference counts, and the page cannot be cleaned.

[0050] After the page cleanup begins, each tuple on the page will be checked using an MVCC snapshot to determine whether the tuple is invisible to any transaction in the cluster. For tuples that are invisible to any transaction, the space occupied by the tuple will be reclaimed.

[0051] Organize the page space by compacting all valid tuples towards the end of the page, leaving the header open for future insertion of new tuples.

[0052] Furthermore, the page space reclamation method for the shared storage database cluster in this embodiment can bring the following significant technical effects: it can effectively suppress cluster table expansion, reduce query disk I / O overhead, and improve the overall operating performance of the database.

[0053] In summary, the page space reclamation method for the shared storage database cluster in this embodiment determines the validity of dead tuples based on the cluster's global transaction watermark, breaking the limitation of single-node transaction visibility. It can accurately identify dead tuples that are not globally visible across nodes, avoiding reclamation omissions or erroneous reclamation caused by single-node misjudgments, and significantly improving the accuracy of page reclamation in the shared storage database cluster.

[0054] Furthermore, the page space reclamation method for the shared storage database cluster in this embodiment ensures the atomicity and security of the page reclamation process through a cluster-level multi-dimensional exclusive verification mechanism. At the same time, it effectively reduces the accumulation of database page fragments by compacting and regularizing the storage space with page tuples, continuously optimizes the utilization rate of cluster storage resources, and significantly improves the overall read and write performance of the database and the stability of the cluster.

[0055] The flowcharts provided in the above embodiments are not intended to indicate that the operations of the method will be performed in any particular order, or that all operations of the method are included in all every case. Furthermore, the method may include additional operations. Within the scope of the technical concept provided by the methods in the above embodiments, additional variations can be made to the above methods.

[0056] This embodiment also provides a computer program product, a computer-readable storage medium, and a computer device. Figure 2 This is a schematic diagram of a computer program product 500 according to an embodiment of the present invention. Figure 3 This is a schematic diagram of a computer-readable storage medium 300 according to an embodiment of the present invention. Figure 4 This is a schematic diagram of a computer device 400 according to an embodiment of the present invention.

[0057] Computer program product 500 includes computer program 310, which, when executed by processor 410, implements the steps of the page space reclamation method for any of the above-described shared storage database clusters. Computer-readable storage medium 300 stores the aforementioned computer program 310, which, when executed by processor 410, implements the steps of the page space reclamation method for any of the above-described embodiments of the shared storage database clusters. Computer device 400 may include memory 420, processor 410, and computer program 310 stored in memory 420 and running on processor 410.

[0058] The computer program 310 used to perform the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages ​​and procedural programming languages.

[0059] Computer program 310 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 the latter case, 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).

[0060] In some embodiments, in order to perform aspects of the present invention, electronic circuits including, for example, programmable logic circuits, field-programmable gate arrays (FPGAs) or programmable logic arrays (PLAs) can execute computer-readable program instructions to personalize the electronic circuits by utilizing state information of computer-readable program instructions.

[0061] For the purposes of this embodiment, computer program product 500 is a related product containing computer program 310. For the purposes of this embodiment, computer-readable storage medium 300 is a tangible device capable of holding and storing computer program 310, and can be any device capable of containing, storing, communicating, propagating or transmitting computer program 310 for use by or in conjunction with an instruction execution system, apparatus or device.

[0062] More specific examples (a non-exhaustive list) of computer-readable storage media 300 include the following: 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 optical disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, and any suitable combination of the foregoing.

[0063] Computer device 400 may include memory 420, processor 410, and computer program 310 stored on memory 420 and running on processor 410. When processor 410 executes computer program 310, it implements the steps of the page space reclamation method of the shared storage database cluster of any of the above embodiments.

[0064] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any machine-readable storage medium for use by, or in conjunction with, instruction execution systems, apparatuses or devices (such as computer-based systems, processor-based systems or other systems that can fetch and execute instructions from, or instruction execution systems, apparatuses or devices).

[0065] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system.

[0066] Computer device 400 can be, for example, a server, desktop computer, laptop computer, tablet computer, or smartphone. In some examples, computer device 400 can be a cloud computing node. Computer device 400 can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., that perform specific tasks or implement specific abstract data types. Computer device 400 can be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can reside on local or remote computing system storage media, including storage devices.

[0067] Computer device 400 may include a processor 410 adapted to execute stored instructions and a memory 420 that provides temporary storage space for the operation of instructions during operation. The processor 410 may be a single-core processor, a multi-core processor, a computing cluster, or any other configuration. The memory 420 may include random access memory (RAM), read-only memory, flash memory, or any other suitable storage system.

[0068] The processor 410 can be connected via a system interconnect (e.g., PCI, PCI-Express, etc.) to an I / O interface (input / output interface) suitable for connecting the computer device 400 to one or more I / O devices (input / output devices). I / O devices may include, for example, a keyboard and indicating devices, where indicating devices may include a touchpad or touchscreen, etc. I / O devices may be built into the computer device 400 or may be external devices connected to the computing device.

[0069] The processor 410 may also be linked via a system interconnect to a display interface suitable for connecting the computer device 400 to a display device. The display device may include a display screen as a built-in component of the computer device 400. The display device may also include an external computer monitor, television, or projector connected to the computer device 400. Furthermore, a network interface controller (NIC) may be adapted to connect the computer device 400 to a network via a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as an Internet Minicomputer System Interface) to transmit data. The network may be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN), or the Internet, etc. Remote devices may connect to the computing device via the network.

[0070] Therefore, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Thus, the scope of the present invention should be understood and construed as covering all such other variations or modifications.

Claims

1. A method for reclaiming page space in a shared storage database cluster, comprising: Monitor the idle level of data pages; if the idle level of the pages is insufficient, initiate the cluster page reclamation process. Read the dead tuple associated transaction identifier stored in the target page, and summarize the transaction level information of the entire cluster through cluster broadcast; Compare the dead tuple associated transaction identifier with the cluster's global lowest transaction level in the cluster-wide transaction level information to determine whether the target page has any reclaimable dead tuples. as well as If so, perform cluster-level exclusive verification on the target page, and after the exclusive verification passes, filter globally invisible dead tuples based on multi-version concurrency control, and reclaim the storage space occupied by the globally invisible dead tuples.

2. The method according to claim 1, wherein the step of monitoring the idle state of the data page includes: Monitor the page's idle time during the execution of query, update, and delete data read / write statements.

3. The method according to claim 1, wherein, The dead tuple associated transaction identifier is a cleanup prompt transaction number pre-stored in the target page, and the cleanup prompt transaction number is the smallest transaction number corresponding to all the dead tuples in the target page.

4. The method according to claim 3, wherein, Each node in the cluster independently generates an incrementing transaction number. The transaction numbers of different nodes are not comparable. Any transaction snapshot of the cluster stores the transaction water level information corresponding to all nodes. The transaction level information includes the lowest transaction level, the highest transaction level, and the active status flag of transactions between the lowest and highest transaction levels for the corresponding node.

5. The method according to claim 1, wherein the step of summarizing the transaction level information of the entire cluster through cluster broadcast includes: The requesting node broadcasts a water level query to all nodes in the cluster. Each node iterates through all local active snapshots, calculates the local minimum transaction threshold, and feeds it back to the requesting node via a remote procedure call; and The requesting node aggregates the data returned by each node to obtain the global minimum transaction level of the cluster.

6. The method according to claim 3, wherein the step of determining whether the target page contains recyclable dead tuples includes: Determine whether the cleanup prompt transaction number is less than the cluster's global minimum transaction level; and If the determination result is yes, it is determined that the target page contains recyclable dead tuples.

7. The method according to claim 1, wherein the step of performing cluster-level exclusive verification on the target page includes: The four checks are executed sequentially: acquiring the distributed exclusive lock of the target page, acquiring the local content exclusive lock of the target page, verifying the local reference count of the target page, and broadcasting a query to check the total page reference count of the remaining nodes. and The current process is deemed to have exclusive access to the target page only if all four checks pass; if any check fails, the current cluster page reclamation process is terminated.

8. The method of claim 1, further comprising, after the step of reclaiming the storage space occupied by the globally invisible dead tuples: All valid tuples in the target page are compressed to the end of the target page, and continuous free space is reserved at the beginning of the target page for subsequent data writing.

9. A computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of the page space reclamation method for a shared storage database cluster according to any one of claims 1 to 8.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the page space reclamation method for a shared storage database cluster as described in any one of claims 1 to 8.