Method and system for forward reference logging in a persistent datastore
First Claim
Patent Images
1. A method of recovering persisted data, comprising:
- at an electronic system with one or more processors and memory;
generating a first log entry associated with first write data to be stored in a persistent data store, wherein the first log entry includes information sufficient to replay a transaction corresponding to the first write data;
generating a forward reference identifier for a second record of a plurality of sequential records that is different from a first record of the plurality of sequential records, wherein each respective record of the plurality of sequential records includes a respective log entry, write data that was not yet stored in the persistent data store when said log entry was generated, a respective reference identifier for the respective record, a forward reference identifier for a next record in the sequence, and a pointer to a next record in the sequence;
generating the first record including the first log entry, the first write data, the forward reference identifier for the second record, and a pointer to the second record;
performing a single write operation that includes writing the first record to the persistent datastore, wherein;
the pointer to the second record is a pointer to a location in the persistent data store allocated for writing the second record prior to writing the first record and the second record to the persistent datastore, andthe forward reference identifier for the second record is different from the pointer to the second record; and
performing a recovery operation that includes;
reading the first log entry;
using the pointer to the second record to read a second log entry;
determining whether the forward reference identifier for the second record matches a second reference identifier in the second record;
in accordance with a determination that the forward reference identifier for the second record matches the second reference identifier in the second record, replaying a transaction associated with the second log entry; and
in accordance with a determination that the forward reference identifier for the second record does not match the second reference identifier in the second record, stopping the recovery operation.
3 Assignments
0 Petitions
Accused Products
Abstract
The embodiments described herein are methods and systems to enhance the reliability and performance of a persistent datastore (e.g., non-volatile memory such as flash memory). The method includes generating a log entry associated with first write data. The method also includes generating a first record including the log entry, the first write data, and pointer to a second record different from the first record. The method further includes performing a single write operation that includes writing the first record to the persistent datastore.
-
Citations
19 Claims
-
1. A method of recovering persisted data, comprising:
- at an electronic system with one or more processors and memory;
generating a first log entry associated with first write data to be stored in a persistent data store, wherein the first log entry includes information sufficient to replay a transaction corresponding to the first write data; generating a forward reference identifier for a second record of a plurality of sequential records that is different from a first record of the plurality of sequential records, wherein each respective record of the plurality of sequential records includes a respective log entry, write data that was not yet stored in the persistent data store when said log entry was generated, a respective reference identifier for the respective record, a forward reference identifier for a next record in the sequence, and a pointer to a next record in the sequence; generating the first record including the first log entry, the first write data, the forward reference identifier for the second record, and a pointer to the second record; performing a single write operation that includes writing the first record to the persistent datastore, wherein; the pointer to the second record is a pointer to a location in the persistent data store allocated for writing the second record prior to writing the first record and the second record to the persistent datastore, and the forward reference identifier for the second record is different from the pointer to the second record; and performing a recovery operation that includes; reading the first log entry; using the pointer to the second record to read a second log entry; determining whether the forward reference identifier for the second record matches a second reference identifier in the second record; in accordance with a determination that the forward reference identifier for the second record matches the second reference identifier in the second record, replaying a transaction associated with the second log entry; and in accordance with a determination that the forward reference identifier for the second record does not match the second reference identifier in the second record, stopping the recovery operation. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
- at an electronic system with one or more processors and memory;
-
10. An electronic system, comprising:
-
one or more processors; and memory storing one or more programs to be executed by the one or more processors, the one or more programs comprising instructions for; generating a first log entry associated with first write data to be stored in a persistent data store, wherein the first log entry includes information sufficient to replay a transaction associated with the first write data; generating a forward reference identifier for a second record of a plurality of sequential records that is different from a first record of the plurality of sequential records, wherein each respective record of the plurality of sequential records includes a respective log entry, write data that was not yet stored in the persistent data store when said log entry was generated, a respective reference identifier for the respective record, a forward reference identifier for a next record in the sequence, and a pointer to a next record in the sequence; generating the first record including the first log entry, the first write data, the forward reference identifier for the second record, and a pointer to the second record; performing a single write operation that includes writing the first record to the persistent datastore, wherein; the pointer to the second record is a pointer to a location in the persistent data store allocated for writing the second record prior to writing the first record and the second record to the persistent datastore, and the forward reference identifier for the second record is different from the pointer to the second record; and performing a recovery operation that includes; reading the first log entry; using the pointer to the second record to read a second log entry; determining whether the forward reference identifier for the second record matches a second reference identifier in the second record; in accordance with a determination that the forward reference identifier for the second record matches the second reference identifier in the second record, replaying a transaction associated with the second log entry; and in accordance with a determination that the forward reference identifier for the second record does not match the second reference identifier in the second record, stopping the recovery operation. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A non-transitory computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which, when executed by an electronic system with one or more processors, cause the electronic systems to perform operations comprising:
-
generating a first log entry associated with first write data to be stored in a persistent data store, wherein the first log entry includes information sufficient to replay a transaction associated with the first write data; generating a forward reference identifier for a second record of a plurality of sequential records that is different from a first record of the plurality of sequential records, wherein each respective record of the plurality of sequential records includes a respective log entry, write data that was not yet stored in the persistent data store when said log entry was generated, a respective reference identifier for the respective record, a forward reference identifier for a next record in the sequence, and a pointer to a next record in the sequence; generating the first record including the first log entry, the first write data, the forward reference identifier for the second record, and a pointer to the second record; performing a single write operation that includes writing the first record to the persistent datastore, wherein; the pointer to the second record is a pointer to a location in the persistent data store allocated for writing the second record prior to writing the first record and the second record to the persistent datastore, and the forward reference identifier for the second record is different from the pointer to the second record; and performing a recovery operation that includes; reading the first log entry; using the pointer to the second record to read a second log entry; determining whether the forward reference identifier for the second record matches a second reference identifier in the second record; in accordance with a determination that the forward reference identifier for the second record matches the second reference identifier in the second record, replaying a transaction associated with the second log entry; and in accordance with a determination that the forward reference identifier for the second record does not match the second reference identifier in the second record, stopping the recovery operation.
-
Specification