IP Library Granted Patent US 12675376
Granted Patent B2
US 12675376 · App. 18/607,307 · Granted Jul 7, 2026

Automatic recovery of nodes with corrupted logs in a consensus protocol

Inventors: Saeed Abedigozalabad (San Mateo, CA); Thakur Vishwesh Singh (Bengaluru, IN); Vijay Sridharan (Santa Clara, CA); Nilesh Choudhury (Redwood City, CA); Mehrnoosh Raoufi (Pittsburgh, PA)
Assignee: Oracle International Corporation
G06F11/1658G06F2201/805
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12675376
App. No.
18/607,307
Granted
Jul 7, 2026
Kind
B2
Abstract

The illustrative embodiments provide a consensus protocol with recovery of corrupted log entries within a log stored at a server within a cluster. Each server stores metadata comprising a last log index and a last log term of the copy of the log at the server. In response to a server having one or more corrupted log entries, the server makes a backup of the log and truncates log entries. The server then converts to a rescuee role. When an append entries call is received, the server uses the last log index and last log term from the metadata to determine whether the append entries call is received from a valid leader and can be appended to the truncated log. The server then applies one or more append entries calls to recover the corrupted log entries. Once the corrupted log entries are recovered, the server converts to the follower role.

Claims (69)

1 . A method comprising:

performing, by a particular server in a replication group of servers, a recovery of data corruption of one or more log entries within a log, wherein:

each server within the replication group of servers stores a respective copy of the log,

the replication group of servers includes a leader server in a leadership role and one or more follower servers in a follower role,

the leader server is configured to replicate log changes to the one or more follower servers,

the particular server stores metadata comprising a last log index and a last log term of a last entry appended to the copy of the log at the particular server prior to the recovery of the one or more log entries, and

performing the recovery of the one or more log entries comprises:

truncating the one or more log entries from the copy of the log at the particular server to form a truncated log; and

applying one or more append entries calls received from the leader server to append log entries to the truncated log based on the last log index and the last log term in the metadata,

wherein the method is performed by one or more computing devices.

2 . The method of claim 1 , wherein:

performing the recovery of the one or more log entries further comprises converting to a rescuee role, and

the particular server does not start a leadership election or participate in a leadership election while in the rescuee role.

3 . The method of claim 2 , wherein performing the recovery of the one or more log entries further comprises converting the particular server from the rescuee role to the follower role in response to the copy of the log at the particular server being recovered.

4 . The method of claim 1 , wherein applying one or more append entries calls comprises:

in response to receiving a given append entries call, determining that an index associated with the given append entries call is more advanced than the last log index in the metadata and a term associated with the given append entries call is at least as advanced as the last log term in the metadata; and

in response to the index associated with the given append entries call being more advanced than the last log index in the metadata and the term associated with the given append entries call being at least as advanced as the last log term in the metadata, applying the given append entries call.

5 . The method of claim 4 , wherein applying one or more append entries calls further comprises:

in response to receiving a given append entries call, determining that the last index or the last term in the metadata is more advanced than the index or term associated with the given append entries call; and

in response to the last index or the last term in the metadata being more advanced than the index or term associated with the given append entries call, rejecting the given append entries call.

6 . The method of claim 1 , wherein truncating the one or more log entries from the copy of the log at the particular server comprises:

identifying a first corrupted log entry in the copy of the log at the particular server; and

truncating the first corrupted log entry and each subsequent log entry from the copy of the log at the particular server to form the truncated log.

7 . The method of claim 6 , wherein applying one or more append entries calls comprises:

receiving a given append entries call from the leader server, wherein the given append entries call includes a range of new log entries from a beginning index to an ending index; and

in response to the beginning index being less than or equal to a last index in the truncated log plus one, applying the given append entries call.

8 . The method of claim 6 , wherein applying one or more append entries calls further comprises:

receiving a given append entries call from the leader server, wherein the given append entries call includes a range of new log entries from a beginning index to an ending index;

in response to the beginning index being greater than a last index in the truncated log plus one, sending the last index in the truncated log to the leader server;

