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

undeclared keys in dragonfly #855

Open
kostasrim opened this issue Sep 4, 2024 · 2 comments
Open

undeclared keys in dragonfly #855

kostasrim opened this issue Sep 4, 2024 · 2 comments

Comments

@kostasrim
Copy link

kostasrim commented Sep 4, 2024

Hi there,

One (delete_job_by_digest.lua, or more) of your lua scripts are accessing keys without declaring them. May I ask you to:

  1. If you know that a script accesses specific sidekiq queues/ redis objects then declare them upfront ?
  2. If the script potentially accesses keys that you don't know priory then mark your scripts with
--!df flags=allow-undeclared-keys,disable-atomicity

Otherwise the execution of those scripts will be rejected by dragonfly. Mike (from sidekiq) also did the same thing. See the full thread here for more context dragonflydb/dragonfly#2442

@m62534
Copy link

m62534 commented Sep 13, 2024

I would also like to know if there is any way to avoid undeclared keys.
--allow-undeclared-keys flag would suck cuz of global lock and would have terrible performance on Dragonfly DB.

wonder if there is a similar way as this to achieve

@kostasrim
Copy link
Author

@m62534 undeclared keys are for cases df is not configured with lock_on_hashtags. It's good if they include allow-undeclared-keys for scripts may access keys that exist among different shards. However, with lock_on_hashtags things can further improve. The first one is a responsibility of the library (like this one). The second is something you as an operator need to do when launching a dragonfly instance. One is not mutually exclusive to the other so as long as both are included you can get the best of the both worlds. However if the operator does not both to use lock on hashtags, then without undeclared keys there will be problems.

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