feat(firestore-bigquery-export): reinstate the Cloud Tasks write buffer - #3130
Open
cabljac wants to merge 1 commit into
Open
feat(firestore-bigquery-export): reinstate the Cloud Tasks write buffer#3130cabljac wants to merge 1 commit into
cabljac wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request reinstates the Cloud Tasks write buffer for the Firestore BigQuery Export kit, routing failed inline writes to a new syncBigQuery task queue instead of relying on Eventarc redelivery. Feedback suggests introducing a separate terminalTracker in HandlerContext to be used exclusively on the final Cloud Tasks retry attempt. This prevents transient failures from writing premature or duplicate entries to the backup collection.
cabljac
force-pushed
the
feat/kits-fbe-cloud-tasks-write-buffer
branch
from
September 7, 2026 16:45
d228429 to
f1c2448
Compare
cabljac
marked this pull request as ready for review
September 7, 2026 16:50
cabljac
force-pushed
the
feat/kits-fbe-cloud-tasks-write-buffer
branch
from
September 7, 2026 16:52
f1c2448 to
fd7c0d1
Compare
A failed inline write now enqueues onto the syncBigQuery task queue instead of self-healing once and rethrowing to the trigger retry policy. The queue retries five times with a 60s minimum backoff, throttled by MAX_DISPATCHES_PER_SECOND, and the tracker parks terminal failures in BACKUP_COLLECTION. The trigger drops its retry policy and a failed enqueue is logged, published as onError, and dropped, as the extension did. The success event is published after the insert and swallowed on failure, so a task retry cannot duplicate a row that already landed.
cabljac
force-pushed
the
feat/kits-fbe-cloud-tasks-write-buffer
branch
from
September 7, 2026 17:26
fd7c0d1 to
7b2c7a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fourth layer of the Cloud Tasks write buffer stack and the behaviour change, per the option D decision on #3031: migrating users keep the failure behaviour and cost profile they have today. Supersedes #3103.
A failed inline write now enqueues onto a new
syncBigQuerytask queue (5 attempts, 60s minimum backoff, throttled byMAX_DISPATCHES_PER_SECOND) after up toMAX_ENQUEUE_ATTEMPTSin-process attempts, instead of self-healing once and rethrowing to the trigger retry policy. The task handler re-attempts the write and rethrows so Cloud Tasks retries; the tracker parks terminal failures inBACKUP_COLLECTION. The trigger drops its retry policy, and a failed enqueue is logged, published asonError, and dropped, both exactly as the extension does. The function needsroles/cloudtasks.enqueuer. The queue function setsmaxInstancesto 500 to match the gen1 handler, since the gen2 default of 100 would 429 dispatches and burn attempts.One deliberate change from the extension: the success event is published after the insert and swallowed on failure, closing a duplicate-row route.
89 tests pass. Not verified live: that the deployed env carries
FIREBASE_KIT_INSTANCE_IDandFUNCTION_REGION, that the gen2 task function accepts the SDK's ID token, queue creation with the resolved throttle, and the task size limit on large documents.Fixes #3031.