• chenyang8094's avatar
    Always create base AOF file when redis start from empty. (#10102) · e9bff797
    chenyang8094 authored
    
    
    Force create a BASE file (use a foreground `rewriteAppendOnlyFile`) when redis starts from an
    empty data set and  `appendonly` is  yes.
    
    The reasoning is that normally, after redis is running for some time, and the AOF has gone though
    a few rewrites, there's always a base rdb file. and the scenario where the base file is missing, is
    kinda rare (happens only at empty startup), so this change normalizes it.
    But more importantly, there are or could be some complex modules that are started with some
    configuration, when they create persistence they write that configuration to RDB AUX fields, so
    that can can always know with which configuration the persistence file they're loading was
    created (could be critical). there is (was) one scenario in which they could load their persisted data,
    and that configuration was missing, and this change fixes it.
    
    Add a new module event: REDISMODULE_SUBEVENT_PERSISTENCE_SYNC_AOF_START, similar to
    REDISMODULE_SUBEVENT_PERSISTENCE_AOF_START which is async.
    Co-authored-by: default avatarOran Agra <oran@redislabs.com>
    e9bff797
redismodule.h 76.9 KB