Skip to content

Conversation

@feeblefakie
Copy link
Contributor

This is an automated backport of the following:

Please merge this PR after all checks have passed.

Co-authored-by: Mitsunori Komatsu <[email protected]>
Co-authored-by: Toshihiro Suzuki <[email protected]>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @feeblefakie, 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 is an automated backport aimed at improving the robustness and compatibility of our JDBC database permission integration tests. The changes primarily focus on enhancing DDL operation handling for specific database systems like Yugabyte and Db2, ensuring tests run reliably across different JDBC backends. It also includes some general refactoring of DDL-related wait mechanisms within the test framework.

Highlights

  • JDBC Permission Test Enhancements for Yugabyte: I've introduced a waitForDdlCompletion() mechanism in JdbcAdminPermissionIntegrationTest and JdbcPermissionIntegrationTest that includes a 1-second sleep specifically for Yugabyte. This addresses potential schema or catalog version mismatch errors due to DDL operations not being immediately consistent in Yugabyte.
  • JDBC Permission Test Enhancements for Db2: I've added specific handling for Db2 in JdbcPermissionTestUtils. User creation and dropping are now skipped for Db2, and the getGrantPermissionStatements method includes GRANT DBADM and GRANT DATAACCESS statements for Db2 users.
  • Refactoring of DDL Wait Methods: I've refactored the DDL waiting logic across the integration test base classes. The waitForTableCreation() method has been generalized and renamed to waitForDdlCompletion() in CassandraPermissionIntegrationTest, DistributedStorageAdminPermissionIntegrationTestBase, and DistributedStoragePermissionIntegrationTestBase to provide a more generic wait mechanism for DDL operations.
  • Minor Test Schema Adjustment: I've updated the test table metadata in DistributedStorageAdminPermissionIntegrationTestBase to change the data type of COL_NAME3 from TEXT to INT.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request backports permission tests for JDBC databases, adding DB2 support. It refactors waitForTableCreation() to waitForDdlCompletion() and introduces wait logic for DDL propagation in JDBC tests, especially for YugabyteDB. The review identified code duplication in the wait logic across test classes and a data type change that needs verification.

Comment on lines +65 to +70
private void waitForDdlCompletion() {
if (JdbcTestUtils.isYugabyte(rdbEngine)) {
// This is needed to avoid schema or catalog version mismatch database errors.
Uninterruptibles.sleepUninterruptibly(DDL_WAIT_SECONDS, TimeUnit.SECONDS);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic within waitForDdlCompletion is identical to the implementation in JdbcPermissionIntegrationTest.java. To improve maintainability and avoid code duplication, consider extracting this logic into a shared utility method. A new static method in an existing utility class like JdbcPermissionTestUtils would be a suitable place for it.

Comment on lines +39 to +44
protected void waitForDdlCompletion() {
if (JdbcTestUtils.isYugabyte(rdbEngine)) {
// This is needed to avoid schema or catalog version mismatch database errors.
Uninterruptibles.sleepUninterruptibly(DDL_WAIT_SECONDS, TimeUnit.SECONDS);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This waitForDdlCompletion method is identical to the one in JdbcAdminPermissionIntegrationTest.java. To avoid code duplication and improve maintainability, consider extracting this logic into a common utility method. For example, a new static method in JdbcPermissionTestUtils could hold the shared logic, which can then be called from both test classes.

.addColumn(COL_NAME1, DataType.INT)
.addColumn(COL_NAME2, DataType.TEXT)
.addColumn(COL_NAME3, DataType.TEXT)
.addColumn(COL_NAME3, DataType.INT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The column COL_NAME3 is being changed from TEXT to INT. Ensure that this change is intentional and that it does not break any existing functionality or data compatibility.

@KodaiD
Copy link
Contributor

KodaiD commented Aug 5, 2025

@KodaiD KodaiD merged commit 29a39d1 into 3.13 Aug 5, 2025
72 checks passed
@KodaiD KodaiD deleted the 3.13-pull-2923 branch August 5, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants