CN114265813A - Snapshot query method, device, equipment and storage medium - Google Patents

Snapshot query method, device, equipment and storage medium Download PDF

Info

Publication number
CN114265813A
CN114265813A CN202111617519.0A CN202111617519A CN114265813A CN 114265813 A CN114265813 A CN 114265813A CN 202111617519 A CN202111617519 A CN 202111617519A CN 114265813 A CN114265813 A CN 114265813A
Authority
CN
China
Prior art keywords
snapshot
time
global
database system
snapshot query
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
CN202111617519.0A
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.)
Beijing Kingbase Information Technologies Co Ltd
Original Assignee
Beijing Kingbase Information 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 Beijing Kingbase Information Technologies Co Ltd filed Critical Beijing Kingbase Information Technologies Co Ltd
Priority to CN202111617519.0A priority Critical patent/CN114265813A/en
Publication of CN114265813A publication Critical patent/CN114265813A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a snapshot query method, a snapshot query device, equipment and a storage medium, which are applied to a target node in a database system, wherein the method comprises the following steps: acquiring a snapshot query request, wherein the snapshot query request carries snapshot time; responding to the snapshot query request, and comparing the snapshot time with the predetermined global check point time of the database system, wherein the global check point time is the minimum value of the local check point time corresponding to all nodes in the database system; and if the snapshot time is less than the global check point time, executing snapshot query operation. According to the embodiment of the disclosure, if the snapshot time is less than the global check point time, it can be considered that the data block corresponding to the target node is not changed, and the snapshot query operation is directly executed without acquiring and releasing the global lock of the database system, i.e. without global lock protection, so that the acquisition times of the global lock are reduced, and the snapshot query efficiency is improved.

Description

