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

Module auxiliary data broken when using AOF and aof-use-rdb-preamble set to no #7350

Open
yoav-steinberg opened this issue May 31, 2020 · 2 comments

Comments

@yoav-steinberg
Copy link
Contributor

yoav-steinberg commented May 31, 2020

Module auxiliary data isn't written to AOF files when there's no rdb-preamble to the AOF.
This means modules can lose their aux data.
Possible solutions:

  1. If a loaded module implements the aof_rewrite callback then implicitly ignore the aof-use-rdb-preamble config option and treat it as yes all the time.
  2. Add another callback to modules that's called before/after the all the aof_rewrite callbacks for all the keys. In this callback the module can write a set of commands to the aof to store initialize whatever aux data it needs. This can also be done by extending the when option of the aux_load and aux_save callbacks to indicate REDISMODULE_AUX_BEFORE_AOFRW and REDISMODULE_AUX_AFTER_AOFRW.
@yoav-steinberg
Copy link
Contributor Author

@oranagra's comment:

in 1 i guess the conditions are either:
module doen't implement the aof_rewrite callback at all.
it does implement the aof_rewrite, but also implements the aux_save callback.
i.e. in both cases we may want to switch to preamble

Sounds right. Although I think 2 might be cleaner.

yoav-steinberg added a commit to RedisJSON/RedisJSON that referenced this issue May 31, 2020
@oranagra
Copy link
Member

@antirez please take a look and advise what you think is right. Yoav will make a PR.

@yossigo yossigo mentioned this issue Dec 8, 2020
52 tasks
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