Use PITR based rollback pipeline - #773
Conversation
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Code Review
This pull request integrates Spanner Point-in-Time Recovery (PITR) rollback capabilities into the ingestion workflow by introducing a rollback Dataflow pipeline. Key changes include capturing a pre-ingestion timestamp and updating the rollback subworkflow to execute the rollback Dataflow job. The review feedback highlights critical improvements: first, defaulting dataflow_gcs_path to an empty string to prevent a runtime TypeError caused by eager evaluation of text.replace_all when the environment variable is missing; second, wrapping subworkflow parameters that have default values (such as rollback_timestamp and pipeline_err) in curly braces to adhere to Google Cloud Workflows syntax.
c8d7c5b to
d907896
Compare
gmechali
left a comment
There was a problem hiding this comment.
I want to make sure that we don't release the lock if rollback fails. If it fails then we should continue to keep the ingestion lock and fire some kind of alert. Are you aligned with that behavior?
Other than that lgtm!
Update
spanner-ingestion-workflowrollback logic to use PITR rollback pipelineSummary
Updates
spanner-ingestion-workflow.yamlanddeploy-services.yamlto use the new Spanner Point-In-Time Recovery (PITR) Dataflow rollback pipeline (#748) instead of reverting import versions and re-running ingestion/aggregation on failure.Changes
rollback_timestamp(time.format(sys.now())) immediately after acquiring the global Spanner ingestion lock and before ingestion starts.rollback_subworkflowandrun_dataflow_jobto launch theRollbackPipelineDataflow Flex Template (rollback-job-<timestamp>) withimportListandrollbackTimestamp.RETRYviaupdate_state_subworkflowonce the PITR rollback job completes, and logs both the original pipeline failure and rollback failure if rollback fails.ROLLBACK_TEMPLATE_PATHtospanner-ingestion-workflowindeploy-services.yamlwith a safe fallback derived fromDATAFLOW_TEMPLATE_PATH.TAG=agy
CONV=d4c3965b-966c-44f5-a041-24325139356a