Repository navigation
Fix RegionGroup limits for same-name tree and table databases - #18990
Open
d-wang-commit wants to merge 1 commit into
Open
d-wang-commit wants to merge 1 commit into
d-wang-commit wants to merge 1 commit into
Conversation
Use schema names to retain both models and count every database. Preserve audit database filtering and add focused unit coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When tree database
root.pgand table databasepgcoexist, their MTree entries share the internal pathroot.pg. Merging schemas by that path overwrites the table schema, leaving its maximum RegionGroup counts stale and undercounting databases when calculating other databases' limits.Key the lookup by
TDatabaseSchema.nameso both databases participate in adjustment. Explicitly exclude both audit database names during deletion to preserve the existing filtering behavior with the corrected keys.Tests
ClusterSchemaManagerTest#testAdjustMaxRegionGroupNumWithMixedModelsapplies the real adjustment plan and checks both maximum RegionGroup counts for every database as the database count grows from one to three (12 -> 6 -> 4).ConfigManagerDatabaseDeletionTestcovers table audit database deletion filtering.upstream/master.Side effects and risks
Correcting the database count may decrease other databases' calculated limits, while preserving already allocated RegionGroups. No serialization or protocol changes.
This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
ClusterSchemaInfo: retain both database models in schema lookups.ConfigManager: preserve audit database filtering.ClusterSchemaManagerTest: verify actual mixed-model limit recalculation and database counting.ConfigManagerDatabaseDeletionTest: cover table audit database deletion filtering.