CN117851374A - Method and device for managing database system front image space - Google Patents

Method and device for managing database system front image space Download PDF

Info

Publication number
CN117851374A
CN117851374A CN202211207706.6A CN202211207706A CN117851374A CN 117851374 A CN117851374 A CN 117851374A CN 202211207706 A CN202211207706 A CN 202211207706A CN 117851374 A CN117851374 A CN 117851374A
Authority
CN
China
Prior art keywords
moment
time
data block
validity period
rollback data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211207706.6A
Other languages
Chinese (zh)
Inventor
张淑锋
任仁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202211207706.6A priority Critical patent/CN117851374A/en
Publication of CN117851374A publication Critical patent/CN117851374A/en
Pending legal-status Critical Current

Links

Abstract

The application discloses a method and a device for managing a database system front image space, comprising the following steps: acquiring the starting time of a first reading operation; the first read operation is a read operation with earliest starting time in a plurality of read operations being executed at a first moment, the front image space comprises at least one rollback data block, and each rollback data block corresponds to a first validity period at the first moment; the first validity period of a first rollback data block in the at least one rollback data block is calculated from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period; updating the first validity period based on the first duration to obtain a second validity period; the first duration is an interval between a start time of the first read operation and a first time; the pre-image space is managed based on the second validity period. By the method and the device, the front image space can be expanded or reduced in a self-adaptive mode, and therefore the utilization rate of the memory space and the disk space is improved.

Description

