fix(go-client): Changed the validation logic for new configuration during queryconfig operation #2287
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.
What problem does this PR solve?
In the current code, after querying the configuration, there is a check on the new partition count, which must be either equal to, double, or half of the previous count.
incubator-pegasus/go-client/pegasus/table_connector.go
Lines 286 to 288 in e42f1a6
However, in certain scenarios, when dealing with partitions that consume excessive disk space, we may manually split a single partition into multiple partitions, potentially increasing the partition count by a factor of 8 or more. This is typically done by performing multiple split operations offline and reconstructing the data on another cluster, with metaproxy used to ensure seamless traffic switching. When we modify the meta address in the table's metaproxy, an update config is triggered and the partition count is found to have increased multiple times.
Therefore, when updating the configuration, we do not require the new partition count to be related to the previous one. The previous validation logic becomes too restrictive and incorrect.
What is changed and how does it
This PR removes the check that requires the new partition count to be equal to, double, or half of the old one. Instead, it only checks whether the new partition count is valid (greater than or equal to 4 and is a power of 2).
Tests