[XAPID-377] Fixed a bug in crash recovery and how we write to a file
2 files changed