Method and device for managing database system front image space
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a method and an apparatus for managing a database system front image space.
Background
Relational databases (e.g., ORACLE, mySQL, postgreSQL, etc.) based on Multi-version concurrency control (Multi-Version Concurrency Control, MVCC) technology are all Multi-version implementations in a way that preserves the Before Image (BI). Before changing the data, the database keeps the original version and then modifies the original version, and the saved original version is the front image. In concurrent reading operation of the database, the node can judge whether the latest data version meets visibility according to the time point, and if the current version is too new, the node continuously rolls back or searches the front image of the current version until the reading operation is met and the visibility is achieved. The main advantages of using MVCC are: 1) The read-write is not waited, the concurrency performance is high, and 2) the data consistent with the same time point can be obtained.
The database of the current MVCC type is usually configured manually by a database manager or the system is set in the safest mode to manage the front image space, so that the technical problems of untimely recovery of the front image space, excessive occupation of disk space of the memory space, unreasonable configuration mode, execution errors and the like can be generated along with the rapid increase of the current traffic and the continuous change of the traffic load under the user demand.
Disclosure of Invention
The embodiment of the application provides a method and a device for managing a pre-image space of a database system, which can adaptively expand or reduce the pre-image space by a node based on running read operation, thereby improving the utilization rate of a memory space and a disk space and the performance of the database system.
In a first aspect, the present application provides a method for managing a database system front image space, the method comprising: acquiring the starting time of a first reading operation; the first read operation is a read operation with the earliest starting time in a plurality of read operations being executed at a first moment, the front image space comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period; updating the first validity period based on a first time length to obtain a second validity period; wherein the first duration is a time interval between a start time of the first read operation and the first time; the pre-image space is managed based on the second validity period.
From the technical effect, the method and the device collect the execution time (namely the first time length) of the read operation which is executed in the time in the executing read operation in the first monitoring period, then update the validity period of the rollback data block in the front image space based on the first time length, namely update the validity period of the rollback data block in real time based on the running condition of the system executing the read operation in each monitoring period, so that when the rollback data block which is invalid exists in the front image space, the disk space can be released in time, and the utilization rate of the disk space can be effectively improved.
In a possible embodiment, the second validity period is greater than the first validity period when the first time period is greater than or equal to the first validity period; when the first time period is less than the first validity period, the second validity period is less than the first validity period.
From the technical effect, at any monitoring time in the first monitoring period, if the first time length (the current read operation with the earliest starting time) is greater than or equal to the first validity period of the rollback data block (i.e., the validity period corresponding to the rollback data block at the time), the ending time of the first read operation is likely to be later than the failure time of the rollback data block (i.e., the time obtained by adding the second time and the first validity period), and the length of the validity period is increased (i.e., the second validity period is obtained), so that the data of the corresponding historical version can be read in the execution process of the first read operation, and the read consistency of multiple concurrent versions is ensured; similarly, if the first time length is smaller than the first validity period of the rollback data block, the first validity period can be properly reduced, so that when a subsequent writing operation exists, a certain front image space is released, the occupation of a disk is reduced, and the utilization rate of the disk is improved.
In a possible embodiment, the second validity period is a sum of the first duration and a preset duration, and the second validity period is greater than or equal to the preset duration.
In terms of technical effects, since the starting time of the validity period of the rollback data block is after the starting time of the first read operation, when the length of the second validity period is set to be the sum of the executed time length (i.e., the first time length) of the first read operation and the preset time length, the failure time of the rollback data block can be ensured to be later than the ending time of the read operation, even if a plurality of concurrent read operations can read the data (i.e., the front image) of the corresponding historical version, thereby effectively ensuring the read consistency. Furthermore, by updating the validity period of the rollback data block at each monitoring instant, the validity period is matched to the duration of the currently executing read operation: when the reading operation is executed for a long time, the length of the validity period is automatically increased; when the reading operation execution time is shorter, the length of the validity period is automatically reduced, and the capacity of the front image space can be dynamically expanded or reduced based on the validity period of the dynamic update, so that the performance of the database system is improved.
In a possible implementation manner, the first monitoring period includes a third time, the third time is the next monitoring time of the first time in the first monitoring period, a fourth time is included between the first time and the third time, and the fourth time corresponds to at least one writing operation; the managing the pre-image space based on the second validity period includes: writing pre-image data into the first rollback data block based on the at least one write operation when a failure time of the first rollback data block is earlier than the fourth time; and expanding the front image space when the failure moment of each rollback data block in the at least one rollback data block is later than the fourth moment, and writing front image data into the expanded front image space based on the at least one writing operation.
Wherein the second validity period is also from the second time instant.
From the technical effect, the validity period of the rollback data block is dynamically updated according to the execution condition of the specific read operation, when concurrent write operation exists in the database, whether the rollback data block is valid (namely, whether the write operation can cover the rollback data block) can be judged in real time, and then, the rollback data block which is invalid is directly covered is decided, or when the rollback data blocks are valid, the pre-mapping space is expanded, and the number of the rollback data blocks is increased so as to write new data. The method and the device for writing the pre-image data based on the read operation of the database determine how to write the pre-image data based on the current read operation of the database, can be well adapted to the operation condition of the database, and improve the operation performance of the database.
In a possible implementation manner, a fifth time is included between the first time and the third time, and the at least one rollback data block includes N rollback data blocks, and failure time of the N rollback data blocks is earlier than the fifth time; the managing the pre-image space based on the second validity period further includes: reducing the capacity of the front image space at the fifth moment; the capacity of the front image space reduction is equal to the capacity of the N rollback data blocks, the fifth moment is any monitoring moment of the second monitoring period between the first moment and the third moment, and N is a positive integer.
From the technical effect, the validity of the rollback data blocks in the front image space can be monitored through the validity period updated in real time, so that when invalid rollback data blocks exist in the front image space, the front image space is reduced, the disk space is timely released, and the utilization rate of the disk space and the system performance are improved.
In a second aspect, the present application provides a method for managing a pre-image space of a database system, where the database system includes M nodes, where the M nodes include a first node, and the first node is any one of the M nodes, and the method includes: the first node obtains the starting time of a first reading operation; the first node comprises a plurality of read operations which are being executed at a first moment, wherein the first read operation is the read operation with the earliest starting time in the plurality of read operations; the front image space corresponding to the first node comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period; taking the maximum value of the second validity periods and the M-1 second validity periods respectively sent by the remaining M-1 nodes to the first node as the third validity period of the at least one rollback data block; the second validity period on the first node is obtained by updating the first validity period based on the first time length, wherein the first time length is a time interval between the starting time of the first reading operation and the first time; the first node manages the pre-image space based on the third validity period.
From the technical effect, in the multi-node architecture, the second validity period on the node and the rest nodes is considered in the updating process of the validity period of the rollback data block, and the maximum value is taken as the validity period (namely the third validity period) of the rollback data block, so that the consistency of the rest nodes when reading data from the node can be considered while the validity period is dynamically adjusted based on the reading operation execution condition of the node, namely the consistency of data reading among the multi-nodes can be considered in the process of managing the pre-mapping space based on the validity period of dynamic updating.
In one possible embodiment, when the first time period is greater than or equal to the first validity period, a second validity period on the first node is greater than the first validity period; when the first time period is less than the first validity period, a second validity period on the first node is less than the first validity period.
In a possible implementation manner, the second validity period on the first node is a sum of the first duration and a preset duration, and the second validity period on the first node is greater than or equal to the preset duration.
In a possible implementation manner, the first monitoring period includes a third time, the third time is the next monitoring time of the first time in the first monitoring period, a fourth time is included between the first time and the third time, and the fourth time corresponds to at least one writing operation; the first node managing the pre-image space based on the third validity period, comprising: writing pre-image data into the first rollback data block based on the at least one write operation when a failure time of the first rollback data block is earlier than the fourth time; and expanding the front image space when the failure moment of each rollback data block in the at least one rollback data block is later than the fourth moment, and writing front image data into the expanded front image space based on the at least one writing operation.
In a possible implementation manner, a fifth time is included between the first time and the third time, and the at least one rollback data block includes N rollback data blocks, and failure time of the N rollback data blocks is earlier than the fifth time; the first node manages the pre-image space based on the third validity period, further comprising: reducing the capacity of the front image space at the fifth moment; the capacity of the front image space reduction is equal to the capacity of the N rollback data blocks, the fifth moment is any monitoring moment of a third monitoring period between the first moment and the third moment, and N is a positive integer.
It should be understood that the technical effects of the embodiments under the multi-node architecture may refer to the descriptions in the corresponding embodiments under the single node, which are not described herein.
In a third aspect, the present application provides an apparatus for managing a database system front image space, the apparatus including: an acquisition unit configured to acquire a start time of a first read operation; the first read operation is a read operation with the earliest starting time in a plurality of read operations being executed at a first moment, the front image space comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period; the processing unit is used for updating the first validity period based on the first time length to obtain a second validity period; wherein the first duration is a time interval between a start time of the first read operation and the first time; the processing unit is further configured to manage the pre-image space based on the second validity period.
In a possible embodiment, the second validity period is greater than the first validity period when the first time period is greater than or equal to the first validity period; when the first time period is less than the first validity period, the second validity period is less than the first validity period.
In a possible embodiment, the second validity period is a sum of the first duration and a preset duration, and the second validity period is greater than or equal to the preset duration.
In a possible implementation manner, the first monitoring period includes a third time, the third time is the next monitoring time of the first time in the first monitoring period, a fourth time is included between the first time and the third time, and the fourth time corresponds to at least one writing operation; in terms of the processing unit managing the pre-image space based on the second validity period, the processing unit is specifically configured to: writing pre-image data into the first rollback data block based on the at least one write operation when a failure time of the first rollback data block is earlier than the fourth time; and expanding the front image space when the failure moment of each rollback data block in the at least one rollback data block is later than the fourth moment, and writing front image data into the expanded front image space based on the at least one writing operation.
In a possible implementation manner, a fifth time is included between the first time and the third time, and the at least one rollback data block includes N rollback data blocks, and failure time of the N rollback data blocks is earlier than the fifth time; in aspects in which the processing unit manages the pre-image space based on the second validity period, the processing unit is further configured to: reducing the capacity of the front image space at the fifth moment; the capacity of the front image space reduction is equal to the capacity of the N rollback data blocks, the fifth moment is any monitoring moment of the second monitoring period between the first moment and the third moment, and N is a positive integer.
In a fourth aspect, the present application provides a computer device comprising a processor and a memory; wherein the processor is configured to obtain a start time of a first read operation; the first read operation is a read operation with the earliest starting time in a plurality of read operations being executed at a first moment, the front image space comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period; the memory is used for caching the at least one rollback data block; the processor is further configured to update the first validity period based on a first time length to obtain a second validity period, and manage the pre-image space based on the second validity period; wherein the first duration is a time interval between a start time of the first read operation and the first time.
In a fifth aspect, the present application provides a database system, where the database system includes M nodes and at least one storage server, where the M nodes include a first node, and the first node is any one of the M nodes; wherein the first node is configured to obtain a start time of a first read operation; the first node comprises a plurality of read operations which are being executed at a first moment, wherein the first read operation is the read operation with the earliest starting time in the plurality of read operations; the front image space corresponding to the first node comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period; the first node is further configured to use a second validity period on the first node and a maximum value of M-1 second validity periods that are respectively sent by remaining M-1 nodes to the first node as a third validity period of the at least one rollback data block, and manage the pre-image space based on the third validity period; the second validity period on the first node is obtained by updating the first validity period based on the first time length, wherein the first time length is a time interval between the starting time of the first reading operation and the first time; the at least one storage server is configured to store the at least one rollback data block.
In a sixth aspect, embodiments of the present application provide a chip system, where the chip system includes at least one processor, a memory, and an interface circuit, where the memory, the interface circuit, and the at least one processor are interconnected by a line, and where an instruction is stored in the at least one memory; the method of any of the first or second aspects is implemented when the instructions are executed by the processor.
In a seventh aspect, embodiments of the present application provide a computer readable storage medium storing a computer program, where the method according to any one of the first or second aspects is implemented when the computer program is executed.
In an eighth aspect, embodiments of the present application provide a computer program comprising instructions which, when executed, implement the method according to any one of the first or second aspects.
Drawings
The drawings used in the embodiments of the present application are described below.
Fig. 1 is a schematic diagram of a system architecture according to an embodiment of the present application;
FIG. 2 is a schematic diagram of another system architecture according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for managing a database system front image space according to an embodiment of the present application;
FIG. 4 is a flowchart of another method for managing database system pre-image space according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a relationship between a monitoring period and a rollback data block validity period according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a rollback data block validity period change procedure according to an embodiment of the present application;
FIG. 7 is a schematic process diagram of a method for managing a pre-image space according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a management apparatus for a database system front image space according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the accompanying drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, "/" means or is meant unless otherwise indicated, for example, a/B may represent a or B; the text "and/or" is merely an association relation describing the associated object, and indicates that three relations may exist, for example, a and/or B may indicate: the three cases where a exists alone, a and B exist together, and B exists alone, and in addition, in the description of the embodiments of the present application, "plural" means two or more than two.
The terms "first," "second," "third," and "fourth" and the like in the description and in the claims of this application and in the drawings, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The following describes the terminology involved in this application
(1) Front Image (BI): in the process of executing the read operation on the database, concurrent write operation is started, and in order to ensure that the read operation can read the data version corresponding to the start time, the data to be modified in the write operation is backed up at the moment so as to be read later by the read operation, and the backed up data is the front image. The storage space in which the front image is located is the front image space.
(2) Transaction and operation: a transaction in a database is a sequence of operations that includes a set of database operation commands. The transaction submits or cancels the operation request to the system as a whole with all commands, i.e. the group of database commands is either all executed or none executed, so the transaction is an indivisible working logic unit. At least one operation is typically involved in a transaction.
(3) Rollback data blocks: a data block containing at least one prior image. Alternatively, the rollback data block may be one page of data in the memory unit.
Referring to fig. 1, fig. 1 is a schematic diagram of a system architecture of a database system for describing a method for managing a pre-image space in the present application, which is a single-node architecture, according to an embodiment of the present application. As shown in fig. 1, the system architecture may include a node 1 and a storage device 101. Wherein,
The node 1 includes a memory cell 1 and a memory cell 2. Further, the storage unit 1 and the storage unit 2 are both internal memories (i.e., memories) that are directly accessed by a processor such as a dynamic storage device or a random access memory (Random Access Memory, RAM).
The storage unit 1 is used for storing data which needs to be read or written by the node 1 in the operation process. In the process of executing the writing operation, the storage unit 2 backs up the data blocks in the storage unit 1, generates rollback data blocks, and stores the rollback data blocks in the storage device 101; during a read operation, when a historical version of the data block needs to be read (i.e., the rollback data block), the rollback data block is read from storage device 101 and loaded into storage unit 2 for direct access by a subsequent processor.
Alternatively, the storage unit 1 and the storage unit 2 may be located on the same or different internal memories.
The storage device 101 is used for storing the rollback data block backed up by the node 1 in the execution process of the read operation, and the space occupied by the rollback data block on the storage device 101 is the front image space in the application.
The node 1 runs a monitoring thread on the software level for periodically monitoring the read operations being performed on the node 1 and the validity period of the rollback data block, so that the node 1 can perform management of the pre-image space based on the validity period of the rollback data block (the specific management procedure will be discussed in detail in the embodiments below).
Alternatively, the node 1 may be a computer device such as a server, a personal computer, or the like, and the storage device 101 may be a device dedicated to storage, for example, a server or a disk, which is not limited in this application.
Referring to fig. 2, fig. 2 is a schematic diagram of another system architecture according to an embodiment of the present application, which is used for executing a management process of a front image space under a multi-node architecture. As shown in fig. 2, the system architecture includes node 1, node 2, and storage device 101.
It should be appreciated that the system architecture presented in fig. 2 is only an example and is not limiting as to the number of nodes and the number of storage devices, i.e., the system architecture may include multiple nodes and multiple shared storage devices (only one of which is shown in fig. 2, i.e., storage device 101).
The specific architecture and operation of the node 1 and the node 2 may be referred to the corresponding description in fig. 1, and will not be repeated here.
Wherein each node is provided with a communication thread for data access between the nodes.
The following method embodiments in the present application may be applicable to databases that require a pre-reserved image to implement multi-version read-write concurrency, and a representative scenario is an On-line transaction processing (On-Line Transaction Processing, OLTP) scenario that uses a pre-reserved image to implement multi-version, and is suitable for single-node, multi-node clusters.
Referring to fig. 3, fig. 3 is a flowchart of a method for managing a database system front image space according to an embodiment of the present application. The method comprises the following steps: step S310, step S320, and step S330. Wherein,
step S310: acquiring the starting time of a first reading operation; the first read operation is a read operation with the earliest starting time in a plurality of read operations being executed at a first moment, the front image space comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period.
The time interval between any two adjacent monitoring moments in the first monitoring period may be the same or different, which is not limited in this application.
The start time of the first read operation is the system logic time when the first read operation starts to be executed.
The at least one roll-back data block is generated by at least one write operation after a first read operation start time. The start time of the at least one write operation is located after the start time of the first read operation. The version of the data to be read by the first read operation is the version corresponding to the start time of the first read operation. Therefore, when the first read operation is performed and the write operation is performed to modify the data on the node, the node backs up the data block to be modified by the write operation, generates a rollback data block, and stores the rollback data block in the storage device 101, so that the data of the corresponding version can be read by the subsequent first read operation, thereby ensuring the read consistency of the database system.
Wherein each rollback data block corresponds to a validity period of the same length at the same time, but the starting time of the validity periods of different rollback data blocks is the same or different. The starting time of the validity period of each rollback data block is the time of executing the last write operation on the rollback data block, namely the starting time of the statement corresponding to the last write operation.
Wherein the first rollback data block is any one of at least one rollback data block.
Step S320: updating the first validity period based on a first time length to obtain a second validity period; wherein the first duration is a time interval between a start time of the first read operation and the first time.
Specifically, after the first monitoring time determines the first reading operation, a first time length is calculated based on the starting time and the first time of the first reading operation, and the first time length is the interval between the starting time and the first time of the first reading operation.
Further, updating the first validity period corresponding to the rollback data block at the first time based on the first duration can be divided into two cases:
(1) The first time length is greater than or equal to the first effective period
This indicates that the execution time of the first read operation can certainly exceed the first validity period, and the first validity period is updated to the second validity period, so that the updated second validity period is greater than the first validity period.
In this case, by increasing the validity period of the rollback data block, the failure time of the rollback data block can be made later than the start time of the first read operation, thereby ensuring that the read operation included in the first read operation can always read the historical version data corresponding to the start time thereof.
(2) The first time length is smaller than the first effective period
This indicates that the first read operation may be performed for a shorter time than the first validity period, and the first validity period is then further processed as the second validity period, so that the updated second validity period is smaller than the first validity period.
At this time, the validity period of the rollback data block is reduced according to the execution condition of the read operation in the system, and the write operation can directly cover the invalid rollback data block, so that the dynamic adjustment can timely release the storage space and improve the utilization rate of the storage space.
Optionally, the second validity period is the first time period or a sum of the first time period and a preset time period, and the second validity period is greater than or equal to the preset time period.
Specifically, for any of the above two cases, the second validity period obtained after updating may be the first time period or the sum of the first time period and the preset time period.
The preset duration is a margin set based on a specific application scene, and the specific length is not limited in this application.
Referring to fig. 5, fig. 5 is a schematic diagram of a relationship between a monitoring period and a rollback data block validity period according to an embodiment of the present application. As shown in fig. 5, the horizontal axis represents the time axis, and the vertical axis represents the validity period length. The first time and the third time are two adjacent monitoring times in the first monitoring period, two solid lines parallel to a time axis in the figure represent a first reading operation and a second reading operation, and the length of the solid lines represents the duration of the reading operation. The dashed line parallel to the time axis is the validity period of the rollback data block.
It should be appreciated that FIG. 5 is merely one example provided herein, wherein the number of read operations, the expiration date update process, etc. do not constitute a limitation of the present application.
As shown in fig. 5, at a first timing, the first read operation is the read operation whose start time is earliest among the read operations being performed at that timing. The validity period of the rollback data block is a first validity period between the first time and a last monitoring time adjacent to the first time. At this time, the first validity period is updated by using the first duration, and a second validity period is obtained. The second validity period is the validity period of the rollback data block between the first time and the third time. The node manages the pre-image space between the first time and the third time based on the second validity period, and a specific management procedure will be described in the following embodiments.
Specifically, the process of updating the first validity period may be referred to the description in the foregoing embodiment, and will not be repeated here.
Step S330: the pre-image space is managed based on the second validity period.
The first monitoring period comprises a third moment, the third moment is the next monitoring moment of the first moment in the first monitoring period, a fourth moment is arranged between the first moment and the third moment, and the fourth moment corresponds to at least one writing operation.
Specifically, after the first time, the validity period of each rollback data block in the at least one rollback data block is updated from the first validity period to the second validity period. I.e. between the first time and the third time, the validity period of each roll-back data block is a second validity period, at this time, the failure time of each roll-back data block may be determined based on the second time and the second validity period of each roll-back data block, i.e. the time obtained by adding the second time and the second validity period of each roll-back data block.
The fourth time is any time between the first time and the third time, and the fourth time is not equal to the first time or the third time.
Wherein the at least one write operation corresponding to the fourth time point means that the at least one write operation is performed from the fourth time point.
Further, after determining the failure time of each rollback data block between the first time and the third time, the pre-image space may be managed based on the failure time of each rollback data block.
Taking at least one write operation corresponding to the fourth time as an example, a procedure of how to manage the pre-image space based on the failure time of the rollback data block is described in detail, and this procedure can be divided into three cases:
(1) The capacity of the front image space is unchanged
Searching for the failure time of each rollback data block in the pre-image space in turn, if the failure time of a first rollback data block in the pre-image space is earlier than a fourth time (i.e. the first rollback data block has been valid), writing the pre-image data into the first rollback data block based on the at least one writing operation, where the writing operation specifically includes: the data to be modified by the at least one write operation is written as pre-image data into the first rollback data block for backup.
(2) Expanding capacity of pre-image space
And if the failure time of each rollback data block in at least one rollback data block is later than the fourth time, expanding the front image space, and writing front image data into the expanded front image space based on the at least one writing operation. Specifically: when each roll-back data block in the current image space is valid at the fourth time, the previous image space in the storage device 101 is expanded, and the previous image data is written into the expanded previous image space.
(3) Reducing the capacity of pre-image space
And if the fifth moment is included between the first moment and the third moment, and the at least one rollback data block comprises N rollback data blocks, and the failure moment of the N rollback data blocks is earlier than the fifth moment, reducing the capacity of the front image space at the fifth moment. The capacity of the front image space reduction is equal to the capacity of N rollback data blocks, the fifth moment is any monitoring moment of the second monitoring period between the first moment and the third moment, and N is a positive integer.
Specifically, based on the effectiveness of the rollback data block monitored in the second monitoring period, if the rollback data block which fails exists in the front image space, the front image space corresponding to the rollback data block which fails is reduced, the disk storage space is timely released, and the disk space utilization rate is improved.
Wherein the second monitoring period comprises a plurality of monitoring moments, and the intervals between any two adjacent monitoring moments can be the same or different.
It should be appreciated that the second monitoring period at which the validity of the rollback data block is monitored may be the same as or different from the first monitoring period at which the read operation is being performed in the previous embodiment.
Referring to fig. 4, fig. 4 is a flowchart of another method for managing a database system front image space according to an embodiment of the present application. The method comprises the following steps: step S410, step S420, and step S430. The method shown in fig. 4 is applicable to a database system including multiple nodes, where the database system includes M nodes, where the M nodes include a first node, the first node is any one of the M nodes, and M is a positive integer greater than or equal to 2. The management process of the front image space is mainly described below by taking the first node of the M nodes as an object. Wherein,
Step S410: the first node obtains the starting time of a first reading operation; the first node comprises a plurality of read operations which are being executed at a first moment, wherein the first read operation is the read operation with the earliest starting time in the plurality of read operations; the front image space corresponding to the first node comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period.
This step may be specifically referred to in the foregoing description of the embodiment of fig. 3, and will not be repeated here.
Step S420: taking the maximum value of the second validity periods and the M-1 second validity periods respectively sent by the remaining M-1 nodes to the first node as the third validity period of the at least one rollback data block; the second validity period on the first node is updated based on the first time period, and the first time period is a time interval between a starting time of the first read operation and the first time.
Specifically, each of the M nodes may update the first validity period corresponding to the rollback data block at the first time by using the same method as that in the foregoing embodiment of fig. 3, to obtain the second validity period, and then each node sends the second validity period thereon to the remaining M-1 nodes. Taking the first node as an example, the first node receives M-1 validity periods sent by the remaining M-1 nodes, and takes the maximum value (namely the third validity period) of the M-1 second validity periods and the second validity periods on the first node as the validity periods corresponding to the rollback data blocks in the first node. The third validity period is a validity period of the at least one rollback data block between the first time and the third time.
That is, in a multi-node architecture, the process of updating the first validity period at the first time considers the second validity period on the remaining nodes, thereby ensuring that the read operations on the remaining nodes can also read the corresponding version of the pre-image data from the first node.
Step S430: the first node manages the pre-image space based on the third validity period.
In one possible embodiment, when the first time period is greater than or equal to the first validity period, a second validity period on the first node is greater than the first validity period; when the first time period is less than the first validity period, a second validity period on the first node is less than the first validity period.
In a possible implementation manner, the second validity period on the first node is a sum of the first duration and a preset duration, and the second validity period on the first node is greater than or equal to the preset duration.
In a possible implementation manner, the first monitoring period includes a third time, the third time is the next monitoring time of the first time in the first monitoring period, a fourth time is included between the first time and the third time, and the fourth time corresponds to at least one writing operation; the first node managing the pre-image space based on the third validity period, comprising: writing pre-image data into the first rollback data block based on the at least one write operation when a failure time of the first rollback data block is earlier than the fourth time; and expanding the front image space when the failure moment of each rollback data block in the at least one rollback data block is later than the fourth moment, and writing front image data into the expanded front image space based on the at least one writing operation.
In a possible implementation, the first node manages the pre-image space based on the third validity period, and further includes: and when the capacity of the front image space exceeds the preset capacity and the front image space contains invalid rollback data blocks, reducing the capacity of the front image space, wherein the reduced capacity of the front image space is equal to the capacity of the invalid rollback data blocks.
Specifically, the process of managing the pre-image space by the first node based on the third validity period may correspond to the process of managing the pre-image space based on the second validity period in the foregoing embodiment, and will not be described herein.
The management process of the rest nodes in the M nodes on the front influence space is the same as that of the first node, and is not repeated here.
Referring to fig. 6, fig. 6 is a schematic diagram of a rollback data block validity period changing procedure according to an embodiment of the present application.
As shown in fig. 6, the horizontal axis is a time axis, on which eight monitoring moments (t 1-t 8) in the first monitoring cycle of the read operation are included, and the vertical axis is the length of the validity period. Four solid lines parallel to the time axis in the figure represent four read operations (read operation 1-read operation 4), and the solid line length represents the duration of the read operation. The dashed line parallel to the time axis is the validity period of the rollback data block.
As shown in fig. 6, at time t1, the read operation 1 is being executed, and its executed time (corresponding to the first time period in the foregoing embodiment) is smaller than the corresponding validity period (preset validity period) of the current roll-back data block, so that the validity period of the roll-back data block is kept unchanged at the preset validity period. Similarly, at time t2, the validity period remains unchanged from the preset validity period. At time t3, the executed time of the read operation 3 is longer than the preset validity period (corresponding to the first validity period in the foregoing embodiment), and at this time, the preset validity period is updated based on the executed time of the read operation 3, so as to obtain a validity period 1, where the length of the validity period 1 is longer than the length of the preset validity period. At time t4, read 3 is still executing, and validity period 1 is updated based on the time at which read 3 has been executed, resulting in validity period 2. The validity period 2 is the validity period of the rollback data block between t4 and t 5. At time t5, read operation 3 is still executing, and validity period 2 is updated based on the time at which read operation 3 has been executed, resulting in validity period 3. At time t6, there is no read operation being performed, then validity period 3 is updated to a preset validity period. Similarly, at times t7 and t8, the validity period is continuously maintained to be a preset validity period.
Referring to fig. 7, fig. 7 is a process schematic diagram of a method for managing a pre-image space according to an embodiment of the present application.
As shown in fig. 7, in the database system, the read operation periodicity monitoring (corresponding to the first monitoring period in the foregoing embodiment) and the rollback data block validity periodicity monitoring (corresponding to the second monitoring period in the foregoing embodiment) are performed independently.
When long-time inquiry is found in the process of monitoring the read operation (namely, the first time length of the first read operation is greater than or equal to the first validity period), the validity period of the rollback data block is increased; when long queries are not found in the periodic monitoring of the read operation, the validity period of the rollback data block is reduced.
When a failed rollback data block is found to exist in the pre-image space in rollback data block validity monitoring, the pre-image space is reduced.
Wherein the monitoring of the read operation and the monitoring of the validity of the rollback data block may be performed by different monitoring threads.
Specifically, the specific implementation of each step in the embodiment of fig. 7 may be referred to the description in the foregoing embodiment, and will not be repeated here.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a management apparatus for a database system front image space according to an embodiment of the present application. As shown in fig. 8, the apparatus includes an acquisition unit 801 and a processing unit 802; wherein,
An acquisition unit 801 for acquiring a start time of a first read operation; the first read operation is a read operation with the earliest starting time in a plurality of read operations being executed at a first moment, the front image space comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period.
A processing unit 802, configured to update the first validity period based on a first time length, obtain a second validity period, and manage the pre-image space based on the second validity period; wherein the first duration is a time interval between a start time of the first read operation and the first time.
In a possible embodiment, the second validity period is greater than the first validity period when the first time period is greater than or equal to the first validity period; when the first time period is less than the first validity period, the second validity period is less than the first validity period.
In a possible embodiment, the second validity period is a sum of the first duration and a preset duration, and the second validity period is greater than or equal to the preset duration.
In a possible implementation manner, the first monitoring period includes a third time, the third time is the next monitoring time of the first time in the first monitoring period, a fourth time is included between the first time and the third time, and the fourth time corresponds to at least one writing operation; in terms of the processing unit managing the pre-image space based on the second validity period, the processing unit 802 is specifically configured to: writing pre-image data into the first rollback data block based on the at least one write operation when a failure time of the first rollback data block is earlier than the fourth time; and expanding the front image space when the failure moment of each rollback data block in the at least one rollback data block is later than the fourth moment, and writing front image data into the expanded front image space based on the at least one writing operation.
In a possible implementation manner, a fifth time is included between the first time and the third time, and the at least one rollback data block includes N rollback data blocks, and failure time of the N rollback data blocks is earlier than the fifth time; in aspects in which the processing unit manages the pre-image space based on the second validity period, the processing unit 802 is further configured to: reducing the capacity of the front image space at the fifth moment; the capacity of the front image space reduction is equal to the capacity of the N rollback data blocks, the fifth moment is any monitoring moment of the second monitoring period between the first moment and the third moment, and N is a positive integer.
Specifically, the specific execution process of the management device for the pre-mapping space of the database system may refer to the corresponding execution flow in the foregoing method embodiment, which is not described herein again.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 9, the computer device may be any of the nodes in the foregoing embodiments of fig. 1 or fig. 2, and may also be used as an implementation of the management apparatus for the database system front image space in fig. 8. As shown in fig. 9, the computer device includes a processor 901, a memory 902, an interface circuit 903, and a bus 904. The specific functions of the hardware structures of the computer device may be as follows:
the processor 901 is configured to obtain a start time of a first read operation; the first read operation is a read operation with the earliest starting time in a plurality of read operations being executed at a first moment, the front image space comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period.
The memory 902 is configured to cache the at least one rollback data block.
The processor 901 is further configured to update the first validity period based on a first time length to obtain a second validity period, and manage the pre-image space based on the second validity period; wherein the first duration is a time interval between a start time of the first read operation and the first time.
Specifically, the specific operation process of the above-mentioned computer device may refer to the specific flow of the method for managing the pre-image space in the foregoing method embodiment, which is not described herein again.
The embodiment of the application also provides a database system, which comprises M nodes and at least one storage server, wherein the M nodes comprise a first node, and the first node is any one of the M nodes; wherein the first node is configured to obtain a start time of a first read operation; the first node comprises a plurality of read operations which are being executed at a first moment, wherein the first read operation is the read operation with the earliest starting time in the plurality of read operations; the front image space corresponding to the first node comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period; the first node is further configured to use a second validity period on the first node and a maximum value of M-1 second validity periods that are respectively sent by remaining M-1 nodes to the first node as a third validity period of the at least one rollback data block, and manage the pre-image space based on the third validity period; the second validity period on the first node is obtained by updating the first validity period based on the first time length, wherein the first time length is a time interval between the starting time of the first reading operation and the first time; the at least one storage server is configured to store the at least one rollback data block.
Specifically, the management process of each node in the database system on the front image space may refer to the corresponding description in the foregoing method embodiment, which is not repeated herein.
The embodiment of the application provides a chip system, which comprises at least one processor, a memory and an interface circuit, wherein the memory, the interface circuit and the at least one processor are interconnected through lines, and instructions are stored in the at least one memory; when executed by the processor, the instructions implement some or all of the steps recited in any of the method embodiments described above.
The present application provides a computer storage medium storing a computer program which, when executed, causes some or all of the steps of any one of the method embodiments described above to be implemented.
The present embodiments provide a computer program comprising instructions which, when executed by a processor, cause some or all of the steps of any one of the method embodiments described above to be implemented.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments. It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, such as the above-described division of units, merely a division of logic functions, and there may be additional manners of dividing in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (20)

