-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Use a truly random Destination for DestinationAnyShard #4522
Use a truly random Destination for DestinationAnyShard #4522
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.
LGTM
This is great! We've noticed in this in the past and wanted to fix it |
However, tests are going to fail because they are expecting to be in shard one. One approach that we discussed to address this is that the shard "picker" should be an interface. That way we can use random in the real one, but a mocked one that always picks the first shard that is used in the context of the tests. |
We JDer use this function for pined table that pined to the first shard. |
Signed-off-by: Aaron Young <[email protected]>
2f123e8
to
87a9adf
Compare
That's... weird? Why not use a separate keyspace? |
Do you have this code in your branch: https://github.com/vitessio/vitess/blob/master/go/vt/vtgate/planbuilder/from.go#L193. If so, pinned tables should be routed to the shards they belong to. |
@xhh1989 Can you confirm that you have the code I pointed at? If so, this change should not affect you. |
we have a plan upgrade to version 3.0, there a big difference between JD version and 3.0, we add a single shard table feature based on version 2.1 and that single shard table like pined table but pined on the first shard, use |
Signed-off-by: Aaron Young [email protected]