professional-cloud-data-engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
An organization runs an hourly batch data pipeline orchestrated by Cloud Scheduler that invokes an HTTP endpoint hosted on Cloud Run. The service ingests transaction data and writes the processed records into BigQuery.
Due to transient network interruptions, the HTTP target occasionally receives duplicate invocations for a single scheduled run. Furthermore, long-running job attempts sometimes cause Cloud Scheduler to mark an attempt as failed even though the Cloud Run container is still processing the request, blocking subsequent hourly executions.
You need to ensure idempotent execution across retry attempts and resolve the job execution timeout mismatch.
What should you do?
This solution uses Cloud Scheduler's built-in execution metadata headers to enforce idempotent request handling while tuning the attempt_deadline setting to align Cloud Scheduler's client timeout with the Cloud Run service timeout.
X-CloudScheduler-ScheduleTime header to HTTP requests. This header represents the original scheduled invocation timestamp and remains constant across all automated retry attempts for that specific scheduled interval. Combining the job name with X-CloudScheduler-ScheduleTime produces a deterministic deduplication key, allowing the Cloud Run handler to check if a specific schedule interval has already been processed or is currently executing.attempt_deadline field in Cloud Scheduler ensures Cloud Scheduler waits sufficiently for Cloud Run to respond before timing out the attempt. If attempt_deadline is shorter than the workload processing time, Cloud Scheduler treats the call as failed, initiates retries, or keeps the execution state in AttemptStarted without receiving an AttemptFinished response, which skips subsequent scheduled runs.Cloud Scheduler provides "at-least-once" delivery semantics. Leveraging X-CloudScheduler-ScheduleTime is the standard native mechanism for deduplication because Cloud Scheduler populates this value deterministically for every attempt of a given schedule instance, unlike generic HTTP headers.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.