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.13-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 31, 2025 03:47
@KodaiD KodaiD requested a review from Copilot October 31, 2025 03:47
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. The primary change introduces a check in the dropNamespace method for both JDBC and Cosmos storage implementations to verify that all tables in a namespace are managed by ScalarDB (i.e., have metadata entries) before allowing the namespace to be dropped.

Key changes:

  • Added abstract methods deleteMetadata() and dropTable() to AdminTestUtils for test utilities
  • Implemented namespace drop validation in JdbcAdmin and CosmosAdmin to check for non-ScalarDB tables
  • Added a new error code NAMESPACE_WITH_NON_SCALARDB_TABLES_CANNOT_BE_DROPPED for the validation failure
  • Added integration test dropNamespace_ForNamespaceWithNonScalarDBManagedTables_ShouldThrowIllegalArgumentException() to verify the new behavior

Reviewed Changes

Copilot reviewed 28 out of 28 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() to support testing namespace drop validation
DistributedStorageAdminIntegrationTestBase.java Added test case for dropping namespaces with non-ScalarDB managed tables
JdbcAdmin.java Added validation logic to check for non-ScalarDB tables before dropping namespace
CosmosAdmin.java Added validation logic to check for non-ScalarDB tables before dropping namespace
RdbEngineStrategy.java Added getTableNamesInNamespaceSql() method to RDB engine interface
RdbEngine*.java Implemented getTableNamesInNamespaceSql() for each database engine
CoreError.java Added new error code for namespace drop validation failure
*AdminTestUtils.java Implemented deleteMetadata() and dropTable() methods in all test utility classes
*AdminIntegrationTest.java Added getAdminTestUtils() implementation and disabled SQLite/DynamoDB tests where namespace concept doesn't apply
*AdminTestBase.java Updated test mocks to support the new namespace validation logic

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

@KodaiD KodaiD merged commit ce6936d into 3.13 Oct 31, 2025
106 of 107 checks passed
@KodaiD KodaiD deleted the 3.13-pull-3092 branch October 31, 2025 04:21
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