wesql / wescale

WeScale is a Modern MySQL proxy that supports read-write-split, read-after-write-consistency, load balancing and OnlineDDL.
Apache License 2.0
196 stars 8 forks source link

feat: add allow list for wescale filter #504

Closed newborn22 closed 1 month ago

newborn22 commented 1 month ago

Related Issue(s) & Descriptions

503

Checklist

ccoVeille commented 1 month ago

If I may, whitelist -> allow list

newborn22 commented 1 month ago

Based on the wescale filter framework, a new action called "SKIP_FILTER" has been added. Its actionArgs is skip_filter_regex, where the user can input a regular expression to match filter names. In the list of filters matched by a certain SQL, if a filter appears after this skip filter and its name matches the regular expression, that filter will be skipped.

Specifically, suppose the list of filters matched by an SQL is: [filter1, mySkipFilter, filter2, filter3, filter4], and mySkipFilter's parameter is skip_filter_regex="filter1|filter2|.*4". For this SQL, filter2 and filter4 will be skipped. Since filter1 is before mySkipFilter (i.e., has a higher priority than mySkipFilter), it will not be skipped.

This implementation allows users to achieve different functionalities by configuring different SQL patterns, skip_filter_regex, and filter priorities.

Additionally, when the system starts, a default skipFilter with priority value 0is created, which matches the mysql.wasm_binary table and will skip all filters.

newborn22 commented 1 month ago

Based on the wescale filter framework, a new action called "SKIP_FILTER" has been added. Its actionArgs is skip_filter_regex, where the user can input a regular expression to match filter names. In the list of filters matched by a certain SQL, if a filter appears after this skip filter and its name matches the regular expression, that filter will be skipped.

Specifically, suppose the list of filters matched by an SQL is: [filter1, mySkipFilter, filter2, filter3, filter4], and mySkipFilter's parameter is skip_filter_regex="filter1|filter2|.*4". For this SQL, filter2 and filter4 will be skipped. Since filter1 is before mySkipFilter (i.e., has a higher priority than mySkipFilter), it will not be skipped.

This implementation allows users to achieve different functionalities by configuring different SQL patterns, skip_filter_regex, and filter priorities.

Additionally, when the system starts, a default skipFilter with priority value 0is created, which matches the mysql.wasm_binary table and will skip all filters.

After discussion, we remove built-in filters in newly commit.