US 12,436,847 B2
Log replay methods and apparatuses, data recovery methods and apparatuses, and electronic devices
Yingying Yao, Beijing (CN); Hao Liu, Beijing (CN); and Fusheng Han, Beijing (CN)
Assigned to Beijing OceanBase Technology Co., Ltd., Beijing (CN)
Filed by Beijing Oceanbase Technology Co., Ltd., Beijing (CN)
Filed on Oct. 26, 2023, as Appl. No. 18/494,935.
Claims priority of application No. 202211318230.3 (CN), filed on Oct. 26, 2022.
Prior Publication US 2024/0143456 A1, May 2, 2024
Int. Cl. G06F 16/00 (2019.01); G06F 11/14 (2006.01); G06F 16/13 (2019.01); G06F 16/14 (2019.01); G06F 16/21 (2019.01); G06F 16/215 (2019.01); G06F 16/23 (2019.01); G06F 16/2457 (2019.01); G06F 16/25 (2019.01); G06F 16/27 (2019.01); G06F 16/28 (2019.01)
CPC G06F 11/1469 (2013.01) [G06F 16/13 (2019.01); G06F 16/148 (2019.01); G06F 16/213 (2019.01); G06F 16/215 (2019.01); G06F 16/2358 (2019.01); G06F 16/24578 (2019.01); G06F 16/254 (2019.01); G06F 16/27 (2019.01); G06F 16/285 (2019.01); G06F 2201/80 (2013.01)] 8 Claims
OG exemplary drawing
 
1. A computer-implemented method for replaying logs, comprising:
classifying a plurality of logs to be replayed into a plurality of log queues, wherein the plurality of logs each comprises a transaction number and belongs to a log stream, wherein each one of the plurality of log queues comprises logs that belong to a same log stream, and wherein the logs with a same transaction number are classified into a same log queue;
in response to determining that the plurality of logs belong to two or more log streams, sending the plurality of log queues to a global replay queue in an interleaving manner, wherein log queues adjacent to each other in the global replay queue belong to different log streams;
allocating one or more replay threads to the log queues based on rankings of the log queues in the global replay queue, wherein the one or more replay threads are configured to replay one or more current log queues of the log queues;
in response to identifying an error of a current log queue of the one or more current log queues in a replay process, allocating a replay thread of the one or more replay threads allocated to the current log queue to a log queue that immediately follows the current log queue in the global replay queue;
determining whether the error is a temporary error or a permanent error, wherein the temporary error is an error that is automatically eliminated when the replay process is retried, the permanent error is not automatically eliminated when the replay process is retried;
in response to determining that the error is a temporary error, moving the current log queue to a rear of the global replay queue; and
in response to determining that the error is a permanent error, removing the current log queue from the global replay queue.