I'm running a daily maintenance job for Resetting and Syncing up a set of related flat file database.
Problem Statement: In case when the maintenance application dumps in between then, I start over from the beginning instead of continuing from where I left.
Tried Solution: To fix the issue, I started to log the processed offset to a file. This way, when I return back I can check my completion status before starting over from the begining.
Issue: Logging the offset for every record being processed drastically increases the processing time.
Can Someone suggest a better way to handle this situation?
Yes. Add a counter to your program, Every 1000 blocks, write your information to the log file. That will reduce your logging IO by 3 orders of magnitude, at the cost of having to redo up to 1000 block in the event of a restart.