Handling Transient and Permanent Errors in Replicat for Google Spanner

Google Spanner has two categories of errors: transient or permanent. While transient errors can be retried, permanent errors cannot be resolved merely by retrying. It requires performing the corrective action before retrying the transaction.

Learn about the details of transient and permanent errors and their handling in Oracle GoldenGate Replicat.

Handling Replicat Errors during DML Operations for Google Spanner

In Spanner, if a DML results in an error (whether transient or permanent) inside a transaction, that transaction becomes invalid and unusable. The same transaction can then neither be committed partially nor can be retried.

All the DMLs in that transaction need to be retried using a new transaction object. Only the failing DML alone cannot be retried within an invalid transaction.

For duplicate primary key and the row not found errors DML level REPERROR should be used. For all other Google Cloud Spanner errors, the transaction level REPERROR handling is used.

For all other errors from Spanner, only the transaction level REPERROR handling is supported. The supported REPERROR actions for Google Cloud Spanner are TRANSDISCARD, TRANSEXCEPTION, TRANSABORT.

See REPERROR in the Parameters and Functions Reference for Oracle GoldenGate.

Handling Transient Errors

Transient errors indicate temporary conditions that have a high chance to succeed upon retry. On detecting such errors, it is highly recommended that you retry the transaction with REPERROR.

Following is the REPERROR strategy for handling transient errors:

Syntax:

REPERROR (*status code*, TRANSABORT, MAXRETRIES *n*, DELAYSECS *n*)

Handling Permanent Errors

When permanent errors are detected, Oracle GoldenGate Replicat abends with an error after rolling back the transaction. You must fix the underlying problem in the Spanner database before restarting the Replicat.