Data consistency maintenance system and data consistency maintenance method
The data integrity maintenance system optimizes resource usage by promoting local transactions to distributed transactions only when necessary, addressing the inefficiency in microservice conversions by using a processor and management tables to manage transaction types.
Patent Information
- Application Number
- JP2023082523
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-05-18
- Publication Date
- 2024-11-28
AI Technical Summary
Converting applications to microservices often leads to unnecessary consumption of computational resources due to the conversion of local transactions to distributed transactions, even when they do not require it.
A data integrity maintenance system that promotes local transactions to distributed transactions only when necessary by using a processor to detect specific operations on second resources and trigger the conversion when conditions are met, utilizing a data integrity maintenance device with a promotion trigger management table and resource manager management table to manage transaction types.
This approach reduces the wasteful consumption of computational resources by ensuring that only transactions that genuinely require distributed processing are converted, thereby optimizing resource usage.
Smart Images

Figure 2024165927000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a technique for maintaining data consistency when an application is executed. [Background technology]
[0002] In recent years, monolithic applications have been converted into microservices in order to improve scalability, etc. When converting an application into a microservice, for example, the user can set whether transaction processing is to be a local transaction or a distributed transaction.
[0003] In response to this, for example, Patent Document 1 discloses a technology that reduces the user's configuration burden in microservices by replacing processing of a first resource as a local transaction with processing of a distributed transaction when a connection to a second resource is made. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] U.S. Patent No. 7,395,264 Summary of the Invention [Problem to be solved by the invention]
[0005] For example, in the technology disclosed in Patent Document 1, a connection to a second resource is triggered by replacing the processing with a distributed transaction. Since a processing as a distributed transaction consumes various computational resources compared to a processing as a local transaction, such computational resources are consumed after the processing is replaced with a processing as a distributed transaction.
[0006] Here, even if a connection to a second resource occurs, processing as a distributed transaction is not necessarily required, and processing as a distributed transaction is not necessarily required from that point on, so there is a risk that computing resources will be wasted.
[0007] The present invention has been made in consideration of the above circumstances, and has an object to provide a technique capable of appropriately reducing consumption of calculation resources when maintaining data consistency. [Means for solving the problem]
[0008] In order to achieve the above-mentioned object, a data consistency maintenance device according to one aspect is a data consistency maintenance system capable of promoting a local transaction in an ongoing process to a distributed transaction, the data consistency maintenance system having a processor, the processor detecting that the process will either acquire a lock on a second resource other than a first resource that is already in use, or perform an update, insert, or delete operation on the second resource, and when it detects that either of these has occurred, the data consistency maintenance device promotes the local transaction in the process to a distributed transaction. Effect of the Invention
[0009] According to the present invention, it is possible to appropriately reduce consumption of calculation resources when maintaining data consistency. [Brief description of the drawings]
[0010] [Figure 1] FIG. 1 is a diagram showing the overall configuration of a computer system according to an embodiment. [Diagram 2] FIG. 2 is a detailed configuration diagram of a computer system according to an embodiment. [Diagram 3] FIG. 3 is a configuration diagram of a promotion trigger management table according to an embodiment. [Figure 4] FIG. 4 is a diagram showing the configuration of a resource manager management table according to an embodiment. [Diagram 5] FIG. 5 is a diagram showing the configuration of a connection destination management table according to an embodiment. [Figure 6] FIG. 6 is a diagram showing the configuration of a transaction identification information management table according to an embodiment. [Figure 7] FIG. 7 is a flowchart of an overall application execution process according to an embodiment. [Figure 8] FIG. 8 is a flowchart of a transaction start process and a DB access process according to an embodiment. [Figure 9] FIG. 9 is a flowchart of the promotion condition satisfaction determination process according to one embodiment. [Figure 10] FIG. 10 is a flowchart of a connection destination management table update process according to an embodiment. [Figure 11] FIG. 11 is a flowchart of a transaction identification information management table update process according to an embodiment. [Figure 12] FIG. 12 is a flowchart of a remote process according to one embodiment. [Figure 13] FIG. 13 is a flowchart of a DB access process according to an embodiment. [Figure 14] FIG. 14 is a flowchart of a transaction end process according to one embodiment. [Figure 15] FIG. 15 is a diagram showing the configuration of a promotion trigger condition registration screen according to an embodiment. [Figure 16] FIG. 16 is a diagram showing the configuration of a trace search output screen according to an embodiment. [Figure 17] FIG. 17 is a diagram illustrating an example of a trace graph according to an embodiment. [Figure 18] FIG. 18 is a diagram illustrating another example of a trace graph according to an embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] The following embodiments will be described with reference to the drawings. Note that the following embodiments do not limit the scope of the invention, and not all of the elements and combinations thereof described in the embodiments are necessarily essential to the solution of the invention.
[0012] In the following description, information may be described using the expression "AAA table", but the information may be expressed in any data structure. In other words, to show that the information does not depend on the data structure, the "AAA table" can be called "AAA information".
[0013] In the following description, the processing may be described with a "program" as the operating subject, but since the program is executed by a processor to perform a defined processing while appropriately using at least one of the storage unit and the interface unit, the subject of the processing may be the processor (or a computer or computer system having a processor). The program may be installed on the computer from a program source. The program source may be, for example, a program distribution server or a recording medium readable by a computer. In the following description, two or more programs may be realized as one program, or one program may be realized as two or more programs. At least a part of the processing realized by executing a program may be realized by a hardware circuit (for example, an ASIC (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array)).
[0014] FIG. 1 is a diagram showing the overall configuration of a computer system according to an embodiment.
[0015] The computer system 10 is an example of a data consistency maintenance system, and includes a client terminal 100, a distributed transaction management server 200, a plurality of processing servers 300, and a plurality of DB (database) servers 400. The client terminal 100, the distributed transaction management server 200, the plurality of processing servers 300, and the plurality of DB servers 400 are connected via a network 20. The network 20 is, for example, a network including a LAN (Local Area Network) or a WAN (Wide Area Network). The distributed transaction management server 200, the processing server 300, and the DB server 400 may be, for example, a physical server, a virtual server, or a container.
[0016] In the computer system 10 of this embodiment, one or more clusters 30 are configured by multiple processing servers and DB servers. The cluster 30 is divided into one or more namespaces 40 each including one or more processing servers 300 and one or more DB servers 400.
[0017] FIG. 2 is a detailed configuration diagram of a computer system according to an embodiment.
[0018] The client terminal 100 is configured by a computer such as a PC (Personal Computer). The client terminal 100 is a terminal used by a user to execute a predetermined process in a business, for example. The client terminal 100 includes a CPU (Central Processing Unit) 110 as an example of a processor, a memory 120, an external storage device 130, and a network I / F (interface) 140.
[0019] The network I / F 140 is, for example, an interface such as a wired LAN card or a wireless LAN card, and communicates with other devices (for example, the distributed transaction management server 200, the processing server 300, the DB server 400, etc.) via the network 20.
[0020] The CPU 110 executes various processes according to programs stored in the memory 120 and / or the external storage device 130 .
[0021] Memory 120 is, for example, a RAM (RANDOM ACCESS MEMORY), and stores programs executed by CPU 110 and necessary information. Memory 120 stores application client program 121. Application client program 121 communicates with and cooperates with application server program 331 (described later) to execute predetermined processing.
[0022] The external storage device 130 is, for example, a hard disk or a flash memory, and stores the programs executed by the CPU 110 and data used by the CPU 110.
[0023] The distributed transaction management server 200 is configured by a computer such as a PC or a general-purpose server. The distributed transaction management server 200 is a server that manages and controls distributed transactions. The distributed transaction management server 200 includes a CPU 210 as an example of a processor, a memory 220, an external storage device 230, and a network I / F 240.
[0024] The network I / F 240 is an interface such as a wired LAN card or a wireless LAN card, and communicates with other devices (such as the client terminal 100, the processing server 300, the DB server 400, etc.) via the network 20.
[0025] The CPU 210 executes various processes according to programs stored in the memory 220 and / or the external storage device 230 .
[0026] The memory 220 is, for example, a RAM, and stores programs executed by the CPU 210 and necessary information. The memory 220 stores a distributed transaction management program 221, a promotion trigger registration program 222, and a trace management program 223. The distributed transaction management program 221 cooperates with a distributed transaction management linkage program 433, which will be described later, to execute processing for managing distributed transactions. The promotion trigger registration program 222 executes processing for registering promotion condition information, such as a promotion condition for promoting a local transaction to a distributed transaction. The trace management program 223 collects a method history when processing is executed, and executes processing for displaying trace information of the method based on the method history.
[0027] The external storage device 230 is, for example, a hard disk or a flash memory, and stores programs executed by the CPU 210 and data used by the CPU 210. In this embodiment, the external storage device 230 stores, for example, history information of methods executed in processing.
[0028] The processing server 300 is configured by a computer such as a PC, a general-purpose server, etc. The processing server 300 includes a network I / F 310, a CPU 320 as an example of a processor, a memory 330 as an example of a storage unit, and an external storage device 340.
[0029] The network I / F 310 is, for example, an interface such as a wired LAN card or a wireless LAN card, and communicates with other devices (for example, the client terminal 100, the distributed transaction management server 200, the DB server 400, etc.) via the network 20.
[0030] The CPU 320 executes various processes according to programs stored in the memory 330 and / or the external storage device 340 .
[0031] The memory 330 is, for example, a RAM, and stores the programs executed by the CPU 320 and necessary information. The memory 330 stores an application server program 331, a DB connection client program 332, a proxy program 333, a promotion trigger management table 334, a resource manager management table 335, a transaction identification information management table 336, and a connection destination management table 337.
[0032] The application server program 331 communicates with the application client program 121 and cooperates with it to execute predetermined processing. The DB connection client program 332 executes processing for the database of the DB server 400 by communicating with a DB server program 431 (described later) of the DB server 400. The proxy program 333 acquires a method invocation by the application server program 331 and executes processing related to the processing of promoting a transaction to a distributed transaction. The details of the promotion trigger management table 334, the resource manager management table 335, the transaction identification information management table 336, and the connection destination management table 337 will be described later.
[0033] The external storage device 340 is, for example, a hard disk or a flash memory, and stores the programs executed by the CPU 320 and data used by the CPU 320.
[0034] The DB server 400 is configured by a computer such as a PC or a general-purpose server. The DB server 400 is a server that manages a database and executes processing on the database. The DB server 400 includes a network I / F 410, a CPU 420 as an example of a processor, a memory 430 as an example of a storage unit, and an external storage device 440.
[0035] The network I / F 410 is an interface such as a wired LAN card or a wireless LAN card, and communicates with other devices (such as the client terminal 100, the distributed transaction management server 200, the processing server 300, etc.) via the network 20.
[0036] The CPU 420 executes various processes according to programs stored in the memory 430 and / or the external storage device 440 .
[0037] The memory 430 is, for example, a RAM, and stores the programs executed by the CPU 420 and necessary information. The memory 430 stores a DB server program 431, a transaction management program 432, and a distributed transaction management linkage program 433. The DB server program 431 executes processing for a database in accordance with a request from the DB connection client program 332. The transaction management program 432 manages local transactions in the DB server 400. The distributed transaction management linkage program 433 cooperates with the distributed transaction management program 221 to execute processing for managing distributed transactions.
[0038] The external storage device 440 is, for example, a hard disk or a flash memory, and stores programs executed by the CPU 420 and data used by the CPU 420. In this embodiment, the external storage device 440 stores various data that constitute a database.
[0039] Next, the promotion trigger management table 334 will be described.
[0040] FIG. 3 is a configuration diagram of a promotion trigger management table according to an embodiment.
[0041] The promotion trigger management table 334 is a table for managing triggers when promoting (migrating) a local transaction to a distributed transaction. The promotion trigger management table 334 stores a record (an example of promotion condition information) for each trigger. The record of the promotion trigger management table 334 includes fields for a number (#) 334a, a promotion condition 334b, an application destination 334c, an application priority 334d, an application start date and time 334e, a registrant 334f, and a registration date and time 334g.
[0042] The number 334a stores the number of the record. The promotion condition 334b stores the condition of the trigger corresponding to the record, that is, the condition (promotion condition) for promoting a local transaction to a distributed transaction. The application destination 334c stores the scope (application scope) in the system (multiple processing servers 300 and DB server 400) that is the application destination to which the condition corresponding to the record is applied. The application destination may be, for example, the entire system, the cluster 30, the namespace 40, etc. The application priority 334d stores the priority (priority information) at which the trigger corresponding to the record is applied. When there are multiple applicable triggers, one of the triggers is selected based on this priority. The application start date and time 3334e stores the date and time at which application of the trigger corresponding to the record starts. The registrant 334f stores the registrant who registered the trigger corresponding to the record. The registration date and time 334g stores the date and time at which the trigger corresponding to the record was registered.
[0043] Here, the trigger of the second record is set as a promotion condition to a distributed transaction when a lock is acquired on a resource (another resource: second resource) that is different from the resource already used (first resource) and for which data consistency cannot be maintained in the local transaction. For example, if a promotion to a distributed transaction is made simply due to a connection to another resource, a distributed transaction will be executed even if the processing on the other resource does not need to be executed as a distributed transaction, for example, even if the processing does not need a lock. However, according to this promotion condition, promotion to a distributed transaction can be appropriately suppressed in such a case, and processing resources (CPU, memory, etc.) consumed to execute a distributed transaction can be reduced. Note that whether or not a resource is different from the resource already used in the local transaction can be grasped by referring to a connection destination resource manager identification information list 337c described later in the connection destination management table 337.
[0044] Moreover, the trigger of the third record sets the condition for promotion to a distributed transaction as follows: execution of a specific process (Update, Insert, Delete, etc.) on a resource (another resource: second resource) that is different from the resource already in use and for which data consistency cannot be maintained by a local transaction. This trigger makes it possible to appropriately suppress execution of a distributed transaction in the process content of a resource that does not require a distributed transaction, thereby reducing the processing resources consumed to execute a distributed transaction.
[0045] Next, the resource manager management table 335 will be described.
[0046] FIG. 4 is a diagram showing the configuration of a resource manager management table according to an embodiment.
[0047] The resource manager management table 335 is a table for managing resource managers in the system. The resource manager management table 335 stores records corresponding to resource managers. In this embodiment, a manager realized by a DB server program is given as an example of a resource manager, but the present invention is not limited to this, and may be another resource manager that manages a queue or the like. The records of the resource manager management table 335 include fields of a number (#) 335a, resource manager identification information 335b, local transaction management function unit connection destination 335c, distributed transaction applicability 335d, available distributed transaction manager identification information 335e, distributed transaction management function unit connection destination 335f, selection priority 335g, and selection condition 335h.
[0048] The number 335a stores the number of the record. The resource manager identification information 335b stores the identification information of the resource manager. In this embodiment, the resource manager is, for example, a database manager configured by executing the DB server program 431. The local transaction management function unit connection destination 335c stores an address (URL) for the resource manager corresponding to the record to connect to the local transaction management function unit (transaction manager) configured by executing the transaction management program 432. The distributed transaction applicability 335d stores information indicating whether the resource manager corresponding to the record is applicable to a distributed transaction. The available distributed transaction manager identification information 335e stores identification information (for example, version information of the distributed transaction management program 221) of a distributed transaction manager available to the resource manager corresponding to the record (distributed transaction management function unit configured by executing the distributed transaction management program 221). The distributed transaction management function unit connection destination 335f stores an address (URL) for the resource manager corresponding to the record to access the distributed transaction management function unit. The selection priority 335g stores the priority of which record to select when there are multiple records for the same resource manager. The selection condition 335h stores the condition (selection condition) for selecting the corresponding record. For example, the selection condition may be that all resource managers (database managers in this case) are XA (eXtended Architecture) standard compliant (publicly known specifications for database managers) and are compatible with the same transaction manager (transaction manager with the same specifications).
[0049] Next, the connection destination management table 337 will be described.
[0050] FIG. 5 is a diagram showing the configuration of a connection destination management table according to an embodiment.
[0051] The connection destination management table 337 is a table for managing connection destinations by a proxy configured by executing the proxy program 333. The connection destination management table 337 stores a record for each processing thread. A record of the connection destination management table 337 includes fields for number (#) 337a, processing request source identification information 337b, connection destination resource manager identification information list 337c, local transaction management function unit connection destination list 337d, and distributed transaction management function unit connection destination 337e.
[0052] The number (#) 337a stores the record number. The processing request source identification information 337b stores the identification information (processing thread ID) of the processing thread of the request source that requested processing. The connected resource manager identification information list 337c stores a list of the identification information of one or more connected resource managers that have been connected up to now. The local transaction management function unit connected destination list 337d stores a list of connected destination addresses (URLs) for the local transaction management function unit that manages the local transaction of the processing thread corresponding to the record. The distributed transaction management function unit connected destination 337e stores the connected destination address (URL) for the distributed transaction management function unit that manages the distributed transaction of the processing thread corresponding to the record.
[0053] Next, the transaction identification information management table 336 will be described.
[0054] FIG. 6 is a diagram showing the configuration of a transaction identification information management table according to an embodiment.
[0055] Transaction identification information management table 336 is a table for managing transactions for processing threads. Transaction identification information management table 336 stores a record for each processing thread. A record of transaction identification information management table 336 includes fields for number (#) 336a, processing request source identification information 336b, destination database / table identification information 336c, local transaction identification information 336d, and distributed transaction identification information 336e.
[0056] The number 336a stores the record number. The processing request source identification information 336b stores the identification information (processing thread ID) of the processing thread of the request source that requested processing. The destination database / table identification information 336c stores the identification information of the destination database and table. The local transaction identification information 336d stores the identification information (connection ID) of the local transaction of the processing thread corresponding to the record. The distributed transaction identification information 336e stores the identification information (transaction ID) of the distributed transaction of the processing thread corresponding to the record.
[0057] Next, the overall application execution process by the computer system 10 according to an embodiment will be described.
[0058] Fig. 7 is a flowchart of an overall application execution process according to an embodiment. The overall application execution process is not limited to the example shown in Fig. 7, and may be various processes. In the overall application execution process shown in Fig. 7, a desired process in a business is realized by an application client program 121, a plurality of application server programs 331, and a plurality of DB server programs 431. For example, the plurality of application server programs 331 may be programs in which a monolithic application program is made into a microservice.
[0059] The application client program 121 of the client terminal 100 (more precisely, the CPU 110 that executes the application client program) transmits a processing request to the application server program 331 of the processing server 300 (in this example, the application server program A1) (S11).
[0060] The application server program A1, which has accepted the processing request, issues a transaction start request to perform transaction start processing (S12).
[0061] Next, the application server program A1 issues a DB access request to the database A (for example, the DB server program 431 of the DB server 400) and causes the DB access process (S13) to be performed.
[0062] Next, the application server program A1 makes a remote processing request to the application server program 331 (in this example, the application server program B1) of the remote (different instance) processing server 300, and causes the remote processing (S14) to be performed.
[0063] The application server program B1 issues a DB access request to the database B (the DB server program 431 of the DB server 400 different from the database A) and causes the database B to perform DB access processing (S15).
[0064] When the DB access process is completed, the application server program B1 ends the remote process and returns a response to the application server program A1.
[0065] When the application server program A1 receives the response to the remote processing, it issues a transaction end request, executes a transaction end process (S16), and ends the entire application processing.
[0066] Next, the transaction start process (S12) and the DB access process (S13) will be described in detail.
[0067] FIG. 8 is a flowchart of a transaction start process and a DB access process according to an embodiment.
[0068] The application server program A1 calls the application server program A2 of the same processing server 300 by using a method (S21). Here, the application server program A2 has declared a transaction, and the transaction is to be started.
[0069] The application server program A2 makes a database access request to the DB server program 431 of the DB server 400 (S22). The database access request includes, for example, the request source processing thread ID, cluster identification information, name space identification information, container identification information, database manager identification information, processing start date and time, processing commands such as read and write, and transaction target processing information such as processing parameters. The proxy program 333 receives the database access request and executes a promotion condition satisfaction determination process (see FIG. 9) that determines whether or not to promote the local transaction to a distributed transaction (S23). In the processing example of FIG. 8, it is assumed that the promotion condition satisfaction determination process (see FIG. 9) determines that the processing should be continued as a local transaction.
[0070] Then, the proxy program 333 calls the DB connection client program 332 in accordance with the database access request (S24).
[0071] Next, the DB connection client program 332 calls the DB server program 431 (DB server program A in this example) of the target DB server 400 in accordance with the database access request (S25).
[0072] The DB server program A accesses the database in accordance with the database access request (S26), and requests the transaction management program 432 (transaction management program A in this example) of the same DB server 400 to register transaction target processing information (S27).
[0073] The transaction management program A registers the transaction target processing information in the memory 430 or the external storage device 440 (S28), and returns a response to the DB server program A (S29). The DB server program A returns a response to the DB connection client program 332 (S30), and the DB connection client program 332 returns a response to the proxy program 333 (S31).
[0074] The proxy program 333 executes a connection destination management table update process (see FIG. 10) to update the connection destination management table based on the response (S32), executes a transaction identification information management table update process (see FIG. 11) (S33), and returns a response to the application server program A2 (S34).
[0075] Next, the promotion condition satisfaction determination process (S23, S92) will be described.
[0076] FIG. 9 is a flowchart of the promotion condition satisfaction determination process according to one embodiment.
[0077] The proxy program 333 acquires transaction target processing information and data from the resource manager management table 335 (S41).
[0078] Next, the proxy program 333 judges whether the requested process (target process) is subject to transaction control (S42). Here, whether the target process is subject to transaction control can be judged by whether the requesting process has been declared a transaction. If the result shows that the target process is not subject to transaction control (S42: No), the proxy program 333 treats the target process as non-transactional and continues processing (S43).
[0079] On the other hand, if the target process is subject to transaction control (S42: Yes), the proxy program 333 judges whether the target process is a local transaction or not (S44). Here, whether the target process is a local transaction or not can be judged by whether a distributed transaction management function unit connection destination is set in the record corresponding to the processing thread ID of the requesting process in the connection destination management table 337. At this time, if a distributed transaction management unit connection destination is not set, it can be judged to be a local transaction.
[0080] If the result is that the target process is not a local transaction, in other words, it is a distributed transaction (S44: No), the proxy program 333 treats the target process as a distributed transaction and continues processing (S45).
[0081] On the other hand, if the target process is a local transaction (S44: Yes), the proxy program 333 obtains data from the promotion trigger management table 334 and extracts the record with the highest application priority from the group of records in the promotion trigger management table 334 whose application destination matches the target process (S46).
[0082] Next, the proxy program 333 determines whether or not the target process matches the promotion condition of the extracted record (S47).
[0083] If the result is that the target process does not match the promotion condition of the extracted record (S47: No), the proxy program 333 will treat the target process as a local transaction and continue processing (S48).
[0084] On the other hand, if the target process matches the promotion conditions of the extracted record (S47: Yes), the proxy program 333 obtains the start time of the target process (S49), and determines whether the start time of the target process satisfies the applicable start date and time condition (S50).
[0085] As a result, if the start time of the target process does not satisfy the applicable start date and time condition (S50: No), the proxy program 333 advances the process to step S48.
[0086] On the other hand, if the start time of the target process satisfies the applicable start date and time condition (S50: Yes), the proxy program 333 executes processing to promote the target process to a distributed transaction (S51).
[0087] Furthermore, if the target process matches the promotion condition of the extracted record (S47: Yes), the proxy program 333 thereafter refers to the resource manager management table 335 to determine whether the resource manager to be called to execute the target process can apply a distributed transaction, and if the distributed transaction cannot be applied, the proxy program 333 may not promote the transaction to a distributed transaction, or the proxy program 333 may select a distributed transaction manager of a version that is available to the resource manager and promote the transaction to a distributed transaction.
[0088] This promotion condition satisfaction determination process allows a local transaction to be appropriately promoted to a distributed transaction, and eliminates the need to consider in advance whether a distributed transaction needs to be executed and to write a method for executing the distributed transaction in the application server program 331. This can reduce the effort required, for example, when converting a monolithic application program into a microservice.
[0089] Next, the connection destination management table update process (S32, S87, S105) will be described.
[0090] FIG. 10 is a flowchart of a connection destination management table update process according to an embodiment.
[0091] The proxy program 333 determines whether or not there is a record in the connection destination management table 337 whose processing request source identification information matches the processing request source identification information of the target processing (S61).
[0092] As a result, if there is no record with matching processing requester identification information (S61: No), the proxy program 333 creates a new record in the connection destination management table 337, registers the processing requester identification information of the target processing in this record (S62), adds identification information of the resource manager connected in this processing, and thereby adds a connection destination of the local transaction management function unit or registers a connection destination of the distributed transaction management function unit (S63).
[0093] On the other hand, if a record with matching processing request source identification information exists (S61: Yes), the proxy program 333 registers in this record the identification information of the resource manager connected in this processing, and the resulting connection destination of the local transaction management function unit or the connection destination of the distributed transaction management function unit (S63).
[0094] According to this connection destination management table update process, the connection destination in the process of the processing request source can be appropriately stored in the connection destination management table 337.
[0095] Next, the transaction identification information management table update processing (S33, S88, S106) will be described.
[0096] FIG. 11 is a flowchart of a transaction identification information management table update process according to an embodiment.
[0097] The proxy program 333 judges whether or not a record exists in the transaction identification information management table 336 in which the processing request source identification information of the target processing matches the processing request source identification information (S61).
[0098] As a result, if there is no record with matching processing requester identification information (S71: No), the proxy program 333 creates a new record in the transaction identification information management table 336, registers the processing requester identification information of the target processing in this record (S72), adds identification information of the resource manager and table connected in this processing, and registers the local transaction identification information to be used in the local transaction processing or the distributed transaction identification information to be used in the distributed transaction processing (S73).
[0099] On the other hand, if a record with matching processing request source identification information exists (S71: Yes), the proxy program 333 adds to this record the identification information of the resource manager and table connected in the current processing, and registers the local transaction identification information to be used in the local transaction processing or the distributed transaction identification information to be used in the distributed transaction processing (S73).
[0100] According to this transaction identification information management table update process, the identification information of the local transaction and distributed transaction in the process of the processing request source can be appropriately stored in the transaction identification information management table 336.
[0101] Next, the remote processing (S14) will be described.
[0102] FIG. 12 is a flowchart of a remote process according to one embodiment.
[0103] The application server program A2 transmits a remote processing request (remote processing request) to the application server program 331 (in this example, the application server program B1) of another processing server 300 (S81).
[0104] The proxy program 333 acquires the remote processing request, and determines whether the requested remote processing is a local transaction and the call destination is remote (another instance) (S82).
[0105] As a result, if the requested remote processing is a local transaction and the call destination is remote (S82: Yes), this means that there is a possibility that the local transaction will be promoted to a distributed transaction, so the proxy program 333 adds information about this local transaction (transaction information), such as the local transaction ID, to the delivery information (destination delivery information) to be sent to the destination in the remote processing request (S83), and calls the remote processing by application server program B1 (S84).
[0106] As a result, if the requested remote processing is a local transaction and the call destination is not remote (S82: No), the proxy program 333 calls the remote processing by the application server program B1 (S84).
[0107] The application server program B1 requests remote database access, executes the process (S85), and returns a response to the proxy program 333 (S86).
[0108] The proxy program 333 executes a connection destination management table update process (see FIG. 10) to update the connection destination management table 337 based on the response (S87), executes a transaction identification information management table update process (see FIG. 11) (S88), and returns a response to the application server program A2 (S89).
[0109] Next, the DB access process (S15) will be described.
[0110] FIG. 13 is a flowchart of a DB access process according to an embodiment.
[0111] The application server program B1 issues a database access request to the DB server program 431 (in this example, the DB server program B) of the DB server 400 (S91).
[0112] The proxy program 333 receives the database access request and executes the promotion condition satisfaction determination process (see FIG. 9) for determining whether or not to promote the local transaction to a distributed transaction (S92).
[0113] In the processing example of FIG. 13, in the promotion condition satisfaction determination process, it is determined that the local transaction should be promoted to a distributed transaction, and a promotion processing request is sent to the distributed transaction management program 221 (S93).
[0114] The distributed transaction management program 221 executes promotion processing to promote the local transaction to a distributed transaction (S94). In the promotion processing, the distributed transaction management program 221 assigns identification information of the distributed transaction to be assigned, starts the processing to manage, and executes processing to take over the local transaction processing.
[0115] Next, when the distributed transaction management program 221 finishes the promotion process, it returns a response to the promotion process to the proxy program (S95).
[0116] Next, the proxy program 333 executes a transaction identification information management table update process (see FIG. 11) for registering the identification information of the distributed transaction in the transaction identification information management table 336 (S96).
[0117] Next, the proxy program 333 calls the DB connection client program 332 in accordance with the database access request (S97).
[0118] Next, the DB connection client program 332 calls the DB server program 431 (in this example, DB server program B) of the target DB server 400 in accordance with the database access request (S98).
[0119] The DB server program B accesses the database in accordance with the database access request (S99), and requests the distributed transaction management program 221 to register transaction target processing information (S100).
[0120] The distributed transaction management program 221 registers transaction target processing information in the memory 220 or the external storage device 230 (S101), and returns a response to the DB server program B (S102). The DB server program B returns the response to the DB connection client program 332 (S103), and the DB connection client program 332 returns the response to the proxy program 333 (S104).
[0121] The proxy program 333 executes a connection destination management table update process (see FIG. 10) to update the connection destination management table 337 based on the response (S105), executes a transaction identification information management table update process (see FIG. 11) (S106), and returns a response to the application server program B1 (S107).
[0122] Next, the transaction end process (S16) will be described.
[0123] FIG. 14 is a flowchart of a transaction end process according to one embodiment.
[0124] The application server program A2 makes a transaction end request (S110). The transaction end request includes, for example, the processing thread ID of the request source. The proxy program 333 receives the transaction end request and refers to the connection destination management table 337 and the transaction identification information management table 336 to determine the distributed transaction identification information and the connection destination of the distributed transaction management function unit (S111).
[0125] Next, the proxy program 333 transmits a transaction end request to the distributed transaction management program 221 of the distributed transaction management function section (S112).
[0126] In accordance with the transaction termination request, the distributed transaction management program 221 sends a Prepare request to one of the DB server programs 431 of the DB servers 400 used in the distributed transaction (in this example, DB server program A) to request preparation for a commit (S113).
[0127] The DB server program A executes a Prepare process to prepare to commit the database in accordance with the Prepare request (S114), and returns a response to the distributed transaction management program 221 (S115).
[0128] Next, the distributed transaction management program 221 sends a Prepare request to the DB server program 431 (DB server program B in this example) of the other DB server 400 used in the distributed transaction to request preparation for commit (S116).
[0129] The DB server program B executes a Prepare process to prepare for committing the database in accordance with the Prepare request (S117), and returns a response to the distributed transaction management program 221 (S118).
[0130] When the distributed transaction management program 221 receives responses to the Prepare request from the DB server programs 431 of all DB servers 400 used in the distributed transaction, it sends a Commit request to one of the DB server programs 431 of the DB servers 400 used in the distributed transaction (in this example, DB server program A) to request a commit (S119).
[0131] The DB server program A executes a Commit process to commit the database in accordance with the Commit request (S120), and returns a response to the distributed transaction management program 221 (S121).
[0132] Next, the distributed transaction management program 221 sends a Commit request to the DB server program 431 (DB server program B in this example) of the other DB server 400 used in the distributed transaction to request a commit (S122).
[0133] The DB server program B executes a Commit process to commit the database in accordance with the Commit request (S123), and returns a response to the distributed transaction management program 221 (S124).
[0134] The distributed transaction management program 221 returns a response corresponding to the transaction end request to the proxy program 333 (S125).
[0135] The proxy program 333 returns a response corresponding to the transaction end request to the application server program A2 (S126), and the application server program A2 returns a response to the application server program A1 (S127).
[0136] This transaction termination process allows a distributed transaction to be terminated appropriately.
[0137] Next, we will explain the promotion trigger condition registration screen 500, which is displayed on a display device such as a terminal (the distributed transaction management server 200 or an administrator terminal not shown) used by an administrator who manages the execution of applications by the promotion trigger registration program 222, and is used to register promotion trigger conditions in the promotion trigger management table 334.
[0138] FIG. 15 is a diagram showing the configuration of a promotion trigger condition registration screen according to an embodiment.
[0139] The promotion trigger condition registration screen 500 includes a registered information display area 510, an update button 520, a delete button 530, a promotion condition input area 540, an application destination input area 550, an application priority input area 560, an operation start date and time 570, a register button 580, and a cancel button 590.
[0140] The registered information display area 510 displays information about each trigger registered in the promotion trigger management table 334. In the registered information display area 510, any one of the triggers can be selected.
[0141] The update button 520 is a button for accepting a request to update the information of the trigger selected in the registered information display area 510. When the update button 520 is pressed, the promotion trigger registration program 222 updates the information of the trigger selected in the registered information display area 510 to the information input in the promotion condition input area 540, the application destination input area 550, the application priority input area 560, and the operation start date and time 570.
[0142] The Delete button 530 is a button for accepting a request to delete information about a trigger selected in the registered information display area 510 from the promotion trigger management table 334. When the Delete button 530 is pressed, the promotion trigger registration program 222 deletes the information about the selected trigger from the promotion trigger management table 334.
[0143] The promotion condition input area 540 is an area for inputting promotion conditions corresponding to a trigger. The application destination input area 550 is an area for inputting the application destination to which the trigger is applied. The application priority input area 560 is an area for inputting the priority to which the trigger is applied. The operation start date and time 570 is an area for inputting the date and time to start applying the trigger.
[0144] The register button 580 is a button for accepting a request to register a new trigger in the promotion trigger management table 334. When the register button 580 is pressed, the promotion trigger registration program 222 registers the information entered in the promotion condition input area 540, the application destination input area 550, the application priority input area 560, and the operation start date and time 570 in the promotion trigger management table 334 as a new trigger.
[0145] The cancel button 590 is a button for accepting cancellation of the registration of the trigger condition on the promotion trigger condition registration screen 500. When the cancel button 590 is pressed, the promotion trigger registration program 222 closes the promotion trigger condition registration screen 500.
[0146] According to the promotion trigger condition registration screen 500, the triggers registered in the promotion trigger management table 334 can be confirmed, updated, and new triggers can be registered.
[0147] Next, we will explain the trace output screen 600, which is displayed by the trace management program 223 on a display device such as a terminal (the distributed transaction management server 200 or an administrator terminal not shown) used by an administrator who manages the execution of an application, and which outputs a trace graph for a processing method.
[0148] FIG. 16 is a diagram showing the configuration of a trace search output screen according to an embodiment.
[0149] The trace output screen 600 includes a search condition input area 610 , a search button 620 , a search result output area 630 , a trace output button 640 , and a trace graph display area 650 .
[0150] The search condition input area 610 is an area for inputting search conditions for searching for a process to be outputted as a trace. Examples of search conditions include a cluster, namespace, or container in which the process was performed, and a start date and time and an end date and time of a range to be searched. The search button 620 is a button for searching for a process to be searched for based on the search conditions inputted in the search condition input area 610. When the search button 620 is pressed, the trace management program 223 searches for a process that matches the search conditions. The search result output area 630 is an area for displaying information on the search results. The trace output button 640 is a button for receiving a trace graph for a method in a process selected from among the processes in the search results in the search result output area 630. When the trace output button 640 is pressed, the trace management program 223 creates a trace graph for a method in a process selected from among the processes in the search results in the search result output area 630, and outputs the trace graph to the trace graph display area 650.
[0151] Next, the trace graph displayed in the trace graph display area 650 will be described.
[0152] Fig. 17 is a diagram showing an example of a trace graph according to an embodiment. A trace graph 800 in Fig. 17 is a trace graph in the case where the trigger of the second record in the promotion trigger management table 334 shown in Fig. 3 is applied.
[0153] In the trace graph 700, when an application server program (MS-2) called from an application server program (MS-1) issues a lock request (lock) to the DB server 2, the proxy program 333 receives the lock request (S710) before the lock request is sent to the DB server 2 (S730). Here, the lock request to the DB server 2 satisfies the promotion condition of the second record in the promotion trigger management table 334, so the proxy program 333 sends a promotion request (method (distributed transaction management), i.e., a promotion method request) to promote the local transaction to a distributed transaction to the distributed transaction management program 221 (S720). The distributed transaction management program 221 executes the promotion process and returns a response to the proxy program 333. Thereafter, the proxy program 333 sends a lock request to the DB server 2 (DB server program 431) (S730).
[0154] According to this trace graph 700, it can be confirmed that the application server program (MS-2) issued a lock request to DB server 2, satisfying the promotion condition of the second record in the promotion trigger management table 334, and the promotion process to a distributed transaction was performed appropriately.
[0155] Fig. 18 is a diagram showing another example of a trace graph according to an embodiment. A trace graph 800 in Fig. 18 is a trace graph in the case where the trigger of the first record in the promotion trigger management table 334 shown in Fig. 3 is applied.
[0156] In the trace graph 800, when an application server program (MS-2) called from an application server program (MS-1) issues a connection request (connection) to DB server 2, the proxy program 333 receives the connection request (S810) before the connection request is sent to DB server 2 (S830). Here, the connection request to DB server 2 satisfies the promotion condition of the first record in the promotion trigger management table 334, so the proxy program 333 sends a promotion request to the distributed transaction management program 221 to promote the local transaction to a distributed transaction (S820). The distributed transaction management program 221 executes the promotion process and returns a response to the proxy program 333. Thereafter, the proxy program 333 sends the connection request to DB server 2 (DB server program) (S830).
[0157] According to this trace graph 800, it can be confirmed that the application server program (MS-2) issued a connection request to DB server 2, and the promotion condition of the first record in the promotion trigger management table 334 was met, thereby properly promoting the transaction to a distributed transaction.
[0158] The present invention is not limited to the above-described embodiment, and can be modified as appropriate without departing from the spirit of the present invention.
[0159] For example, in the above embodiment, multiple triggers are stored in the promotion trigger management table 334, and an applicable trigger is extracted from the multiple triggers to determine whether or not it matches the promotion conditions. However, the present invention is not limited to this. For example, without providing the promotion trigger management table 334, it may be possible to determine whether or not to promote to a distributed transaction based on whether or not the promotion condition of the trigger corresponding to the second or third record in the promotion trigger management table 334 is met.
[0160] In addition, in the above embodiment, the trace management program 223 is stored in the distributed transaction management server 200 and executed by the distributed transaction management server 200, but the trace management program 223 may also be executed by the processing server 300, DB server 400, etc. [Explanation of symbols]
[0161] 10... computer system, 100... client terminal, 200... distributed transaction management server, 300... processing server, 400... DB server, 110, 210, 320, 420... CPU, 120, 220, 330, 430... memory, 130, 230, 340, 440... external storage device, 140, 240, 310, 410... network I / F
Claims
1. A data consistency maintenance system capable of promoting a local transaction in an ongoing process to a distributed transaction, comprising: A processor is included. The processor, Detecting that the process involves either acquiring a lock on a second resource that is different from a first resource already in use, or performing an update, insert, or delete operation on the second resource; If it detects that either of the following occurs, it promotes the local transaction in the process to a distributed transaction. Data integrity maintenance system.
2. The processor, Recording the transition of the method executed in the process; Displaying the method transitions in the process; The methods include a promote method for promoting the local transaction to a distributed transaction.
2. The data consistency maintenance system according to claim 1.
3. The processor, When calling another program in the execution of the process, if the process is a local transaction and the other program is remote, sending information related to the local transaction to the other program; Promoting the local transaction to a distributed transaction using information related to the local transaction.
2. The data consistency maintenance system according to claim 1.
4. A data consistency maintenance system capable of promoting a local transaction in a process to a distributed transaction, comprising: A processor and a storage unit are included. the storage unit stores promotion condition information including a plurality of promotion conditions for promoting a local transaction to a distributed transaction; The processor, determining one promotion condition to be used from the promotion condition information; Detecting whether the process satisfies the determined promotion condition; If the operation satisfies the promotion condition, the local transaction is promoted to a distributed transaction. Data integrity maintenance system.
5. The promotion condition is a process for a second resource different from a first resource that is already being used.
5. The data consistency maintenance system according to claim 4.
6. the promotion condition information includes a promotion condition and an application range to which the promotion condition is applied; The processor, The promotion condition to be used is determined to be the promotion condition having the scope of application that includes the configuration related to the execution of the process.
5. The data consistency maintenance system according to claim 4.
7. the promotion condition information includes a promotion condition and a start date and time when application of the promotion condition starts; The processor, A promotion condition having a start date and time earlier than the current date and time among the plurality of promotion conditions is determined as the promotion condition to be used.
5. The data consistency maintenance system according to claim 4.
8. The promotion condition information further includes priority information about the promotion conditions, The processor, When there are multiple applicable promotion conditions, the promotion condition to be used is determined based on the priority information.
5. The data consistency maintenance system according to claim 4.
9. The processor, Recording the transition of the method executed in the process; Displaying the method transitions in the process; The methods include a promote method for promoting the local transaction to a distributed transaction.
5. The data consistency maintenance system according to claim 4.
10. The processor, The promotion condition information is received from a user, and the received promotion condition information is stored in the storage unit.
5. The data consistency maintenance system according to claim 4.
11. The processor, When calling another program in the execution of the process, if the process is a local transaction and the other program is remote, information related to the local transaction is sent to the other program.
5. The data consistency maintenance system according to claim 4.
12. A data consistency maintenance method by a data consistency maintenance system capable of promoting a local transaction in an ongoing process to a distributed transaction, comprising: Detecting that the process involves either acquiring a lock on a second resource other than a first resource already in use, or performing an update, insert, or delete operation on the second resource; Upon detecting either occurrence, the local transaction in the process is promoted to a distributed transaction. How data integrity is maintained.
Citation Information
Patent Citations
Promotable transactions with promotable single phase enlistments
US7395264B2
Cited By
Distributed business data management system and method
CN119996149A
