added ftruncate after redo replay