1. A method for managing a database system pre-image space, the method comprising:
acquiring the starting time of a first reading operation; the first read operation is a read operation with the earliest starting time in a plurality of read operations being executed at a first moment, the front image space comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period;
updating the first validity period based on a first time length to obtain a second validity period; wherein the first duration is a time interval between a start time of the first read operation and the first time;
the pre-image space is managed based on the second validity period.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
when the first time period is greater than or equal to the first validity period, the second validity period is greater than the first validity period;
When the first time period is less than the first validity period, the second validity period is less than the first validity period.
3. A method according to claim 1 or 2, characterized in that,
the second effective period is the sum of the first time period and a preset time period, and the second effective period is greater than or equal to the preset time period.
4. A method according to any one of claims 1-3, characterized in that a third moment is included in the first monitoring period, the third moment being the next monitoring moment of the first moment in the first monitoring period, a fourth moment being included between the first moment and the third moment, the fourth moment corresponding to at least one write operation; the managing the pre-image space based on the second validity period includes:
writing pre-image data into the first rollback data block based on the at least one write operation when a failure time of the first rollback data block is earlier than the fourth time;
and expanding the front image space when the failure moment of each rollback data block in the at least one rollback data block is later than the fourth moment, and writing front image data into the expanded front image space based on the at least one writing operation.
5. The method according to any of claims 1-4, wherein a fifth time is comprised between the first time and the third time, wherein N rollback data blocks are included in the at least one rollback data block, and wherein a failure time of the N rollback data blocks is earlier than the fifth time; the managing the pre-image space based on the second validity period further includes:
reducing the capacity of the front image space at the fifth moment; the capacity of the front image space reduction is equal to the capacity of the N rollback data blocks, the fifth moment is any monitoring moment of the second monitoring period between the first moment and the third moment, and N is a positive integer.
6. A method for managing a pre-image space of a database system, wherein the database system includes M nodes, the M nodes including a first node, the first node being any one of the M nodes, the method comprising:
the first node obtains the starting time of a first reading operation; the first node comprises a plurality of read operations which are being executed at a first moment, wherein the first read operation is the read operation with the earliest starting time in the plurality of read operations; the front image space corresponding to the first node comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period;
Taking the maximum value of the second validity periods and the M-1 second validity periods respectively sent by the remaining M-1 nodes to the first node as the third validity period of the at least one rollback data block; the second validity period on the first node is obtained by updating the first validity period based on the first time length, wherein the first time length is a time interval between the starting time of the first reading operation and the first time;
the first node manages the pre-image space based on the third validity period.
7. The method of claim 6, wherein the step of providing the first layer comprises,
when the first time period is greater than or equal to the first validity period, a second validity period on the first node is greater than the first validity period;
when the first time period is less than the first validity period, a second validity period on the first node is less than the first validity period.
8. The method according to claim 6 or 7, wherein,
the second validity period on the first node is the sum of the first duration and a preset duration, and the second validity period on the first node is greater than or equal to the preset duration.
9. The method according to any one of claims 6-8, wherein a third moment is included in the first monitoring period, the third moment being a next monitoring moment of the first moment in the first monitoring period, a fourth moment is included between the first moment and the third moment, the fourth moment corresponding to at least one write operation; the first node managing the pre-image space based on the third validity period, comprising:
writing pre-image data into the first rollback data block based on the at least one write operation when a failure time of the first rollback data block is earlier than the fourth time;
and expanding the front image space when the failure moment of each rollback data block in the at least one rollback data block is later than the fourth moment, and writing front image data into the expanded front image space based on the at least one writing operation.
10. The method according to any of claims 6-9, wherein a fifth time is comprised between the first time and the third time, wherein N rollback data blocks are included in the at least one rollback data block, and wherein a failure time of the N rollback data blocks is earlier than the fifth time; the first node manages the pre-image space based on the third validity period, further comprising:
Reducing the capacity of the front image space at the fifth moment; the capacity of the front image space reduction is equal to the capacity of the N rollback data blocks, the fifth moment is any monitoring moment of a third monitoring period between the first moment and the third moment, and N is a positive integer.
11. An apparatus for managing a pre-system image space of a database system, the apparatus comprising:
an acquisition unit configured to acquire a start time of a first read operation; the first read operation is a read operation with the earliest starting time in a plurality of read operations being executed at a first moment, the front image space comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period;
the processing unit is used for updating the first validity period based on the first time length to obtain a second validity period; wherein the first duration is a time interval between a start time of the first read operation and the first time;
The processing unit is further configured to manage the pre-image space based on the second validity period.
12. The method of claim 11, wherein the step of determining the position of the probe is performed,
when the first time period is greater than or equal to the first validity period, the second validity period is greater than the first validity period;
when the first time period is less than the first validity period, the second validity period is less than the first validity period.
13. The method according to claim 11 or 12, wherein,
the second effective period is the sum of the first time period and a preset time period, and the second effective period is greater than or equal to the preset time period.
14. The method according to any one of claims 11-13, wherein a third moment is included in the first monitoring period, the third moment being a next monitoring moment of the first moment in the first monitoring period, a fourth moment is included between the first moment and the third moment, the fourth moment corresponding to at least one write operation; in terms of the processing unit managing the pre-image space based on the second validity period, the processing unit is specifically configured to:
writing pre-image data into the first rollback data block based on the at least one write operation when a failure time of the first rollback data block is earlier than the fourth time;
And expanding the front image space when the failure moment of each rollback data block in the at least one rollback data block is later than the fourth moment, and writing front image data into the expanded front image space based on the at least one writing operation.
15. The method according to any of claims 11-14, wherein a fifth time is comprised between the first time and the third time, wherein N rollback data blocks are included in the at least one rollback data block, and wherein a failure time of the N rollback data blocks is earlier than the fifth time; in aspects in which the processing unit manages the pre-image space based on the second validity period, the processing unit is further configured to:
reducing the capacity of the front image space at the fifth moment; the capacity of the front image space reduction is equal to the capacity of the N rollback data blocks, the fifth moment is any monitoring moment of the second monitoring period between the first moment and the third moment, and N is a positive integer.
16. A computer device, the computer device comprising a processor and a memory; wherein,
the processor is used for acquiring the starting time of the first reading operation; the first read operation is a read operation with the earliest starting time in a plurality of read operations being executed at a first moment, the front image space comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period;
The memory is used for caching the at least one rollback data block;
the processor is further configured to update the first validity period based on a first time length to obtain a second validity period, and manage the pre-image space based on the second validity period; wherein the first duration is a time interval between a start time of the first read operation and the first time.
17. A database system, wherein the database system comprises M nodes and at least one storage server, wherein the M nodes comprise a first node, and the first node is any one of the M nodes; wherein,
the first node is used for acquiring the starting time of a first reading operation; the first node comprises a plurality of read operations which are being executed at a first moment, wherein the first read operation is the read operation with the earliest starting time in the plurality of read operations; the front image space corresponding to the first node comprises at least one rollback data block, and the at least one rollback data block corresponds to a first validity period at the first moment; the at least one rollback data block comprises a first rollback data block, the first validity period of the first rollback data block is counted from a second moment, the second moment is the time of executing the last write operation on the first rollback data block, and the first moment is any monitoring moment in a first monitoring period;
The first node is further configured to use a second validity period on the first node and a maximum value of M-1 second validity periods that are respectively sent by remaining M-1 nodes to the first node as a third validity period of the at least one rollback data block, and manage the pre-image space based on the third validity period; the second validity period on the first node is obtained by updating the first validity period based on the first time length, wherein the first time length is a time interval between the starting time of the first reading operation and the first time;
the at least one storage server is configured to store the at least one rollback data block.
18. A chip system, comprising at least one processor, a memory and an interface circuit, wherein the memory, the interface circuit and the at least one processor are interconnected by a line, and wherein the at least one memory has instructions stored therein; the method of any of claims 1-10 being implemented when said instructions are executed by said processor.
19. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed, implements the method of any of claims 1-10.
20. A computer program, characterized in that the computer program comprises instructions which, when the computer program is executed, implement the method of any one of claims 1-10.
CN202211207706.6A 2022-09-30 2022-09-30 Method and device for managing database system front image space Pending CN117851374A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211207706.6A CN117851374A (en) 2022-09-30 2022-09-30 Method and device for managing database system front image space

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211207706.6A CN117851374A (en) 2022-09-30 2022-09-30 Method and device for managing database system front image space

