# How do I prevent and recover from a stale Snowflake stream?

Exam: COF-C03 — SnowPro Core Certification Exam
Knowledge domain: Performance Optimization, Querying, and Transformation
Updated: 2026-11-25T08:00:25.325753+00:00
HTML: https://learningpathx.com/faq/COF-C03/cofc03-snowflake-stream-staleness-and-retention.html

## Also asked as

- What does STALE\_AFTER mean, and what can I do before and after a Snowflake stream goes stale?
- How can I keep a Snowflake stream current or recover when unconsumed changes expire?

Monitor `STALE_AFTER` using `SHOW STREAMS` or `DESCRIBE STREAM` and commit a qualifying consumption transaction before that time. A stream becomes stale once the source history required by its offset is unavailable. Recreate a stale stream to track new changes and handle any old gap through a separate backfill or reconciliation.

The deadline depends on source retention and any extension that applies. On eligible tables with short retention, Snowflake can temporarily extend retention to keep the offset available, by default up to 14 days under the documented conditions. `MAX_DATA_EXTENSION_TIME_IN_DAYS` controls the extension ceiling. Shared sources do not receive this extension. Extended retention can increase storage use, so monitor both stream lag and storage. Treat the displayed timestamp as a prediction and alert before it.

Calling `SYSTEM$STREAM_HAS_DATA` helps keep an empty stream from becoming stale when it returns FALSE. A plain SELECT on a stream waiting to be consumed leaves its offset in place. If it goes stale, check for a separate recoverable snapshot or source log, identify the missing interval, reconcile the target, and resume consumption using a newly created stream.

[Retention and staleness](https://docs.snowflake.com/en/user-guide/streams-intro) · [SYSTEM$STREAM\_HAS\_DATA](https://docs.snowflake.com/en/sql-reference/functions/system_stream_has_data)

Source: [Snowflake SQL Transformation, Streams, Tasks, and Pipeline Patterns](https://learningpathx.com/news/snowflake-sql-transformation-streams-tasks-and-pipeline-patterns.html)
