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.
1. 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.
Comment From: yoav-steinberg
@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.
Comment From: oranagra
@antirez please take a look and advise what you think is right. Yoav will make a PR.