-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddl: fix placement rules compatibility with tiflash #22065
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some cases to placement_sql_test.go
to test if the placement rules generated by SQL are right in these scenarios:
- Whether the placement rules all contain "-engine=tiflash".
- When the user also defines "-engine=tiflash", the placement rules should only contain one "-engine=tiflash" constraint.
CONSTRAINTS='{"+zone=bj":1}' REPLICAS=2
, the extra count should also contain "-engine=tiflash" constraint. (Maybe?)
@djshow832 I can not add tests in Or maybe manual test in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create an issue for this problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first commit fixed that.
It is not convenient for a reviewer to find your first commit.
You can write: "Using GenTableRecordPrefix
instead of GenTablePrefix
can fix this problem."
Besides, is there any test for this change?
@wjhuang2016 I will try if |
You can do a manual test. Start a cluster to test it. |
A manual test is already done, of course. |
TiFlash will compare the the record prefix too. Signed-off-by: xhe <xw897002528@gmail.com>
Though the previous commit fixed the compatibility between tiflash and placement rules. But it is still not caompatible with the old `set tiflash replica` syntax. Thus this commit banned the usage and avoid using tiflash by appending a hidden label to filter tiflash instance. Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
/run-all-tests |
What problem does this PR solve?
Issue: close #22171
Problem Summary: When PD scheduels a partition to tiflash, TiFlash will validate the keyrange if there is a
_r
suffix. Using GenTableRecordPrefix instead of GenTablePrefix can fix this problem.But placement rules are not compatible with the old
set tiflash replica
syntax, so the second commit simply forbids using+engine=tiflash
, and will add-engine=tiflash
to every rule to avoid scheduels to tiflash instance. Maybe that will be reverted in the future.Check List
Tests
Release note