Module 08 · Lesson 9 of 12Detailed study · about 15 min

Channels and offsets: recover without guessing

A Named Channel ties a source partition to committed progress. Recovery reuses that identity and resumes from the confirmed source position.

Understand the idea

Use one active owner per source partition/channel. Reopen the same channel, retrieve committed progress, reconcile errors and seek the source accordingly. Opening a new channel name on every restart discards the recovery relationship.

Key ideas in simple English
ConceptWhat it means
Stable identityReuse the same channel for the same partition.
Submitted offsetA record was sent; commit is not yet proven.
Committed offsetDurable checkpoint reported by Snowflake.
OrderingWithin a channel, not globally across all channels.

A concrete example

Offsets 40–42 were sent, but only 40 is committed when the client crashes. Recovery starts from 41.

Remember: Exactly-once ingestion depends on correct source replay and checkpoint coordination, not just an HTTP success.

Explain it step by step · full theory

Setup and reasoning

Use one active owner per source partition/channel. Reopen the same channel, retrieve committed progress, reconcile errors and seek the source accordingly. Opening a new channel name on every restart discards the recovery relationship.

Committed checkpoint progress can coexist with rejected rows. Inspect channel error counts and failing offset information before treating the source range as fully delivered. Preserve rejected payloads and their source identity in a durable recovery queue. Do not assume a generic retry of an ambiguous request is safe.

With direct REST, continuation tokens sequence requests; source offsets describe source progress. They are different tokens. Follow the documented reopen/conflict and in-flight-row handling procedure after an ambiguous transport failure.

Words used in this lesson
Stable identity
Reuse the same channel for the same partition.
Submitted offset
A record was sent; commit is not yet proven.
Committed offset
Durable checkpoint reported by Snowflake.
Ordering
Within a channel, not globally across all channels.

See how it works

Choose a step to explore the idea at your own pace.

Open the interactive explanation
Interactive explainer1 / 3

Channels and offsets: recover without guessing

Stable identity
Submitted offset

Identify the input

A Named Channel ties a source partition to committed progress. Recovery reuses that identity and resumes from the confirmed source position.

Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.

Read the complete diagram explanation
  1. Identify the input

    A Named Channel ties a source partition to committed progress. Recovery reuses that identity and resumes from the confirmed source position.

  2. Follow delivery

    Offsets 40–42 were sent, but only 40 is committed when the client crashes. Recovery starts from 41.

  3. Verify and recover

    Exactly-once ingestion depends on correct source replay and checkpoint coordination, not just an HTTP success.

Try the SQL or command

Read → predict → run in your learning environment → compare. You can also learn by reading without an account.

New to SQL? Where to run it and how to read it

A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.

  1. No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
  2. For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
  3. Read the entire example, including comments beginning with --. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor.
  4. Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
SELECT / FROM
Choose the values to return / identify their input.
VALUES / COLUMN1
VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
AS / WITH
AS gives a result a readable name. WITH names a temporary query step within one statement.
NULL / ::
NULL means missing or unknown. The :: notation converts a value to a named data type.
Session
One connection and its settings. Keep related transaction steps in the same session.
Database.schema.table
A full address for stored data. It is separate from the warehouse that processes queries.

Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →

Help with common practice errors
  • No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
  • Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
  • Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
  • Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.

Before running this lesson

Manual examples only. Complete Modules 05–07 and the first lesson’s M8_LAB setup. Select L2_OBJECTS_LAB.M8_LAB in each SQL session. Replace every placeholder and choose exactly one cloud provider. Cloud IAM/notifications require authorized setup; streaming protocol outlines are explicitly non-executable. No credentials belong in this website.

Recovery algorithm

Pseudocode — design exercise · example
channel = reopen_same_partition_channel()
checkpoint = read_committed_source_offset(channel)
reconcile_reported_row_errors_with_durable_reject_store()
source.seek(after(checkpoint))
for batch in source:
    append_rows_with_source_offsets(channel, batch)
    wait_for_commit_status_and_inspect_errors()
    persist_or_resolve_rejections_before_acknowledging_source()

What to expect and why

Use the exact SDK operations for the chosen version. A source must retain enough history to replay from the committed checkpoint.

Check your understanding

Choose an answer, then check your reasoning. This is practice, not a scored test.

Sent through 42; committed through 40; client crashes. Where does the controlled replay start?

Try it yourself

What changes if the source cannot replay old records?

Compare your reasoning

Introduce durable buffering or accept/document weaker recovery guarantees. Offset tokens cannot recreate data the source already discarded.

Official sources and curriculum

Module 08 · See module scope