Search

CN-121979621-A - Multi-transaction identification mapping data processing method, device and computer equipment

CN121979621ACN 121979621 ACN121979621 ACN 121979621ACN-121979621-A

Abstract

The application relates to a multi-transaction identification mapping data processing method, a device and computer equipment. The method comprises the steps of responding to the trigger condition of clearing multi-transaction identification mapping data, traversing a first array and a second array to obtain a cut-off limit multi-transaction identification, checking the earliest recorded multi-transaction identification stored in an offset data file, finding out the cut-off limit offset corresponding to the cut-off limit multi-transaction identification in the multi-transaction member data file in the offset data file when the cut-off limit multi-transaction identification is larger than the earliest recorded multi-transaction identification, conducting cut-off operation on the multi-transaction member data file according to the cut-off limit offset, and conducting cut-off operation on the offset data file according to the cut-off limit multi-transaction identification so as to clear at least part of data in the multi-transaction identification mapping data. By adopting the method, the operation stability of the database system can be improved.

Inventors

  • ZHAO SHAOSHUAI

Assignees

  • 天翼云科技有限公司

Dates

Publication Date
20260505
Application Date
20251222

Claims (10)

  1. 1. A method for processing multi-transaction identification mapping data, the method comprising: Traversing a first array and a second array to obtain a truncated limit multi-transaction identifier in response to meeting a trigger condition for cleaning the multi-transaction identifier mapping data, wherein the first array is used for storing the minimum usable multi-transaction identifier corresponding to each current back-end process; Checking the earliest recorded multi-transaction identifier stored in the offset data file, and searching a truncated limit offset corresponding to the truncated limit multi-transaction identifier in the multi-transaction member data file in the offset data file under the condition that the truncated limit multi-transaction identifier is larger than the earliest recorded multi-transaction identifier; And according to the cutoff limit offset, performing cutoff operation on the multi-transaction member data file, and according to the cutoff limit multi-transaction identifier, performing cutoff operation on the offset data file so as to clear at least part of data in the multi-transaction identifier mapping data.
  2. 2. The method of claim 1, wherein traversing the first array and the second array to obtain the cutoff multi-transaction identifier comprises: Traversing each minimum usable multi-transaction identifier recorded in the first array to obtain a first multi-transaction identifier, wherein the first multi-transaction identifier is the minimum value in each minimum usable multi-transaction identifier; traversing each minimum visible multi-transaction identifier of the second group record to obtain a second multi-transaction identifier, wherein the second multi-transaction identifier is the minimum value in each minimum visible multi-transaction identifier; Comparing the size relation of the first multi-transaction identifier and the second multi-transaction identifier, and determining the cutoff multi-transaction identifier.
  3. 3. The method according to claim 1, wherein the method further comprises: responding to a transaction identifier inquiry request, judging whether transaction identifiers of all members associated with target multi-transaction identifiers are cached in a local cache of a current back-end process; updating the minimum visible multi-transaction identifier of the current back-end process in the second array as a multi-transaction identifier to be compared under the condition that the local cache does not cache the transaction identifiers of all members associated with the target multi-transaction identifier; and under the condition that the target multi-transaction identifier is larger than or equal to the multi-transaction identifier to be compared, reading transaction identifiers of all members associated with the target multi-transaction identifier through the offset data file and the multi-transaction member data file so as to respond to the transaction identifier query request.
  4. 4. The method of claim 3, wherein the reading transaction identifications of all members associated with the target multi-transaction identification via the offset data file and the multi-transaction member data file comprises: searching a target offset corresponding to the target multi-transaction identifier in the multi-transaction member data file in the offset data file; And acquiring a member number value corresponding to the target multi-transaction identifier, and reading transaction identifiers of all members associated with the target multi-transaction identifier from the multi-transaction member data file according to the target offset and the member number value, wherein the member number value represents the number of all members associated with the target multi-transaction identifier.
  5. 5. A method according to claim 3, characterized in that the method further comprises: and outputting prompt information that transaction identifications of all members associated with the target multi-transaction identification are cleaned under the condition that the target multi-transaction identification is smaller than the multi-transaction identification to be compared.
  6. 6. A method according to claim 3, characterized in that the method further comprises: and under the condition that the local cache has cached the transaction identifications of all members associated with the target multi-transaction identification, reading the transaction identifications of all members associated with the target multi-transaction identification from the local cache to respond to the transaction identification query request.
  7. 7. A multi-transaction identification mapping data processing apparatus, the apparatus comprising: The system comprises a response module, a first array and a second array, wherein the response module is used for responding to the trigger condition of cleaning the multi-transaction identifier mapping data and traversing the first array and the second array to obtain a cut-off limit multi-transaction identifier; The checking module is used for checking the earliest record multi-transaction identifier stored in the offset data file, and searching a truncated limit offset corresponding to the truncated limit multi-transaction identifier in the multi-transaction member data file in the offset data file under the condition that the truncated limit multi-transaction identifier is larger than the earliest record multi-transaction identifier; and the cleaning module is used for carrying out the cutting operation on the multi-transaction member data file according to the cutting limit offset and carrying out the cutting operation on the offset data file according to the cutting limit multi-transaction identifier so as to clean at least part of data in the multi-transaction identifier mapping data.
  8. 8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
  9. 9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
  10. 10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.

