Apparatus, method, and computer program product for resolving hung transactions

    公开(公告)号:US12072872B1

    公开(公告)日:2024-08-27

    申请号:US18480193

    申请日:2023-10-03

    申请人: Gravic, Inc.

    IPC分类号: G06F16/23 G06F16/27 G06F16/28

    摘要: Hung transactions which are completed within a transaction processing system are resolved. The transactions are replicated from a source database to a target database by a replication engine. The hung transaction is incomplete in either the source or the target database. A transaction pattern table is provided that includes a plurality of records, each record being defined by a transaction pattern identifier. Each record includes a transaction pattern and a metric of occurrence of the transaction pattern. A comparison is made of the series of one or more transaction steps or operations of a hung transaction to the transaction patterns in the transaction pattern table, and a subset of transaction patterns in the transaction pattern table are identified that are potential candidates for matching the hung transaction. The hung transaction is categorized using the metric of occurrence of the transaction pattern for each transaction pattern in the subset of transaction patterns. The categorizing predicts when all of the series of one or more transaction steps or operations which have completed in the source database have been replicated. The metric of occurrence of the transaction pattern for each record of the transaction pattern table is (i) a count that is continuously updated based on completed transactions that match the transaction pattern, or (ii) a prepopulated probability of occurrence of the transaction pattern, or (iii) derived from historical data of the transaction pattern. The hung transaction is then processed using the categorization of the hung transaction.

    Method and apparatus for resolving target database constraint violations in a database replication system where target database transactions are automatically aborted due to constraints violations

    公开(公告)号:US11934424B1

    公开(公告)日:2024-03-19

    申请号:US18103856

    申请日:2023-01-31

    申请人: Gravic, Inc.

    摘要: A method and apparatus are provided for avoiding target database constraint violations in a database replication system. The database replication system includes a source database and a target database, wherein target database transactions automatically abort due to constraint violations. Each database has one or more tables and at least one of the target database tables has one or more constraints. The database replication system replicates source database transactions. For each target database transaction corresponding to a replicated source database transaction, changes made at the source database are replicated to the target database. When it is detected that a replicated change causes a constraint violation as a result of one or more of the target database tables having one or more constraints, the applying of the database change to the target database of the database change is deferred and the database change is posted to an electronic list. Replicated changes that do not cause a constraint violation are immediately applied to the target database. This process is repeated for all of the changes within the replicated source database transaction. The database changes on the electronic list are iterated through by applying the database changes on the electronic list that no longer cause a constraint violation to the target database and removing the applied database changes from the electronic list, and by deferring again the applying of the database changes on the electronic list that still cause a constraint violation and maintaining the deferred database changes on the electronic list. A commit is performed for the target database transaction corresponding to the replicated source database transaction when a commit operation is detected in the replicated source database transaction, and when no database changes remain on the electronic list for the replicated source database transaction. The deferring process avoids the target database transactions automatically aborting due to constraint violations.

    Method and apparatus for using representations of blocks of data when continuously comparing two databases which are actively being kept synchronized

    公开(公告)号:US11921748B1

    公开(公告)日:2024-03-05

    申请号:US18529824

    申请日:2023-12-05

    申请人: Gravic, Inc.

    IPC分类号: G06F16/27 G06F16/23

    摘要: An automated method and apparatus are provided for comparing a source database and a target database that are intended to be kept in synchronization with each other. An application processes database changes that are posted to the source database and replicated to the target database. The source database and the target database are made up of blocks of data. Blocks of data from the source database having database changes are collected. These blocks of data are replicated to the target database. Blocks of data from the target database that correspond to the blocks of data from the source database having database changes are read. Representations of the blocks of data from the source database having database changes are compared to representations of blocks of data from the target database that correspond to the blocks of data from the source database having database changes. A corrective action is performed when the comparison indicates that the representations of the blocks of data from the source database having database changes do not match the representations of blocks of data from the target database that correspond to the blocks of data from the source database having database changes. A similar process is performed using “before images” of blocks of data from the source database having database changes and then comparing representations of these “before images” to representations of “current images” of blocks of data from the target database that correspond to the before images of blocks of data from the source database having database changes.