Skip to content
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

Support VStream with keyspaces_to_watch #8988

Merged
merged 9 commits into from
Oct 27, 2021

Conversation

mattlord
Copy link
Contributor

@mattlord mattlord commented Oct 13, 2021

Description

In order to safely support the VStream api against VTGates running with the -keyspaces_to_watch flag we needed to add a read-only VTTopo server interface to ensure that no changes are made to the topology from the (potentially) explicitly limited view of the topology provided via this vtgate.

Related Issue(s)

Checklist

  • Should this PR be backported? No. IMO this should bake in 13.0-snapshot
  • Tests were added
  • Documentation is not required (we never documented that these two features did NOT work together)

@mattlord mattlord requested a review from deepthi October 13, 2021 06:09
@mattlord mattlord added Type: Bug Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: VReplication labels Oct 13, 2021
@mattlord mattlord force-pushed the Keyspaces2WatchVStream branch 2 times, most recently from db8bce1 to 78532c7 Compare October 13, 2021 07:07
@mattlord
Copy link
Contributor Author

mattlord commented Oct 13, 2021

The new vstream_with_keyspaces_to_watch test is failing as expected: https://github.com/vitessio/vitess/pull/8988/checks?check_run_id=3879443572

...
I1013 07:14:19.558124   18763 vstream_test.go:125] 2021-10-13 07:14:19.558123471 +0000 UTC m=+39.257232583:: remote error: Code: UNKNOWN
173
rpc error: code = Unknown desc = cannot access underlying topology server when keyspace filtering is enabled
...

@mattlord mattlord changed the title Support VStream with keyspaces_to_watch Set Support VStream with keyspaces_to_watch Oct 13, 2021
@mattlord mattlord force-pushed the Keyspaces2WatchVStream branch 18 times, most recently from b81a55e to fa7b418 Compare October 18, 2021 22:52
@mattlord mattlord marked this pull request as ready for review October 18, 2021 23:59
@systay systay removed their request for review October 22, 2021 08:16
@mattlord mattlord removed the request for review from harshit-gangal October 22, 2021 14:40
Signed-off-by: Matt Lord <mattalord@gmail.com>
@mattlord mattlord force-pushed the Keyspaces2WatchVStream branch 3 times, most recently from ee1bae5 to ad6c19e Compare October 22, 2021 20:48
…s to underlying topo.Server

Signed-off-by: Matt Lord <mattalord@gmail.com>
Copy link
Contributor

@sougou sougou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's important that the we don't have dummy implementations of SetReadOnly in the servers. This can become a source of confusion in the future if someone accidentally uses one of these connections as an interface, and the implementation doesn't enforce it.

If explicit casting or the interface approach is harder, I'd recommend changing SetReadOnly to return an error, and we can have these underlying implementations fail with a "not supported" error.

@mattlord
Copy link
Contributor Author

I think it's important that the we don't have dummy implementations of SetReadOnly in the servers. This can become a source of confusion in the future if someone accidentally uses one of these connections as an interface, and the implementation doesn't enforce it.

If explicit casting or the interface approach is harder, I'd recommend changing SetReadOnly to return an error, and we can have these underlying implementations fail with a "not supported" error.

Good points. I'll look into this next. Thanks!

@mattlord
Copy link
Contributor Author

@mattlord mattlord requested a review from sougou October 25, 2021 19:42
@mattlord mattlord force-pushed the Keyspaces2WatchVStream branch 6 times, most recently from d22f2aa to 838d436 Compare October 25, 2021 21:03
Instead handle this entirely within the generic topo Server implementation

Signed-off-by: Matt Lord <mattalord@gmail.com>
@mattlord mattlord removed the request for review from rafael October 26, 2021 23:08
Copy link
Contributor

@sougou sougou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM too. Nice work!

@deepthi deepthi merged commit d080992 into vitessio:main Oct 27, 2021
@deepthi deepthi deleted the Keyspaces2WatchVStream branch October 27, 2021 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: VReplication Type: Bug Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants