fix red-black bug

migrate from nginx red-black tree