Why does redis need to observe whether the server is currently executing the two commands bgsave or bgrewriteaof when it expands the hash table?

Comment From: enjoy-binbin

bgsave or bgrewriteaof, they both need to fork a child process to handle the work we rely on copy on write, so it is better not to do the rehash and mess up the memory