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

[Bug Report] Improve Initialization of filter rules in vttablet #596

Closed
earayu opened this issue Dec 10, 2024 · 0 comments
Closed

[Bug Report] Improve Initialization of filter rules in vttablet #596

earayu opened this issue Dec 10, 2024 · 0 comments
Assignees

Comments

@earayu
Copy link
Collaborator

earayu commented Dec 10, 2024

Overview of the Issue

Background

Upon the initial startup of vttablet, the function reloadRulesFromDatabase in databaseCustomRule is not invoked. Consequently, if SQL queries are received at this point, they will be executed directly due to the absence of loaded filter rules. This situation can lead to potential errors as the filter rules are not yet in place to regulate SQL query execution.

Proposal

To prevent such errors, it is imperative to adjust the initialization process to load the filter rules before the queryEngine starts serving requests. By ensuring the filter rules are loaded beforehand, we can safeguard against unauthorized SQL query execution and maintain data integrity.

Reproduction Steps

  1. create a filter
  2. shutdown wescale (vtgate & vttablet)
  3. start wescale again
  4. execute any SQL that should trigger the filter created in step (1). You will see filter is not triggered because filter is not loaded in vttablet's memory.
  5. wait for 30s
  6. execute the same SQL again, the filter will be triggered.

Binary Version

all versions

Operating System and Environment details

all

Log Fragments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants