What Happens if I Restore My Database When Using Logical Replication?
Question
How does restoring the source database to a previous state affect my syncs when using logical replication as the incremental update method?
Environment
- Database connectors
- Update method: Logical replication
Answer
Restoring your database to a previous state, such as from a backup or snapshot, may disrupt logical replication because the cursor's history becomes inconsistent with the log files used by the connection.
When this occurs, connections may lose their place in the change stream if the log files referenced by the connection are invalidated, overwritten, or rolled back.
To address this, we trigger a full re-sync and overwrite the data in your destination with the restored state of the database.