GCS CloudSQL wal - ghdrako/doc_snipets GitHub Wiki
- https://cloud.google.com/sql/docs/postgres/backup-recovery/pitr
- https://www.googlecloudcommunity.com/gc/Databases/CloudSQL-point-in-time-where-is-the-Cloud-Storage-bucket/m-p/617750
show archive_command
-- /utils/replication_log_processor -disable_log_to_disk -action=archive -file_name=%f -local_file_path=%p -async_archive -remote_storage
write-ahead logs (WAL) for point-in-time recovery are stored in Cloud Storage in the same region as the instances. However, this is applicable for new Cloud SQL instances that have point-in-time recovery enabled or for existing instances that enable point-in-time recovery after this feature for storing WAL logs in Cloud Storage is available.
To check if an instance's logs are stored in Cloud Storage, you can check the bytes_used_by_data_type
metric for the instance. If the value for the archived_wal_log
data type is 0, the instance's logs are stored in Cloud Storage.
After connecting to a database of the instance using a PostgreSQL client such as psql or pgAdmin, you can run the command show archive_command
. If any WALs are archived in Cloud Storage, then you'll see -async_archive
-remote_storage
.
As for the Cloud Storage bucket that holds the WAL archives for CloudSQL instances, it is not publicly accessible. The bucket name is randomly generated, and it is not possible to determine the bucket name for a specific CloudSQL instance.
If you need to access the WAL archives for your CloudSQL instance, you can contact Google Cloud Support. They will be able to provide you with the bucket name and access credentials.