US 12,093,241 B2
Method for replaying log on data node, data node, and system
Qiong Zhang, Shanghai (CN); Xuli Li, Shanghai (CN); Heting Li, Shenzhen (CN); Geyong Yao, Shanghai (CN); and Xiang Hu, Shenzhen (CN)
Assigned to HUAWEI TECHNOLOGIES CO., LTD., Shenzhen (CN)
Filed by HUAWEI TECHNOLOGIES CO., LTD., Guangdong (CN)
Filed on Dec. 28, 2022, as Appl. No. 18/147,507.
Application 18/147,507 is a continuation of application No. PCT/CN2021/103376, filed on Jun. 30, 2021.
Claims priority of application No. 202010615640.9 (CN), filed on Jun. 30, 2020.
Prior Publication US 2023/0137119 A1, May 4, 2023
Int. Cl. G06F 16/23 (2019.01)
CPC G06F 16/2358 (2019.01) [G06F 16/2365 (2019.01); G06F 16/2379 (2019.01)] 18 Claims
OG exemplary drawing
 
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.