Update the last_ts only when the batch is flushed.