Snapshot query method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of snapshot technologies, and in particular, to a snapshot query method, apparatus, device, and storage medium.
Background
A snapshot is generally defined as a copy of a group of files, directories or volumes at a specific time point, and the snapshot can perform online data recovery, and can perform data recovery in time when an application failure or file damage occurs in a database system, so as to recover the data of the database system to a state at the time point when the snapshot occurs.
When nodes in the database system perform snapshot query, the state of the database system needs to be calculated, and when the state of the database system is calculated, a global lock of the database system needs to be acquired and released. However, based on the current snapshot query method, the cost required for acquiring and releasing the global lock is high, and time delay is easy to generate, so that the cost and timeliness of the snapshot query are improved.
Disclosure of Invention
In order to solve the technical problem, the present disclosure provides a snapshot query method, apparatus, device and storage medium.
In a first aspect, the present disclosure provides a snapshot query method, applied to a target node in a database system, where the method includes:
acquiring a snapshot query request, wherein the snapshot query request carries snapshot time;
responding to the snapshot query request, and comparing the snapshot time with the predetermined global check point time of the database system, wherein the global check point time is the minimum value of the local check point time corresponding to all nodes in the database system;
and if the snapshot time is less than the global check point time, executing snapshot query operation.
In some embodiments of the present disclosure, the local checkpoint time corresponding to each node in the database system is determined when a data change transaction of a corresponding data block is monitored.
In some embodiments of the present disclosure, a snapshot query operation is performed, comprising:
responding to the snapshot query operation, and determining a corresponding target data block;
and querying the snapshot data in the target data block to obtain a snapshot query result.
In some embodiments of the present disclosure, after comparing the snapshot time to a predetermined global checkpoint time of the database system, the method further comprises:
if the snapshot time is greater than or equal to the global check point time, acquiring a global lock of the database system;
based on the global lock, a snapshot query operation is performed.
In some embodiments of the present disclosure, based on the global lock, a snapshot query operation is performed, including:
responding to the snapshot query operation, and determining a corresponding target data block;
and inquiring the snapshot data in the target data block based on the global lock to obtain a snapshot inquiry result.
In some embodiments of the present disclosure, after querying snapshot data in a target data block based on a global lock and obtaining a snapshot query result, the method further includes:
the global lock is released.
In some embodiments of the present disclosure, the local checkpoint time is a local system change number and the global checkpoint is a global checkpoint system change number.
In a second aspect, the present disclosure provides a snapshot query apparatus configured at a target node in a database system, the apparatus including:
a snapshot query request obtaining module, configured to obtain a snapshot query request, where the snapshot query request carries a snapshot time;
the time comparison module is used for responding to the snapshot query request, and comparing the snapshot time with the predetermined global check point time of the database system, wherein the global check point time is the minimum value of the local check point time corresponding to all nodes in the database system;
and the snapshot query module is used for executing snapshot query operation if the snapshot time is less than the global check point time and the snapshot query equipment is a target node in the database system.
In a third aspect, an embodiment of the present disclosure further provides a snapshot query device, where the snapshot query device is a target node in a database system, and the snapshot query device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the snapshot query method provided in the first aspect.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the snapshot query method provided in the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the snapshot query method, the snapshot query device, the snapshot query equipment and the storage medium of the embodiments of the present disclosure can obtain a snapshot query request, where the snapshot query request carries snapshot time, and in response to the snapshot query request, compares the snapshot time with a predetermined global checkpoint time of a database system, and if the snapshot time is less than the global checkpoint time, executes a snapshot query operation.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a snapshot query method according to an embodiment of the present disclosure;
fig. 2 is a logic diagram of a global checkpoint time determining method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another snapshot query method provided in the embodiment of the present disclosure;
fig. 4 is a logic diagram of a snapshot query method according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a snapshot query apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a snapshot query device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
When the current snapshot query method is used for snapshot query, the following two problems exist at the stage of acquiring and releasing the global lock of the database system by the target node:
problem 1: the target node needs to communicate with other nodes in the database system in a large amount, execute a large amount of instructions and create a data structure, so that the cost for acquiring and releasing the global lock is high;
problem 2: if each node in the database system is regarded as a process, if other processes corresponding to nodes except the target node acquire the exclusive lock in the global lock and do not release the exclusive lock, the target process corresponding to the target node cannot immediately acquire the exclusive lock, and the exclusive lock cannot be acquired until other processes release the exclusive lock, so that the timeliness of acquiring the global lock is delayed.
In summary, the existing snapshot query method has high cost for acquiring and releasing the global lock and is easy to generate time delay, so that the cost and timeliness of the snapshot query are improved.
In order to solve the above problem, embodiments of the present disclosure provide a snapshot query method, an apparatus, a device, and a storage medium, which can reduce snapshot query cost and improve timeliness.
First, a snapshot query method provided by the embodiment of the present disclosure is described with reference to fig. 1 to 4.
Fig. 1 shows a flowchart of a snapshot query method provided by an embodiment of the present disclosure.
In some embodiments of the present disclosure, the snapshot query method illustrated in fig. 1 may be performed by a target node in a database system. Wherein, the target node can be any one node in the database system.
As shown in fig. 1, the snapshot query method may include the following steps.
S110, a snapshot query request is obtained, and the snapshot query request carries snapshot time.
In the embodiment of the present disclosure, when a user wants to perform a snapshot query on a database system, a snapshot query operation may be input to a peripheral device in communication with the database system, so that the peripheral device generates a snapshot query request in response to the snapshot query operation, or a target node may receive a snapshot query request sent by another node, and then the target node obtains the snapshot query request, so as to further perform the snapshot query based on the snapshot query request.
In the embodiment of the present disclosure, the snapshot query operation may be any operation for triggering the peripheral device to send the snapshot query request to the target node in the database system.
In the embodiment of the present disclosure, the snapshot query request may be any request information capable of triggering the target node to perform the query operation.
In this embodiment of the present disclosure, the snapshot time may be time information for performing snapshot query corresponding to the snapshot query request.
In the embodiments of the present disclosure, the peripheral device may be any electronic device capable of receiving a snapshot query operation.
And S120, responding to the snapshot query request, and comparing the snapshot time with the predetermined global check point time of the database system, wherein the global check point time is the minimum value of the local check point time corresponding to all nodes in the database system.
In the embodiment of the present disclosure, after the target node in the database system obtains the snapshot query request, the snapshot time may be compared with the predetermined global checkpoint time of the database system in response to the snapshot query request, so that based on different comparison results, different policies are adopted to perform the snapshot query operation.
In embodiments of the present disclosure, the global checkpoint time may be a time corresponding to the entire database system.
In an embodiment of the present disclosure, the local checkpoint time corresponding to each node in the database system is determined upon detection of a data change transaction for the corresponding data block.
In some embodiments, the database system may include a detection node for detecting data change transactions, and when a data change transaction of a data block corresponding to each node is detected by the detection node, a local checkpoint time corresponding to each checkpoint may be determined, and the local checkpoint time corresponding to each node is compared by the detection node to determine a minimum value of the local checkpoint times corresponding to all nodes.
In other embodiments, each node in the database system may be configured to detect a data change transaction of the node, determine local checkpoint time corresponding to the node, acquire local checkpoint time corresponding to other nodes, compare the local checkpoint time corresponding to the node with the local checkpoint time corresponding to other nodes, and determine a minimum value of the local checkpoint time corresponding to all the nodes.
In the embodiment of the present disclosure, optionally, the local checkpoint time may be a local system change number, and the global checkpoint may be a global checkpoint system change number.
The local system change number may be a local System Change Number (SCN), and the global checkpoint system change number may be a global system change number SCN.
The SCN may be a number assigned to a specific data block, and may be used to identify a logical time when the specific data block is changed on the node. For example, when a node changes a row in a particular data block in the node's cache at the time of storage, the node may generate an SCN and associate the SCN with the particular data block, the data block in the node's cache (e.g., volatile memory) that has changed being referred to herein as a "dirty" data block.
Where the local SCN may be the oldest SCN associated with a dirty data block on a node.
Wherein the global SCN may be the oldest checkpoint SCN in the entire database system.
It should be noted that the earlier the update time of the data block is, the smaller the value of SCN is, otherwise, the larger the value of SCN is.
Fig. 2 shows a logic diagram of a global checkpoint time determining method provided by an embodiment of the present disclosure.
As shown in fig. 2, the global checkpoint time determining method may specifically include the following steps.
And S210, determining the local check point time of each node in the database system.
Taking an example that a detection node in a database system detects a data change transaction of a data block corresponding to each node, when the detection node detects a data change transaction of a data block corresponding to each node, local checkpoint time corresponding to each checkpoint can be determined, and local checkpoint time of each node is obtained.
Optionally, the local checkpoint time of each node may be expressed as: SCN (SCN1, SCN 2).
Alternatively, the database system may include at least two nodes.
And S220, determining the global check point time according to the local check point time of each node.
In the embodiment of the disclosure, the detection node in the database system determines the local checkpoint time of each node, and the minimum local checkpoint can be selected from the local checkpoint times of each node as the global checkpoint time.
Alternatively, the global checkpoint time may be expressed as: SCN min (SCN1, SCN 2).
And S130, if the snapshot time is less than the global check point time, executing snapshot query operation.
In the embodiment of the present disclosure, if the target node determines that the snapshot time is less than the global checkpoint time, the target node may perform a snapshot query operation.
In this disclosure, optionally, S130 may specifically include the following steps:
s1301, responding to snapshot query operation, and determining a corresponding target data block;
s1302, the snapshot data in the target data block is queried, and a snapshot query result is obtained.
Specifically, after the target node obtains the snapshot query operation, the target node may determine a target data block corresponding to the target node based on the snapshot query operation, and access the target data block, that is, query snapshot data corresponding to the target data block to obtain a snapshot query result.
It should be noted that, if the snapshot time is less than the global checkpoint time, the target node may consider that the corresponding data block has not been changed, and directly execute the snapshot query operation without acquiring and releasing the global lock of the database system, that is, without global lock protection.
In the embodiment of the disclosure, a snapshot query request can be obtained, the snapshot query request carries snapshot time, and in response to the snapshot query request, the snapshot time is compared with a predetermined global checkpoint time of the database system, and if the snapshot time is less than the global checkpoint time, a snapshot query operation is performed.
In another embodiment of the present disclosure, if the snapshot time is greater than or equal to the global checkpoint time, a global lock of the database system may be acquired, and a snapshot query operation may be performed based on the global lock.
Fig. 3 is a flowchart illustrating another snapshot query method according to an embodiment of the present disclosure.
As shown in fig. 3, the snapshot query method may specifically include the following steps:
s310, a snapshot query request is obtained, and the snapshot query request carries snapshot time.
S320, responding to the snapshot query request, and comparing the snapshot time with the predetermined global check point time of the database system, wherein the global check point time is the minimum value of the local check point time corresponding to all nodes in the database system.
And S330, if the snapshot time is less than the global check point time, executing snapshot query operation.
S310 to S330 are similar to S110 to S130, and are not described herein.
And S340, if the snapshot time is greater than or equal to the global check point time, acquiring a global lock of the database system.
In the embodiment of the present disclosure, if the target node determines that the snapshot time is greater than or equal to the global checkpoint time, the target node may acquire a global lock of the database system.
In the embodiment of the present disclosure, the global lock may be a lock of the entire database instance corresponding to the database system, and may be used to perform full-library logical backup on the database system.
Optionally, the global lock may be any one of a read lock, a write lock, an exclusive lock, and the like.
And S350, executing snapshot query operation based on the global lock.
In the embodiment of the present disclosure, after the target node acquires the global lock, a snapshot query operation may be performed based on the global lock.
In this disclosure, optionally, S350 may specifically include the following steps:
s3501, responding to the snapshot query operation, and determining a corresponding target data block;
s3502, on the basis of the global lock, the snapshot data in the target data block is inquired, and a snapshot inquiry result is obtained.
Specifically, after the target node acquires the global lock, the target node may determine a target data block corresponding to the target node based on the snapshot query operation, and query snapshot data in the target data block based on the global lock, that is, after the global lock is acquired, the target data block is accessed to obtain a snapshot query result.
It should be noted that, if the snapshot time is greater than or equal to the global checkpoint time, the target node may consider that the corresponding data block is changed, and needs to acquire and release the global lock of the database system, that is, needs to protect the database system by using the global lock, and perform the snapshot query operation.
And S360, releasing the global lock.
In the embodiment of the present disclosure, after the target node acquires the global lock, the global lock may be immediately released, and after the global lock is released, other nodes in the database system may acquire the global lock, so that the other nodes protect the data block by using the global lock.
Fig. 4 illustrates a logic diagram of a snapshot query method according to an embodiment of the present disclosure. As shown in fig. 4, the snapshot query method may specifically include the following steps.
S410, a snapshot query request is obtained, and the snapshot query request carries snapshot time.
S410 is similar to S110, and is not described herein.
And S420, judging whether the snapshot time is less than the predetermined global check point time of the database system, if so, executing S430, and otherwise, executing S440.
In this embodiment of the present disclosure, before S420, the target node may determine local checkpoint times corresponding to all nodes in the database system, compare the local checkpoint time corresponding to each node with the global checkpoint time, determine a global checkpoint time point, then compare the snapshot time with the predetermined global checkpoint time of the database system, determine whether the snapshot time is less than the predetermined global checkpoint time of the database system, if yes, perform S430, otherwise, perform S440.
And S430, executing snapshot query operation.
S430 is similar to S130, and is not described herein again.
S440, acquiring a global lock of the database system, and executing snapshot query operation based on the global lock.
S440 is similar to S340 and S350, and is not described herein.
Therefore, in the embodiment of the disclosure, if the snapshot time is greater than or equal to the global checkpoint time, the global lock of the database system can be acquired, and the snapshot query operation is executed based on the global lock, so that the database system is protected by using the global lock. Therefore, different modes can be adopted for carrying out snapshot query, and the flexibility of snapshot query is improved.
The embodiment of the present disclosure further provides a snapshot query apparatus for implementing the above-mentioned snapshot query apparatus, which is described below with reference to fig. 5. In the embodiment of the present disclosure, the snapshot query apparatus may be configured in a target node in a database system.
Fig. 5 shows a schematic structural diagram of a snapshot query apparatus according to an embodiment of the present disclosure.
As shown in fig. 5, the snapshot query apparatus 500 may include: a snapshot query request acquisition module 510, a time comparison module 520, and a snapshot query module 530.
A snapshot query request obtaining module 510, configured to obtain a snapshot query request, where the snapshot query request carries a snapshot time;
a time comparison module 520, configured to compare, in response to the snapshot query request, the snapshot time with a predetermined global checkpoint time of the database system, where the global checkpoint time is a minimum value of local checkpoint times corresponding to all nodes in the database system;
a snapshot query module 530, configured to perform a snapshot query operation if the snapshot time is less than the global checkpoint time.
In the embodiment of the disclosure, a snapshot query request can be obtained, the snapshot query request carries snapshot time, and in response to the snapshot query request, the snapshot time is compared with a predetermined global checkpoint time of the database system, and if the snapshot time is less than the global checkpoint time, a snapshot query operation is performed.
In some embodiments of the present disclosure, the local checkpoint time corresponding to each node in the database system is determined when a data change transaction of a corresponding data block is monitored.
In some embodiments of the present disclosure, the snapshot query module 530 includes:
a first target data block determination unit, configured to determine, in response to a snapshot query operation, a corresponding target data block;
the first snapshot query unit may be configured to query snapshot data in the target data block to obtain a snapshot query result.
In some embodiments of the present disclosure, the apparatus may further include:
the global lock acquisition module can be used for acquiring a global lock of the database system if the snapshot time is greater than or equal to the global check point time;
and the snapshot query operation execution module can be used for executing the snapshot query operation based on the global lock.
In some embodiments of the present disclosure, the snapshot query operation execution module may include:
a second target data block determination unit, configured to determine, in response to the snapshot query operation, a corresponding target data block;
and the second snapshot query unit may be configured to query snapshot data in the target data block based on the global lock to obtain a snapshot query result.
In some embodiments of the present disclosure, the apparatus may further include:
and the global lock releasing module can be used for releasing the global lock.
In some embodiments of the present disclosure, the local checkpoint time is a local system change number and the global checkpoint is a global checkpoint system change number.
It should be noted that the snapshot query apparatus 500 shown in fig. 5 may execute each step in the method embodiments shown in fig. 1 to fig. 4, and implement each process and effect in the method embodiments shown in fig. 1 to fig. 4, which is not described herein again.
Fig. 6 shows a schematic structural diagram of a snapshot query device according to an embodiment of the present disclosure. The snapshot query device may be a target node in a database system.
As shown in fig. 6, the snapshot querying device may include a processor 601 and a memory 602 storing computer program instructions.
Specifically, the processor 601 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
Memory 602 may include a mass storage for information or instructions. By way of example, and not limitation, memory 602 may include a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, magnetic tape, or Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 602 may include removable or non-removable (or fixed) media, where appropriate. Memory 602 may be internal or external to the integrated gateway device, where appropriate. In a particular embodiment, the memory 602 is a non-volatile solid-state memory. In a particular embodiment, the Memory 602 includes Read-Only Memory (ROM). The ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (Electrically Erasable PROM, EPROM), Electrically Erasable PROM (Electrically Erasable PROM, EEPROM), Electrically Alterable ROM (Electrically Alterable ROM, EAROM), or flash memory, or a combination of two or more of these, where appropriate.
The processor 601 executes the steps of the snapshot query method provided by the embodiments of the present disclosure by reading and executing the computer program instructions stored in the memory 602.
In one example, the snapshot query device may also include a transceiver 603 and a bus 604. As shown in fig. 6, the processor 601, the memory 602, and the transceiver 603 are connected via a bus 604 and communicate with each other.
Bus 604 includes hardware, software, or both. By way of example, and not limitation, a BUS may include an Accelerated Graphics Port (AGP) or other Graphics BUS, an Enhanced Industry Standard Architecture (EISA) BUS, a Front-Side BUS (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) BUS, an InfiniBand interconnect, a Low Pin Count (LPC) BUS, a memory Bus, a Micro Channel Architecture (MCA) Bus, a Peripheral Component Interconnect (PCI) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a Video Electronics Standards Association Local Bus (VLB) Bus, or other suitable Bus, or a combination of two or more of these. Bus 604 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the application, any suitable buses or interconnects are contemplated by the application.
The following is an embodiment of a computer-readable storage medium provided in an embodiment of the present disclosure, the computer-readable storage medium and the snapshot query method in the foregoing embodiments belong to the same inventive concept, and details that are not described in detail in the embodiment of the computer-readable storage medium may refer to the embodiment of the snapshot query method.
The present embodiments provide a storage medium containing computer-executable instructions which, when executed by a computer processor, perform a snapshot query method applied to a target node in a database system, the method comprising:
acquiring a snapshot query request, wherein the snapshot query request carries snapshot time;
responding to the snapshot query request, and comparing the snapshot time with the predetermined global check point time of the database system, wherein the global check point time is the minimum value of the local check point time corresponding to all nodes in the database system;
and if the snapshot time is less than the global check point time, executing snapshot query operation.
Of course, the storage medium provided by the embodiments of the present disclosure contains computer-executable instructions, and the computer-executable instructions are not limited to the above method operations, and may also perform related operations in the snapshot query method provided by any embodiment of the present disclosure.
From the above description of the embodiments, it is obvious for a person skilled in the art that the present disclosure can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present disclosure may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk, or an optical disk of a computer, and includes several instructions to enable a computer cloud platform (which may be a personal computer, a server, or a network cloud platform, etc.) to execute the snapshot query method provided in the embodiments of the present disclosure.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will appreciate that the present disclosure is not limited to the specific embodiments illustrated herein and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the present disclosure. Therefore, although the present disclosure has been described in greater detail with reference to the above embodiments, the present disclosure is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present disclosure, the scope of which is determined by the scope of the appended claims.

