detect dirty ringfile
avoid mysql_helper crash
add ringfile_reset