merge and log compaction