get last record
fix uninit last record
fix safe transaction
commit and begin
add cnt in writer