receiving a subsequent append entries call from the leader server, wherein the subsequent append entries call includes a range of new log entries based on the last index in the truncated log; and

applying the subsequent append entries call.

9 . The method of claim 6 , wherein the first corrupted log entry is identified based on at least one of:

a checksum of the first corrupted log entry, or

a length of the first corrupted log entry.

10 . The method of claim 1 , wherein performing the recovery of the one or more log entries comprises creating a backup of persisted log entries in the copy of the log at the particular server.

11 . One or more non-transitory storage media storing instructions which, when executed by one or more computing devices, cause:

performing, by a particular server in a replication group of servers, a recovery of data corruption of one or more log entries within a log, wherein:

each server within the replication group of servers stores a respective copy of the log,

the replication group of servers includes a leader server in a leadership role and one or more follower servers in a follower role,

the leader server is configured to replicate log changes to the one or more follower servers,

the particular server stores metadata comprising a last log index and a last log term of a last entry appended to the copy of the log at the particular server prior to the recovery of the one or more log entries, and

performing the recovery of the one or more log entries comprises:

truncating the one or more log entries from the copy of the log at the particular server to form a truncated log; and

applying one or more append entries calls received from the leader server to append log entries to the truncated log based on the last log index and the last log term in the metadata.

12 . The one or more non-transitory storage media of claim 11 , wherein:

performing the recovery of the one or more log entries further comprises converting to a rescuee role, and

the particular server does not start a leadership election or participate in a leadership election while in the rescuee role.

13 . The one or more non-transitory storage media of claim 12 , wherein performing the recovery of the one or more log entries further comprises converting the particular server from the rescuee role to the follower role in response to the copy of the log at the particular server being recovered.

14 . The one or more non-transitory storage media of claim 11 , wherein applying one or more append entries calls comprises:

in response to receiving a given append entries call, determining that an index associated with the given append entries call is more advanced than the last log index in the metadata and a term associated with the given append entries call is at least as advanced as the last log term in the metadata; and

in response to the index associated with the given append entries call being more advanced than the last log index in the metadata and the term associated with the given append entries call being at least as advanced as the last log term in the metadata, applying the given append entries call.

15 . The one or more non-transitory storage media of claim 14 , wherein applying one or more append entries calls further comprises:

in response to receiving a given append entries call, determining that an index associated with the given append entries call is more advanced than the last log index in the metadata and a term associated with the given append entries call is at least as advanced as the last term in the metadata; and

in response to the last log index or the last term in the metadata being more advanced than the index or term associated with the given append entries call, rejecting the one or more append entries call.

16 . The one or more non-transitory storage media of claim 11 , wherein truncating the one or more log entries from the copy of the log at the particular server comprises:

identifying a first corrupted log entry in the copy of the log at the particular server; and

truncating the first corrupted log entry and each subsequent log entry from the copy of the log at the particular server to form the truncated log.

17 . The one or more non-transitory storage media of claim 16 , wherein applying one or more append entries calls comprises:

receiving a given append entries call from the leader server, wherein the given append entries call includes a range of new log entries from a beginning index to an ending index; and

in response to the beginning index being less than or equal to a last index in the truncated log plus one, applying the given append entries call.

18 . The one or more non-transitory storage media of claim 16 , wherein applying one or more append entries calls further comprises:

receiving a given append entries call from the leader server, wherein the given append entries call includes a range of new log entries from a beginning index to an ending index;

in response to the beginning index being greater than a last index in the truncated log plus one, sending the last index in the truncated log to the leader server;

receiving a subsequent append entries call from the leader server, wherein the subsequent append entries call includes a range of new log entries based on the last index in the truncated log; and

applying the subsequent append entries call.

19 . The one or more non-transitory storage media of claim 16 , wherein the first corrupted log entry is identified based on at least one of:

a checksum of the first corrupted log entry, or

a length of the first corrupted log entry.

20 . The one or more non-transitory storage media of claim 11 , wherein performing the recovery of the one or more log entries comprises creating a backup of persisted log entries in the copy of the log at the particular server.