You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "menghaoranss (via GitHub)" <gi...@apache.org> on 2026/06/26 09:49:35 UTC
[PR] Fix metadata refresh for quoted uppercase PostgreSQL tables [shardingsphere]
menghaoranss opened a new pull request, #38929:
URL: https://github.com/apache/shardingsphere/pull/38929
Changes proposed in this pull request:
- Fix metadata refresh for quoted uppercase PostgreSQL tables
---
Before committing this PR, I'm sure that I have checked the following options:
- [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
- [ ] I have self-reviewed the commit code.
- [ ] I have (or in comment I request) added corresponding labels for the pull request.
- [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
- [ ] I have made corresponding changes to the documentation.
- [ ] I have added corresponding unit tests for my changes.
- [ ] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix metadata refresh for quoted uppercase PostgreSQL tables [shardingsphere]
Posted by "menghaoranss (via GitHub)" <gi...@apache.org>.
menghaoranss merged PR #38929:
URL: https://github.com/apache/shardingsphere/pull/38929
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix metadata refresh for quoted uppercase PostgreSQL tables [shardingsphere]
Posted by "menghaoranss (via GitHub)" <gi...@apache.org>.
menghaoranss commented on PR #38929:
URL: https://github.com/apache/shardingsphere/pull/38929#issuecomment-4808782224
### Summary
**Review Result: Mergeable**
Reason: The patch now fixes both root-cause paths for PostgreSQL quoted uppercase metadata names: cluster metadata deletion can remove actual-name table/view entries from memory, and schema snapshot diffing no longer treats persisted actual names as unquoted SQL identifiers.
### Evidence
- `infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereSchema.java` now removes table/view entries by exact actual name first, then falls back to the existing identifier lookup. This addresses repository deletion events where the path carries the persisted object name but no SQL quote metadata.
- `infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManager.java` now compares reload/current schema tables through actual-name maps. This prevents PostgreSQL quoted uppercase names such as `Foo_Tbl` from being misclassified as added or dropped because `containsTable(String)` applies unquoted identifier normalization.
- The implementation is generic shared metadata logic and does not add PostgreSQL-specific branching or target-specific leakage.
- The table diff implementation preserves performance by building one actual-name map per comparison instead of repeatedly scanning schema tables.
- Tests cover both repaired paths:
- `GenericSchemaManagerTest` covers same actual uppercase table names under lower-case identifier rules for added/dropped diffing.
- `ShardingSphereSchemaIdentifierTest` covers actual-name removal for uppercase table and view metadata.
### Review Details
Reviewed Scope:
- `infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManager.java`
- `infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereSchema.java`
- `infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManagerTest.java`
- `infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereSchemaIdentifierTest.java`
GitHub PR metadata was not available because this review was requested against local uncommitted changes, not a PR number. The reviewed scope was derived from the local diff for this fix.
Not Reviewed Scope:
- Existing unrelated local changes under `proxy/bootstrap/src/main/resources/conf/*.yaml`
- Existing untracked `docs/proposals/`
If those unrelated files are included in the PR, they should be removed or split before merge review.
Verification:
- `./mvnw -pl infra/common -DskipITs -Dtest=GenericSchemaManagerTest,ShardingSphereSchemaIdentifierTest test -Pcheck -T1C`: exit 0
- `./mvnw spotless:apply -Pcheck -T1C`: exit 0
- `./mvnw checkstyle:check -Pcheck -T1C`: exit 0
Release Note / User Docs:
- Not required. This is an internal metadata consistency fix that restores expected behavior for existing PostgreSQL quoted uppercase object handling and does not add user-facing configuration, SQL syntax, API, migration, or operational guidance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org