Reported Issue
Source returned error: FATAL: terminating connection due to conflict with recovery
Relevant Versions
All Dremio Versions
Cause
This error suggests that it is an error connection to a read replica of postgresDB.
When the connector is reading from a Postgres replica that is configured as a Hot Standby, any update from the primary server will terminate queries on the replica after a certain amount of time. This default waiting time is usually not enough to sync any meaningful amount of data.
Steps to Resolve
Option 1. Set "hot_standby_feedback" to "true" on the replica server. This parameter will prevent the primary server from deleting the write-ahead logs when the replica is busy serving user queries. However, the downside is that the write-ahead log will increase in size
Option 2. Sync data when there is no update running in the primary server, or sync data from the primary server
Option 3: This is not recommended. You could increase "max_standby_archive_delay" and "max_standby_streaming_delay" to be larger than the amount of time needed to complete the data sync. However, it is usually hard to tell how much time it will take to sync all the data. As such, this approach is not very practical.
Additional Resources
See the "Handling Query Conflicts" section in the Postgres documentation for a more detailed explanation of this issue.