Description

Multi-transaction identification mapping data processing method, device and computer equipment Technical Field The present application relates to the field of database technologies, and in particular, to a method, an apparatus, a computer device, a computer readable storage medium, and a computer program product for processing multi-transaction identifier mapping data. Background PostgreSQL uses a multi-transaction mechanism to manage concurrent accesses of multiple transactions to the same tuple, especially when processing row-level locks. When multiple transactions need to lock the same line of data at the same time, instead of separately recording lock information for each transaction, postgreSQL combines the transactions into a multi-transaction unit and assigns a unique multi-transaction identification to the multi-transaction unit. The relation between the multi-transaction identification and the corresponding member mainly depends on the offset data file and the multi-transaction member data file to carry out storage management, and is used for efficiently storing and searching the member array with variable length. Because the two logs cannot be infinitely increased, the database system can execute the full-table scanning operation according to a pre-configured garbage collection mechanism, and the full-table scanning operation often occupies a large amount of operation resources, so that the periodic fluctuation of the database system is easy to occur, and the operation stability of the database system is seriously affected. Therefore, the conventional technology has a problem that the operation stability of the database system is not high. Disclosure of Invention In view of the foregoing, it is desirable to provide a multi-transaction identification mapping data processing method, apparatus, computer device, computer readable storage medium, and computer program product that can improve the operational stability of a database system. In a first aspect, the present application provides a method for processing multi-transaction identifier mapping data, where the method includes: Traversing a first array and a second array to obtain a truncated limit multi-transaction identifier in response to meeting a trigger condition for cleaning the multi-transaction identifier mapping data, wherein the first array is used for storing the minimum usable multi-transaction identifier corresponding to each current back-end process; Checking the earliest recorded multi-transaction identifier stored in the offset data file, and searching a truncated limit offset corresponding to the truncated limit multi-transaction identifier in the multi-transaction member data file in the offset data file under the condition that the truncated limit multi-transaction identifier is larger than the earliest recorded multi-transaction identifier; And according to the cutoff limit offset, performing cutoff operation on the multi-transaction member data file, and according to the cutoff limit multi-transaction identifier, performing cutoff operation on the offset data file so as to clear at least part of data in the multi-transaction identifier mapping data. In one embodiment, traversing the first array and the second array to obtain the truncated-limit multi-transaction identifier includes: Traversing each minimum usable multi-transaction identifier recorded in the first array to obtain a first multi-transaction identifier, wherein the first multi-transaction identifier is the minimum value in each minimum usable multi-transaction identifier; traversing each minimum visible multi-transaction identifier of the second group record to obtain a second multi-transaction identifier, wherein the second multi-transaction identifier is the minimum value in each minimum visible multi-transaction identifier; Comparing the size relation of the first multi-transaction identifier and the second multi-transaction identifier, and determining the cutoff multi-transaction identifier. In one embodiment, the method further comprises: responding to a transaction identifier inquiry request, judging whether transaction identifiers of all members associated with target multi-transaction identifiers are cached in a local cache of a current back-end process; updating the minimum visible multi-transaction identifier of the current back-end process in the second array as a multi-transaction identifier to be compared under the condition that the local cache does not cache the transaction identifiers of all members associated with the target multi-transaction identifier; and under the condition that the target multi-transaction identifier is larger than or equal to the multi-transaction identifier to be compared, reading transaction identifiers of all members associated with the target multi-transaction identifier through the offset data file and the multi-transaction member data file so as to respond to the transaction identifier query request. In one embodiment,