Skip to content

Conversation

@lszinv
Copy link

@lszinv lszinv commented Jan 28, 2026

note This is a rebased version of #3107 . A new PR is created to push this along as @nmemond is not currently available.

This adds integration tests to verify table and index limits during live spanner data migration from a PostgreSQL DB.

This includes tests for the following limits:

max size of a STRING cell
max size of data per cell
max size of a primary key
max size of an index
total size of non-key columns (currently ignored because of OOM issues with low-provisioned VMs/DBs)

@lszinv lszinv requested a review from a team as a code owner January 28, 2026 01:50
@gemini-code-assist
Copy link

Summary of Changes

Hello @lszinv, 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 significantly enhances the robustness of the DataStreamToSpanner Flex template by adding critical integration tests. These tests are designed to ensure that the migration process from PostgreSQL to Spanner (both standard and PG dialect) correctly handles various data size constraints, such as large primary keys, indexes, and cell values. This proactive testing helps prevent data integrity issues and performance bottlenecks when migrating large or complex datasets.

Highlights

  • New PostgreSQL to Spanner Limit Tests: Comprehensive integration tests have been introduced to validate Spanner's table and index limits during live data migration from PostgreSQL databases.
  • Covered Limits: The new tests specifically verify limits for STRING cell size, overall data per cell, primary key size, and index size, ensuring robust data handling.
  • SQL Script Execution Improvement: The base test utility DataStreamToSpannerITBase.java was updated to correctly differentiate and handle SELECT statements by using runSQLQuery instead of runSQLUpdate.
  • DLQ Configuration Update: Existing MySQL integration tests were updated to include the dlqMaxRetryCount parameter in job configurations, aligning with potential new error handling strategies.
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.

…migration from a MySQL database to a Spanner instance

This includes tests for the following limits:
- max size of a STRING cell
- max size of a data per cell
- max size of a primary key
- max size of an index
- total size of non-key columns (currently ignored because of OOM issues with low-provisioned VMs/DBs)
@lszinv lszinv force-pushed the lsz/pg-table-and-index-limit-tests-live branch from 1015230 to f82e0da Compare January 28, 2026 18:32
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.91%. Comparing base (94170b6) to head (da6ac16).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3265      +/-   ##
============================================
+ Coverage     50.88%   54.91%   +4.02%     
+ Complexity     5165     2277    -2888     
============================================
  Files           978      493     -485     
  Lines         60455    28861   -31594     
  Branches       6617     3036    -3581     
============================================
- Hits          30764    15848   -14916     
+ Misses        27529    12050   -15479     
+ Partials       2162      963    -1199     
Components Coverage Δ
spanner-templates 71.94% <ø> (+1.09%) ⬆️
spanner-import-export ∅ <ø> (∅)
spanner-live-forward-migration 80.04% <ø> (-0.07%) ⬇️
spanner-live-reverse-replication 77.58% <ø> (-0.04%) ⬇️
spanner-bulk-migration 88.08% <ø> (+0.01%) ⬆️
see 509 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.

@VardhanThigle
Copy link
Contributor

Could we please fix spotless for this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants