wal: move record method to record.go