nerdexam
Google

PROFESSIONAL-DATA-ENGINEER · Question #249

You are updating the code for a subscriber to a Pub/Sub feed. You are concerned that upon deployment the subscriber may erroneously acknowledge messages, leading to message loss. Your subscriber is…

The correct answer is B. Create a Pub/Sub snapshot before deploying new subscriber code. Creating a Pub/Sub snapshot before deploying captures the state of all unacknowledged messages at that point in time, allowing you to use a Seek operation to roll back to that snapshot if the new subscriber code mistakenly acknowledges messages - effectively replaying those…

Submitted by chen.hong· Mar 30, 2026Building and operationalizing data processing systems

Question

You are updating the code for a subscriber to a Pub/Sub feed. You are concerned that upon deployment the subscriber may erroneously acknowledge messages, leading to message loss. Your subscriber is not set up to retain acknowledged messages. What should you do to ensure that you can recover from errors after deployment?

Options

  • ASet up the Pub/Sub emulator on your local machine.
  • BCreate a Pub/Sub snapshot before deploying new subscriber code.
  • CUse Cloud Build for your deployment. If an error occurs after deployment, use a Seek operation to locate a timestamp logged by Cloud Build at the start of the
  • DEnable dead-lettering on the Pub/Sub topic to capture messages that aren't successfully acknowledged.

How the community answered

(47 responses)
  • A
    2% (1)
  • B
    85% (40)
  • C
    4% (2)
  • D
    9% (4)

Explanation

Creating a Pub/Sub snapshot before deploying captures the state of all unacknowledged messages at that point in time, allowing you to use a Seek operation to roll back to that snapshot if the new subscriber code mistakenly acknowledges messages - effectively replaying those messages from the pre-deployment state.

Why the distractors fail:

  • A - The Pub/Sub emulator is a local development/testing tool; it has no bearing on recovering messages in a production deployment.
  • C - Cloud Build timestamps are useful for Seek, but only if you combine them with a snapshot or know the exact pre-deployment timestamp; without a snapshot, a timestamp-based Seek only works if message retention is enabled, which the question states it is not.
  • D - Dead-lettering captures messages that fail acknowledgment (exceed delivery attempts), not messages that are erroneously acknowledged - once a message is acked, it's gone without a snapshot.

Memory tip: Think of a Pub/Sub snapshot like a save point in a video game - take it before you do something risky, so you can always Seek back to that checkpoint if things go wrong.

Topics

#Pub/Sub#Snapshots#Error Recovery#Message Loss

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-DATA-ENGINEER Practice