Transaction log layout for efficient reclamation and recovery
First Claim
1. A method comprising:
- receiving at a storage system an input/output (I/O) request, wherein the storage system includes a persistent memory coupled to a central processor (CPU) and one or more storage devices;
associating a transaction with the I/O request;
allocating a circular log from the persistent memory to a first finite state machine (FSM) for processing the transaction, the first FSM associated with a token identifier (ID);
logging a start entry in the circular log;
in response to processing the transaction, recording one or more entries to the circular log, each recorded entry including a sequence number and a token ID field;
in response to a crash of the storage system, scanning the recorded entries of the circular log to determine whether the first FSM is active at a time of the crash; and
in response to determining that the first FSM is active at the time of the crash, replaying the recorded entries of the circular log having the token ID as a value of the token ID field.
0 Assignments
0 Petitions
Accused Products
Abstract
A layout of a transaction log enables efficient logging of metadata into entries of the log, as well as efficient reclamation and recovery of the log entries by a volume layer of a storage input/output (I/O) stack executing on one or more nodes of a cluster. The transaction log is illustratively a two stage, append-only logging structure, wherein the first level is non-volatile random access memory (NVRAM) embodied as a NVlog and the second stage is disk, e.g., solid state drive (SSD). During crash recovery, the log entries are examined for consistency and scanned to identify those entries that have completed and those that are active, which require replay. The log entries are walked from oldest to newest (using sequence numbers) searching for the highest sequence number. Partially complete log entries (e.g., log entries in-progress when a crash occurs) may be discarded for failing a checksum (e.g., a CRC error). Old value/new value logs may be used to implement roll-forward or roll-back semantics to replay the log entries and fix any on-disk data structures, first from NVRAM and then from on-disk logs.
65 Citations
20 Claims
-
1. A method comprising:
-
receiving at a storage system an input/output (I/O) request, wherein the storage system includes a persistent memory coupled to a central processor (CPU) and one or more storage devices; associating a transaction with the I/O request; allocating a circular log from the persistent memory to a first finite state machine (FSM) for processing the transaction, the first FSM associated with a token identifier (ID); logging a start entry in the circular log; in response to processing the transaction, recording one or more entries to the circular log, each recorded entry including a sequence number and a token ID field; in response to a crash of the storage system, scanning the recorded entries of the circular log to determine whether the first FSM is active at a time of the crash; and in response to determining that the first FSM is active at the time of the crash, replaying the recorded entries of the circular log having the token ID as a value of the token ID field. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A system comprising:
-
a storage array having one or more storage devices; and a node having a central processor (CPU) connected to a memory, a persistent memory and the storage array, the CPU configured to execute one or more processes stored in the memory, the one or more processes configured to; receive at a storage system an input/output (I/O) request; associate a transaction with the I/O request; allocate a circular log from the persistent memory to a first finite state machine (FSM) for processing the transaction, the first FSM associated with a token identifier (ID); log a start entry in the circular log; in response to processing the transaction, record one or more entries to the circular log, each recorded entry including a sequence number and a token ID field; in response to a crash of the storage system, scan the recorded entries of the circular log to determine whether the first FSM is active at a time of the crash; and in response to determining that the first FSM is active at the time of the crash, replay the recorded entries of the circular log having the token ID as a value of the token ID field. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19)
-
-
20. A non-transitory computer readable medium including program instructions for execution on one or more processors, the program instructions configured to:
-
implement a storage input/output (I/O) stack that operates with a persistent memory coupled to the one or more processors and with one or more solid state drives (SSDs); receive an I/O request; associate a transaction with the I/O request; allocate a circular log from the persistent memory to a finite state machine (FSM) for processing the transaction, the FSM associated with a token identifier (ID); log a start entry in the circular log; in response to processing the transaction, record one or more entries to the circular log, each recorded entry including a sequence number and a token ID field; in response to a crash of the storage I/O stack, scan the recorded entries of the circular log to determine whether the FSM is active at a time of the crash; and in response to determining that the FSM is active at the time of the crash, replay the recorded entries of the circular log having the token ID as a value of the token ID field.
-
Specification