Open ronghuaihai opened 2 years ago
@vitessio/query-serving
Thank you for the issue, @ronghuaihai ! You're correct, there's no documentation on this feature today. The related source code is here: https://github.com/vitessio/vitess/tree/main/go/vt/vttablet/tabletserver/rules and here: https://github.com/vitessio/vitess/tree/main/go/vt/vttablet/customrule
So I can see that this is configured on vttablets via a file containing a JSON document which can be watched for changes and auto-reloaded OR the rules can be stored in the topo server, with the contents currently loaded in memory shown at the /debug/query_rules
endpoint. And we can see some samples in the test: https://github.com/vitessio/vitess/blob/main/go/vt/vttablet/tabletserver/rules/rules_test.go#L135-L144 And the key fields here: https://github.com/vitessio/vitess/blob/main/go/vt/vttablet/tabletserver/rules/rules.go#L274-L284
But we clearly need some docs. 🙂
Also, just FYI you have the ability to do this directly in the MySQL instances too: https://dev.mysql.com/doc/refman/8.0/en/rewriter-query-rewrite-plugin.html
You could rewrite the problematic queries to select "this query is not allowed" as blocked
. There's also the MySQL Firewall plugin but that's not FOSS.
Hello @mattlord, I have searched and found Query blacklisting
is not available in recent doc anymore. Thus I think this issue is not relevant anymore, isnt it?
@mhmohona it's no longer mentioned in the docs, but the feature still exists w/o any docs.
In that case, as a doc contributor, is there anything I can do?
Question
i can not find any examples to introduce query blacklisting in official document . How to use query blacklisting ?if DBAs find slowly sql , how to blocking or forbbiden application querys that affect performance of vitess by query sql content or source ?