kafka-1430; Purgatory redesign; patched by Guozhang Wang; reviewed by Jun Rao