cdc_status()
relationalai.app
cdc_status()A procedure that retrieves the current status and other details of the CDC Service.
Requires the app_user application role.
Parameters
Section titled “Parameters”None.
Returns
Section titled “Returns”A table with the following columns:
| Column | Type | Description |
|---|---|---|
CDC_ENABLED | BOOLEAN | Whether the CDC service is enabled. |
CDC_ENGINE_NAME | STRING | The name of the current CDC engine. NULL if CDC is disabled. |
CDC_ENGINE_STATUS | STRING | The current status of the CDC engine. See CDC engine statuses. NULL if CDC is disabled. |
CDC_ENGINE_SIZE | STRING | The configured size of the CDC engine. |
CDC_TASK_STATUS | STRING | The status of the CDC service. May be one of:
|
CDC_TASK_INFO | VARIANT | A JSON object with four fields: status, created_on, last_suspended_on, and last_suspension_reason. |
CDC engine statuses
Section titled “CDC engine statuses”| Status | Description |
|---|---|
READY | The CDC engine is running and ready to process changes. |
PENDING | The CDC engine is not ready yet. It might be starting, resuming, provisioning an endpoint, or finishing its configuration. Wait and call app.cdc_status() again. If the status remains in PENDING for an extended period of time, wait for any active CDC_MANAGED_ENGINE transactions in api.transactions to finish, then run CALL relationalai.api.delete_engine('CDC_MANAGED_ENGINE', TRUE); to force deletion of the engine. RAI creates a replacement engine when there are new changes to process. |
SUSPENDING | The CDC engine is becoming idle. Wait and call app.cdc_status() again. |
SUSPENDED | The CDC engine is idle. No action is required; it resumes automatically when there are changes to process. |
UPGRADING | The CDC engine is being upgraded. Wait and call app.cdc_status() again. |
DELETING | The CDC engine is being deleted. Wait for deletion to finish. RAI creates a new CDC engine when there are changes to process. |
FAILED | The CDC engine’s service failed. RAI attempts to delete and recreate it when there are changes to process. If the status does not recover, wait for active CDC_MANAGED_ENGINE transactions in api.transactions to finish. With the eng_admin application role, call CALL relationalai.api.delete_engine('CDC_MANAGED_ENGINE', TRUE);. RAI creates a replacement when there are new changes to process. |
GONE | The CDC engine’s service no longer exists, but its metadata remains. RAI attempts to remove the stale metadata and recreate the engine when there are changes to process. If the status does not recover, wait for active CDC_MANAGED_ENGINE transactions in api.transactions to finish. With the eng_admin application role, call CALL relationalai.api.delete_engine('CDC_MANAGED_ENGINE', TRUE);. RAI creates a replacement when there are new changes to process. |
Example
Section titled “Example”Use app.cdc_status() to check the current status of the RAI Native App’s CDC Service:
CALL relationalai.app.cdc_status();/*+--------------+--------------------+-------------------+------------------+-----------------+--------------------------------------------------------------------------------------------------------------------------| | CDC_ENABLED | CDC_ENGINE_NAME | CDC_ENGINE_STATUS | CDC_ENGINE_SIZE | CDC_TASK_STATUS | CDC_TASK_INFO | |--------------+--------------------+-------------------+------------------+-----------------+--------------------------------------------------------------------------------------------------------------------------| | TRUE | CDC_MANAGED_ENGINE | READY | HIGHMEM_X64_S | started | {"status": "started", "created_on": "2024-10-15 21:58:11.291 -0700", "last_suspended_on": null, "last_suspension_reason": null} | +--------------+--------------------+-------------------+------------------+-----------------+--------------------------------------------------------------------------------------------------------------------------| */See Enable and disable CDC for more information on the CDC service.