Publications (1)

Publication Number Publication Date
CN117851374A true CN117851374A (en) 2024-04-09

Family

ID=90546387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211207706.6A Pending CN117851374A (en) 2022-09-30 2022-09-30 Method and device for managing database system front image space

Country Status (1)

Country Link
CN (1) CN117851374A (en)

Similar Documents

Publication Publication Date Title
CN108363806B (en) Multi-version concurrency control method and device for database, server and storage medium
JP3593366B2 (en) Database management method
Levandoski et al. High performance transactions in deuteronomy
US7472230B2 (en) Preemptive write back controller
JP3763992B2 (en) Data processing apparatus and recording medium
US7266669B2 (en) File system with file management function and file management method
US11442961B2 (en) Active transaction list synchronization method and apparatus
EP2378420A1 (en) Ownership reassignment in a shared-nothing database system
US20120254120A1 (en) Logging system using persistent memory
US20050132249A1 (en) Apparatus method and system for fault tolerant virtual memory management
JP7101566B2 (en) Multiversion Concurrency Control (MVCC) in non-volatile memory
US20060224639A1 (en) Backup system, program and backup method
JP2006155623A (en) Method and apparatus for recovering database cluster
US11468011B2 (en) Database management system
CN109582686B (en) Method, device, system and application for ensuring consistency of distributed metadata management
CN110196818A (en) Data cached method, buffer memory device and storage system
EP3404537A1 (en) Processing node, computer system and transaction conflict detection method
CN101339527B (en) Shadow EMS memory backup method and apparatus
CN113220490A (en) Transaction persistence method and system for asynchronous write-back persistent memory
CN111475480B (en) Log processing method and system
CN117851374A (en) Method and device for managing database system front image space
JP4286857B2 (en) Internode shared file control method
CN111611223B (en) Non-volatile data access method, system, electronic device and medium
JP3866448B2 (en) Internode shared file control method
JP4664931B2 (en) Partitioning database ownership between different database servers to control access to the database

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination