Merge log for fast recovery after system failure:
1. At the beginning of a merge, a file named “merge.log” is created.
2. All files’ names involved in this merge are written into “merge.log”.
3. A line “merge start” is written into “merge.log” indicating that all files 
in this merge are listed above.
4. When a time series “ts_i” begins to merge, a line “ts_i start” is written 
into “merge.log” indicating that “ts_i” begin to merge.
5. When a time series “ts_i” ends merging, for each sequence file “seqFile_j”  
that is merged during the processing of the timeseries, a line “seqFile_j end 
{current length of seqFile_j’s temp file}” is recorded,and a line “ts_i end” is 
written into “merge.log” indicating that “ts_i” is merged and the above file 
size changes are valid now.
6. When all time series “all ts end” is written indicating no more time series 
should be merged and all temp files are valid, and this time series can be 
skipped in recovery.
7. When a sequential file “seqFile_j" starts to merge with its temp file, a 
line “seqFile_j start {current length of seqFile_j}” is written .
8. When a sequential file “seqFile_j" ends to merge with its temp file, a line 
“seqFile_j end” is written. So this sequential file can be skipped in recovery.
9. When all sequential files have merged with its temp files, a final line 
“merge end” is written.
10. When all unsequential files are removed, “merge.log” is also removed.

Reply via email to