Medium severityexecution
Power BI Refresh Error:
ReplicationLagExceeded
What does this error mean?
A Snowflake secondary database replica has fallen too far behind the primary, causing downstream queries to read stale data. This manifests as unexpected NULL values or missing rows when querying a secondary that has not been refreshed recently enough.
Common causes
- 1The secondary database refresh schedule is too infrequent relative to the rate of primary changes
- 2A large schema change or bulk DML on the primary caused the replication refresh to take longer than expected
- 3The secondary database auto-refresh failed due to a transient network or warehouse issue and was not retried
- 4Data retention time on the primary is shorter than the replication lag, causing snapshot unavailability
- 5The replication group's suspension was not detected and replication silently stopped
How to fix it
- 1Check lag time: SELECT SECONDARY_SNOWFLAKE_REGION, REPLICATION_LAG_TIME FROM SNOWFLAKE.ACCOUNT_USAGE.REPLICATION_GROUP_REFRESH_HISTORY.
- 2Manually trigger a refresh: ALTER DATABASE <secondary_db> REFRESH.
- 3Increase refresh frequency in the replication schedule or switch to continuous replication where supported.
- 4Verify the primary's DATA_RETENTION_TIME_IN_DAYS is greater than the maximum expected replication lag.
- 5Set up Snowflake alerts on REPLICATION_GROUP_REFRESH_HISTORY to notify when refresh lag exceeds a threshold.