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

Handle bloom object max allowed size limit, switch fp rate to f64 #18

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

KarthikSubbarao
Copy link
Member

@KarthikSubbarao KarthikSubbarao commented Oct 25, 2024

  • Implement a memory / size based limit per filter within a bloom object. This is a new module config: bf.bloom-memory-limit-per-filter.
    • This means every write operation (bloom object creation AND scale outs) that results in a new filter requires the new filter to be within allowed limits. If not, the write request is rejected with an error.
    • Similarly, any RDB Load operation also performs the same memory / size based limit check. RDB Load will fail if any filter within a bloom object has a size larger than what is allowed.
  • Switch fp_rate handling through out all occurrences from f32 to f64 to have a higher precision. The main reason for this is during scaling out, every new filter will have a smaller fp_rate (due to the TIGHTENING_RATIO) to maintain the overall fp_rate. We need to handle higher precision fp_rates with every new scale out and f64 handles this better.
  • defrag callback was updated to use the new config (bf.bloom-memory-limit-per-filter) to exempt defrag operations when over this limit.

…date defrag exemption logic and free effort logic

Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>
Copy link
Contributor

@zackcam zackcam left a comment

Choose a reason for hiding this comment

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

Just one small nit/question but lgtm!

Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>
@KarthikSubbarao KarthikSubbarao self-assigned this Oct 29, 2024
Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>
Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>
@KarthikSubbarao KarthikSubbarao merged commit 75fc3cc into valkey-io:unstable Oct 29, 2024
6 checks passed
KarthikSubbarao added a commit that referenced this pull request Oct 29, 2024
* Handle bloom object max allowed size limit, switch fp rate to f64, update defrag exemption logic and free effort logic

Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>

* Update error message and add unit test

Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>

* Rename config

Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>

* Rename configs

Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>

---------

Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>
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

Successfully merging this pull request may close these issues.

3 participants