Re: Bad Rust code was the problem...
It was originally PHP, then LuaJIT - CloudFlare were having to improve the LuaJIT compiler to keep it (thier business) running.
There was no re-write - the existing solution did not scale any further and they had significant internal experience in Rust so went with what they knew for v2.
v1 is still in the wild - it took suffered from this database issue, however it failed silently rather than taking out the process. This led to much higher traffic onto client services as bots were able to make it through.
Somehow their internal processes missed this obvious code smell - given the things rust does protect from, imagine the issues they might have had with the same level of due diligence applied to C code...