Skip to content

feat: Denylist small worker sizes in reverse replication#3044

Merged
manitgupta merged 6 commits intoGoogleCloudPlatform:mainfrom
manitgupta:add-denylist
Dec 8, 2025
Merged

feat: Denylist small worker sizes in reverse replication#3044
manitgupta merged 6 commits intoGoogleCloudPlatform:mainfrom
manitgupta:add-denylist

Conversation

@manitgupta
Copy link
Member

This change checks the workerMachineType used to run the reverse replication dataflow template and disallows small worker types. Small worker types are known to cause stability issues with the pipeline and this is a way to fast fail in cases of small worker usage.

The definition of small for reverse replication is a machine which has less than 4 vCPUs.

@manitgupta manitgupta requested a review from a team as a code owner December 3, 2025 09:49
@gemini-code-assist
Copy link

Summary of Changes

Hello @manitgupta, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a crucial validation step for Dataflow worker machine types within the reverse replication process. By integrating a new utility, the system now proactively checks and disallows the use of worker machines with fewer than 4 vCPUs. This change aims to improve the stability and reliability of the Dataflow pipelines by preventing deployments with insufficient resources, which have historically led to operational issues.

Highlights

  • New Worker Machine Type Validator: A new utility class, DataflowWorkerMachineTypeValidator, has been introduced to enforce minimum vCPU requirements for Dataflow worker machine types, handling both standard and custom formats.
  • Enforced Minimum vCPUs for Reverse Replication: The SpannerToSourceDb Dataflow template now utilizes the new validator to ensure that worker machines have at least 4 vCPUs, preventing the use of undersized configurations known to cause instability.
  • Comprehensive Unit Tests: Extensive unit tests have been added for the DataflowWorkerMachineTypeValidator to cover various valid and invalid machine type scenarios, ensuring its robustness.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 70.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.40%. Comparing base (5bdcf59) to head (10181e9).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
...ions/utils/DataflowWorkerMachineTypeValidator.java 77.77% 5 Missing and 1 partial ⚠️
...cloud/teleport/v2/templates/SpannerToSourceDb.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3044      +/-   ##
============================================
- Coverage     50.42%   50.40%   -0.03%     
+ Complexity     5022     5018       -4     
============================================
  Files           969      970       +1     
  Lines         59548    59578      +30     
  Branches       6493     6499       +6     
============================================
+ Hits          30030    30033       +3     
- Misses        27397    27420      +23     
- Partials       2121     2125       +4     
Components Coverage Δ
spanner-templates 70.58% <70.00%> (-0.07%) ⬇️
spanner-import-export 68.85% <ø> (-0.15%) ⬇️
spanner-live-forward-migration 80.03% <77.77%> (-0.02%) ⬇️
spanner-live-reverse-replication 77.42% <70.00%> (-0.09%) ⬇️
spanner-bulk-migration 88.25% <77.77%> (-0.04%) ⬇️
Files with missing lines Coverage Δ
...cloud/teleport/v2/templates/SpannerToSourceDb.java 0.00% <0.00%> (ø)
...ions/utils/DataflowWorkerMachineTypeValidator.java 77.77% <77.77%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@manitgupta manitgupta added the improvement Making existing code better label Dec 3, 2025
@VardhanThigle
Copy link
Contributor

VardhanThigle commented Dec 5, 2025

There's an IT failure where we are unable to bring up the desired machine for Dataflow worker Pool.
1 . Job
2. Failure

@VardhanThigle
Copy link
Contributor

Failure

Trying a rerun with increased Quota.

@manitgupta manitgupta merged commit 83f0329 into GoogleCloudPlatform:main Dec 8, 2025
33 of 35 checks passed
aasthabharill pushed a commit that referenced this pull request Dec 10, 2025
* Add check for small machines

* Remove log

* Apply spotless

* Use Preconditions

* Update IT and LT base classes with workerMachineType

* Add to params instead of env
aasthabharill pushed a commit to aasthabharill/DataflowTemplates that referenced this pull request Dec 15, 2025
…Platform#3044)

* Add check for small machines

* Remove log

* Apply spotless

* Use Preconditions

* Update IT and LT base classes with workerMachineType

* Add to params instead of env
aasthabharill pushed a commit to aasthabharill/DataflowTemplates that referenced this pull request Dec 17, 2025
…Platform#3044)

* Add check for small machines

* Remove log

* Apply spotless

* Use Preconditions

* Update IT and LT base classes with workerMachineType

* Add to params instead of env
MnkyGns pushed a commit to MnkyGns/DataflowTemplates that referenced this pull request Feb 12, 2026
…Platform#3044)

* Add check for small machines

* Remove log

* Apply spotless

* Use Preconditions

* Update IT and LT base classes with workerMachineType

* Add to params instead of env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Making existing code better size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants