Intro

The main issue we have is that currently call is in charge of incr/decr of server.in_nested_call (soon to be server.execution_nesting) and that AOF calls to proc directly, and doesn't even call afterCommand. The result is that while loading AOF, all the PEJs will be accumulated and will only be executed after the first non-AOF command

Other issues

In addition to the above: 1. The is a difference between startup AOF and DEBUG LOADAOF: In the latter server.execution_nesting is 1 throughout the loading process, and in the former, it's 0. We need to see if it has any adverse effects. 2. if we have MULTI/EXEC inside an AOF, PEJ will be executed after each command in the transaction (AOF calls proc but execCommand calls call, incrementing execution_nesting from 0 to 1 and then from 1 to 0 in afterCommand), breaking the contract of PEJs

To do

  • We need to define the desired behavior and to add more tests that handle PEJs, propagation, and AOF
  • we need to decide if modules will be allowed to register PEJ from AOF loading, and from replicas.