Claims (10)

1. A snapshot query method, applied to a target node in a database system, the method comprising:
acquiring a snapshot query request, wherein the snapshot query request carries snapshot time;
responding to the snapshot query request, and comparing the snapshot time with a predetermined global check point time of the database system, wherein the global check point time is the minimum value of local check point times corresponding to all nodes in the database system;
and if the snapshot time is less than the global check point time, executing snapshot query operation.
2. The method of claim 1, wherein the local checkpoint time corresponding to each node in the database system is determined when a data change transaction for the corresponding data block is monitored.
3. The method of claim 1, wherein the performing a snapshot query operation comprises:
responding to the snapshot query operation, and determining a corresponding target data block;
and querying the snapshot data in the target data block to obtain a snapshot query result.
4. The method of claim 1, wherein after said comparing said snapshot time to a predetermined global checkpoint time of said database system, said method further comprises:
if the snapshot time is greater than or equal to the global check point time, acquiring a global lock of the database system;
based on the global lock, a snapshot query operation is performed.
5. The method of claim 4, wherein performing a snapshot query operation based on the global lock comprises:
responding to the snapshot query operation, and determining a corresponding target data block;
and inquiring snapshot data in the target data block based on the global lock to obtain a snapshot inquiry result.
6. The method of claim 5, wherein after the querying snapshot data in the target data block based on the global lock to obtain a snapshot query result, the method further comprises:
the global lock is released.
7. The method of claim 1, wherein the local checkpoint time is a local system change number and the global checkpoint is a global checkpoint system change number.
8. A snapshot query apparatus, configured to a target node in a database system, the apparatus comprising:
a snapshot query request obtaining module, configured to obtain a snapshot query request, where the snapshot query request carries a snapshot time;
the time comparison module is used for responding to the snapshot query request, and comparing the snapshot time with the predetermined global check point time of the database system, wherein the global check point time is the minimum value of the local check point time corresponding to all nodes in the database system;
and the snapshot query module is used for executing snapshot query operation if the snapshot time is less than the global check point time.
9. A snapshot query apparatus, wherein the snapshot query apparatus is a target node in a database system, and the apparatus comprises:
a processor;
a memory for storing executable instructions;
wherein the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the snapshot query method of any one of the above claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the storage medium stores the computer program, which, when executed by a processor, causes the processor to implement the snapshot query method of any one of the preceding claims 1-7.
CN202111617519.0A 2021-12-27 2021-12-27 Snapshot query method, device, equipment and storage medium Pending CN114265813A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111617519.0A CN114265813A (en) 2021-12-27 2021-12-27 Snapshot query method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111617519.0A CN114265813A (en) 2021-12-27 2021-12-27 Snapshot query method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114265813A true CN114265813A (en) 2022-04-01

