8 hours ago
- A critical issue was reported in Redis GitHub about the PSYNC2 replication protocol in Redis 4.0.
- PSYNC2 allows resynchronization with differences after failover and slave restart, but the restarting slave feature was unreliable.
- Two main problems: the feature was a last-minute addition not thoroughly scrutinized, and restoring full replication state after restart is complex.
- Bug #4483: After a slave restart, Lua scripts in the master replication backlog (EVALSHA) caused the slave to fail processing writes because the Lua scripting engine was flushed.
- The author rushed to fix the bug, but mistakenly omitted a commit in version 4.0.3, then released 4.0.4 with a fix that introduced a new bug (assert on duplicate script loading).
- The bug was finally fixed in 4.0.5, but the sequence of failures caused problems for users.
- Lessons learned: Redis 4.0 was released too early; rushed fixes need more careful checking; tests should cover PSYNC2 with Lua scripts.
- The author apologized and thanked contributors, especially @soloestoy.