Skip to content

Conversation

@feeblefakie
Copy link
Contributor

This is an automated request for a manual backport of the following:

  1. Resolve any conflicts that occur during the cherry-picking process.
git fetch origin &&
git checkout 3.14-pull-3092 &&
git cherry-pick --no-rerere-autoupdate -m1 024172e8a650f26bfc3019642932e0d3424c303b
  1. Push the changes.
  2. Merge this PR after all checks have passed.

Thank you!

@KodaiD KodaiD marked this pull request as ready for review October 30, 2025 10:53
@KodaiD KodaiD requested a review from Copilot October 30, 2025 10:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds validation to prevent dropping namespaces that contain non-ScalarDB managed tables. When dropNamespace() is called, the system now checks for tables that exist in the underlying storage but lack ScalarDB metadata, throwing an IllegalArgumentException if any are found.

Key changes:

  • Added deleteMetadata() and dropTable() methods to AdminTestUtils and implementations to support testing scenarios with non-managed tables
  • Implemented namespace validation in JdbcAdmin and CosmosAdmin to check for non-ScalarDB tables before dropping
  • Added database-specific SQL queries to retrieve table names from the underlying storage via getTableNamesInNamespaceSql() method in RDB engine strategies

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
AdminTestUtils.java Added abstract methods deleteMetadata() and dropTable() for test utilities
DistributedStorageAdminIntegrationTestBase.java Added integration test for namespace drop validation and abstract method to get admin test utils
JdbcAdmin.java Implemented namespace validation logic using getInternalTableNames() before dropping
CosmosAdmin.java Implemented namespace validation using getRawTableNames() before dropping with exception re-throw
CoreError.java Added new error message for namespace with non-ScalarDB tables
RdbEngineStrategy.java Added getTableNamesInNamespaceSql() method to strategy interface
RdbEngine*.java Implemented database-specific SQL queries for each RDB engine (MySQL, PostgreSQL, Oracle, SQL Server, SQLite)
*AdminTestUtils.java Implemented deleteMetadata() and dropTable() methods for each storage adapter
*AdminIntegrationTest.java Added getAdminTestUtils() implementation and test overrides for database-specific behavior
JdbcAdminTestBase.java Updated mocks to support the new table names query in dropNamespace tests
CosmosAdminTestBase.java Added unit test for namespace drop validation with non-ScalarDB tables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@KodaiD KodaiD merged commit 7337114 into 3.14 Oct 30, 2025
57 checks passed
@KodaiD KodaiD deleted the 3.14-pull-3092 branch October 30, 2025 11:09
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