• YaacovHazan's avatar
    Refactory fork child related infra, Unify child pid · f9dacf8a
    YaacovHazan authored
    This is a refactory commit, isn't suppose to have any actual impact.
    it does the following:
    - keep just one server struct fork child pid variable instead of 3
    - have one server struct variable indicating the purpose of the current fork
      child.
    - redisFork is now responsible of updating the server struct with the pid,
      which means it can be the one that calls updateDictResizePolicy
    - move child info pipe handling into redisFork instead of having them
      repeated outside
    - there are two classes of fork purposes, mutually exclusive group (AOF, RDB,
      Module), and one that can create several forks to coexist in parallel (LDB,
      but maybe Modules some day too, Module API allows for that).
    - minor fix to killRDBChild:
      unlike killAppendOnlyChild and TerminateModuleForkChild, the killRDBChild
      doesn't clear the pid variable or call wait4, so checkChildrenDone does
      the cleanup for it.
      This commit removes the explicit calls to rdbRemoveTempFile, closeChildInfoPipe,
      updateDictResizePolicy, which didn't do any harm, but where unnecessary.
    f9dacf8a
replication.c 137 KB