Family

ID=80830661

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111617519.0A Pending CN114265813A (en) 2021-12-27 2021-12-27 Snapshot query method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114265813A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115774740A (en) * 2022-11-21 2023-03-10 本原数据(北京)信息技术有限公司 Database snapshot query method, system and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115774740A (en) * 2022-11-21 2023-03-10 本原数据(北京)信息技术有限公司 Database snapshot query method, system and storage medium
CN115774740B (en) * 2022-11-21 2023-09-12 本原数据(北京)信息技术有限公司 Database snapshot query method, system and storage medium

Similar Documents

Publication Publication Date Title
CN111641621B (en) Internet of things security event identification method and device and computer equipment
CN109815697B (en) Method and device for processing false alarm behavior
CN114265813A (en) Snapshot query method, device, equipment and storage medium
CN111597553A (en) Process processing method, device, equipment and storage medium in virus searching and killing
US11093361B2 (en) Bus monitoring system, method and apparatus
CN113468276A (en) Trusted data acquisition method and device of on-chain prediction machine and electronic equipment
CN111611821B (en) Two-dimensional code identification method and device, computer equipment and readable storage medium
US11422916B2 (en) Usage amount monitoring method and monitoring unit of electronic control unit for vehicle
CN111552616A (en) Memory monitoring method and device
CN111797104A (en) Method and device for acquiring data change condition and electronic equipment
CN114237981A (en) Data recovery method, device, equipment and storage medium
CN106778276B (en) Method and system for detecting malicious codes of entity-free files
CN112328515B (en) Equipment detection method and device
CN113312623B (en) Process detection method and device in access control, electronic equipment and storage medium
CN114416442A (en) Hardware change detection method and device, electronic equipment and readable storage medium
CN114371954A (en) Automatic recovery method of micro-service system
CN110716929B (en) Control and deployment processing method, device and equipment
CN111371818B (en) Data request verification method, device and equipment
CN110737411B (en) Task demand cloud processing evaluation system
CN109190366B (en) Program processing method and related device
CN112905602B (en) Data comparison method, computing device and computer storage medium
CN114817868B (en) License verification method, device, equipment and storage medium
CN111240956A (en) Memory leakage monitoring method and device, electronic equipment and computer storage medium
CN108803975B (en) Instruction processing method and device and electronic equipment
CN113836528B (en) Android application shell checking method and device

Legal Events

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