When you're dealing with Google Cloud Datastream and you're not seeing any events processed, there are several areas you can check to troubleshoot the issue:
Stream Settings:
- Start State: Ensure the stream is "Started" (or "Running") in the UI.
- CDC Mode: Verify "Incremental" mode for ongoing changes or "Full Refresh" for a one-time operation (depending on needs).
- Table Inclusion: Confirm desired tables are included with correct names.
- Start Timestamp: Set it before the latest data to replicate. Avoid future timestamps that prevent processing.
- Additional Settings: Check for any stream-specific settings affecting data capture, such as filters or transformations.
Source Database Configuration:
- Data Changes: Ensure changes are logged in binary logs (e.g., INSERT, UPDATE, DELETE).
- Binlog Configuration: Enable binlog in ROW format.
- Database User Access: Grant REPLICATION SLAVE and SELECT privileges minimum. Consider additional permissions based on your use case (e.g., creating BigQuery objects).
- Database Version: Confirm compatibility with Datastream.
Network and Firewall Restrictions:
- Connectivity: Confirm connectivity between source and Datastream service.
- SSL Certificates: Validate certificate validity and recognition.
- IP Whitelist: Ensure required Datastream IP ranges are allowed in firewall rules.
- Private Connections: Verify VPC peering or Cloud Interconnect configuration.
Data Type Mismatch:
- Check for incompatible data types between MariaDB and BigQuery.
- Verify supported character sets and collations and their mapping between the two systems.
- Avoid unsupported MariaDB features.
Advanced Troubleshooting:
- Logs and Monitoring:
- Inspect Datastream logs in Logs Explorer, looking for patterns like specific times when errors occur.
- Check relevant metrics in Google Cloud Monitoring.
- Analyze the stream activity chart for anomalies.
- Quotas: Check for exceeded Datastream quotas in the Google Cloud Console (IAM & Admin -> Quotas).
- CDC Events: Confirm the source database actively receives transactions that modify data.
Troubleshooting Steps:
- Start with common, easily checked issues.
- Follow the troubleshooting guide in a logical and methodical order.
- Contact Google Cloud Support for further assistance if needed.
Remember:
- Restart the Stream after any configuration changes.
- Refer to the latest documentation for accuracy and updates.
- Update the stream configuration if the source database structure changes (e.g., adding or dropping columns).
Documentation: