Fix restore_all leveldb iter error; Optimize connection