CPC G06F 16/2358 (2019.01) [G06F 16/2365 (2019.01); G06F 16/2379 (2019.01)] | 18 Claims |
1. A method for replaying a log comprising:
obtaining, by a data node having a plurality of threads running therein, a plurality of logs including at least one transaction commit log and at least one page operation log, wherein each of the at least one transaction commit log comprises a transaction commit operation, and each of the at least one page operation log comprises one or more operations on one page;
replaying, by the data node, the at least one transaction commit log by using a first thread of the plurality of threads;
replaying, by the data node, the at least one page operation log by using at least one second thread of the plurality of threads, wherein all page operation logs that are in the at least one page operation log and that comprise an operation on a same page are replayed by using a same second thread; and
determining, by the data node, a maximum visible log sequence number (LSN), wherein the maximum visible LSN indicates a log replay progress;
wherein all transaction commit logs whose log sequence numbers (LSNs) are less than or equal to the maximum visible LSN in the at least one transaction commit log are replayed, and all page operation logs whose LSNs are less than or equal to the maximum visible LSN in the at least one page operation log are replayed; and
wherein a process in which the first thread replays the at least one transaction commit log is independent of a process in which the at least one second thread replays the at least one page operation log.
|