# US 2020/0004735 A1 · Commit coalescing for micro-journal based transaction logging

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2020/0004735 A1
- Document ID: US20200004735A1
- Status: Published application
- Kind: A1
- Application number: 16/560,951
- Filed: 2019-09-04
- Published: 2020-01-02
- Earliest claimed: 2016-05-31
- Assignees: VMware, Inc.
- Applicants: VMware, Inc.
- Inventors: Pratap Subrahmanyam; Zongwei Zhou; Xavier Deguillard; Rajesh Venkatasubramanian
- Web page: https://patentgrep.com/patent/US20200004735A1

## CPC

- G06F 16/2343: {Locking methods, e.g. distributed locking or locking implementation details}
- G06F 16/2358: {Change logging, detection, and notification (replication G06F16/27)}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for using commit coalescing when performing micro-journal-based transaction logging are provided. In one embodiment a computer system can maintain, in a volatile memory, a globally ascending identifier, a first list of free micro-journals, and a second list of in-flight micro-journals. The computer system can further receive a transaction comprising a plurality of modifications to data or metadata stored in the byte-addressable persistent memory, select a micro-journal from the first list, obtain a lock on the globally ascending identifier, write a current value of the globally ascending identifier as a journal commit identifier into a header of the micro-journal, and write journal entries into the micro-journal corresponding to the plurality of modifications included in the transaction. The computer system can then commit the micro-journal to the byte-addressable persistent memory, increment the current value of the globally ascending identifier, and release the lock.

## Claims

### Claim 1

A method for using commit coalescing when performing micro-journal-based transaction logging, the method comprising:
maintaining, by a computer system in a volatile memory, a globally ascending identifier and a first list of free micro-journals, each micro-journal in the first list being stored in a byte-addressable persistent memory of the computer system and being configured to record journal entries for a single transaction at a time;
receiving, by the computer system, a transaction comprising one or more modifications to data or metadata stored in the byte-addressable persistent memory;
selecting, by the computer system, a micro-journal from the first list;
obtaining a lock on the globally ascending identifier and writing a current value of the globally ascending identifier as a journal commit identifier into the micro-journal;
writing, by the computer system, journal entries into the micro-journal corresponding to the one or more modifications included in the transaction; and
committing, by the computer system, the micro-journal to the byte-addressable persistent memory.

### Claim 2 (depends on 1)

The method of claim 1 further comprising:
incrementing the current value of the globally ascending identifier and releasing the lock.

### Claim 3 (depends on 2)

The method of claim 2 wherein the computer system further maintains a second list of in-flight micro-journals in the volatile memory, and wherein the method further comprises:
moving micro-journals in the second list to the first list;
writing the one or more modifications included in the transaction, without committing the one or more modifications to the byte-addressable persistent memory;
obtaining the lock on the globally ascending identifier and writing a current value of the globally ascending identifier as a metadata commit identifier in the header;
incrementing the current value of the globally ascending identifier and releasing the lock; and
adding the micro-journal to the second list.

### Claim 4 (depends on 3)

The method of claim 3 further comprising, after a crash or failure of the computer system:
reconstructing the globally ascending identifier, the first list of free micro-journals, and the second list of in-flight micro-journals;
ordering micro-journals in the second list according to their respective journal commit identifiers; and
replaying the micro-journals in the second list in order.

### Claim 5 (depends on 4)

The method of claim 4 wherein reconstructing the globally ascending identifier, the first list of free micro-journals, and the second list of in-flight micro-journals comprises:
initializing a first variable to zero;
initializing a second variable to the largest journal commit identifier of all micro-journals; and
for each micro-journal:
if the journal commit identifier is less than the metadata commit identifier:
setting the first variable to the greater of the first variable and the metadata commit identifier; and
if the metadata commit identifier is greater than the second variable:
adding the micro-journal to the second list;
else:
adding the micro-journal to the first list;
else:
setting the first variable to the greater of the first variable and the journal commit identifier;
adding the micro-journal to the second list; and
if the journal commit identifier is greater than the second variable, removing all micro-journals from the second list and adding the removed micro-journals to the first list.

### Claim 6 (depends on 5)

The method of claim 5 wherein reconstructing the globally ascending identifier, the first list of free micro-journals, and the second list of in-flight micro-journals further comprises:
setting the globally ascending identifier to the first variable plus 1.

### Claim 7 (depends on 3)

The method of claim 3 further comprising, prior to an overflow of the globally ascending identifier:
creating shadow copies of the micro-journals stored in the byte-addressable persistent memory;
rewriting the journal commit identifiers and the metadata commit identifiers included in the shadow copies based on a new initial value; and
atomically activating the shadow copies of the micro-journals and deactivating the original microjournals.

### Claim 8

A non-transitory computer readable storage medium having stored thereon program code executable by a computer system, the program code embodying a method for using commit coalescing when performing micro-journal-based transaction logging, the method comprising:
maintaining, in a volatile memory of the computer system, a globally ascending identifier and a first list of free micro-journals, each micro-journal in the first list being stored in a byte-addressable persistent memory of the computer system and being configured to record journal entries for a single transaction at a time;
receiving a transaction comprising one or more modifications to data or metadata stored in the byte-addressable persistent memory;
selecting a micro-journal from the first list;
obtaining a lock on the globally ascending identifier and writing a current value of the globally ascending identifier as a journal commit identifier into the micro-journal;
writing journal entries into the micro-journal corresponding to the one or more modifications included in the transaction; and
committing the micro-journal to the byte-addressable persistent memory.

### Claim 9 (depends on 8)

The non-transitory computer readable storage medium of claim 8 wherein the method further comprises:
incrementing the current value of the globally ascending identifier and releasing the lock.

### Claim 10 (depends on 9)

The non-transitory computer readable storage medium of claim 9 wherein the computer system further maintains a second list of in-flight micro-journals in the volatile memory, and wherein the method further comprises:
moving micro-journals in the second list to the first list;
writing the one or more modifications included in the transaction, without committing the one or more modifications to the byte-addressable persistent memory;
obtaining the lock on the globally ascending identifier and writing a current value of the globally ascending identifier as a metadata commit identifier in the header;
incrementing the current value of the globally ascending identifier and releasing the lock; and
adding the micro-journal to the second list.

### Claim 11 (depends on 10)

The non-transitory computer readable storage medium of claim 10 wherein the method further comprises, after a crash or failure of the computer system:
reconstructing the globally ascending identifier, the first list of free micro-journals, and the second list of in-flight micro-journals;
ordering micro-journals in the second list according to their respective journal commit identifiers; and
replaying the micro-journals in the second list in order.

### Claim 12 (depends on 11)

The non-transitory computer readable storage medium of claim 11 wherein reconstructing the globally ascending identifier, the first list of free micro-journals, and the second list of in-flight micro-journals comprises:
initializing a first variable to zero;
initializing a second variable to the largest journal commit identifier of all micro-journals; and
for each micro-journal:
if the journal commit identifier is less than the metadata commit identifier:
setting the first variable to the greater of the first variable and the metadata commit identifier; and
if the metadata commit identifier is greater than the second variable:
adding the micro-journal to the second list;
else:
adding the micro-journal to the first list;
else:
setting the first variable to the greater of the first variable and the journal commit identifier;
adding the micro-journal to the second list; and
if the journal commit identifier is greater than the second variable, removing all micro-journals from the second list and adding the removed micro-journals to the first list.

### Claim 13 (depends on 12)

The non-transitory computer readable storage medium of claim 12 wherein reconstructing the globally ascending identifier, the first list of free micro-journals, and the second list of in-flight micro-journals further comprises:
setting the globally ascending identifier to the first variable plus 1.

### Claim 14 (depends on 10)

The non-transitory computer readable storage medium of claim 10 wherein the method further comprises, prior to an overflow of the globally ascending identifier:
creating shadow copies of the micro-journals stored in the byte-addressable persistent memory;
rewriting the journal commit identifiers and the metadata commit identifiers included in the shadow copies based on a new initial value; and
atomically activating the shadow copies of the micro-journals and deactivating the original microjournals.

### Claim 15

A computer system comprising:
a processor;
a volatile memory;
a byte-addressable persistent memory; and
a non-transitory computer readable medium having stored thereon program code for implementing commit coalescing when performing micro-journal-based transaction logging, the program code causing the processor to:
maintain, in the volatile memory, a globally ascending identifier and a first list of free micro-journals, each micro-journal in the first list being stored in the byte-addressable persistent memory and being configured to record journal entries for a single transaction at a time;
receive a transaction comprising one or more modifications to data or metadata stored in the byte-addressable persistent memory;
select a micro-journal from the first list;
obtain a lock on the globally ascending identifier and write a current value of the globally ascending identifier as a journal commit identifier into the micro-journal;
write journal entries into the micro-journal corresponding to the one or more modifications included in the transaction; and
commit the micro-journal to the byte-addressable persistent memory.

### Claim 16 (depends on 15)

The computer system of claim 15 wherein the program code further causes the processor to:
increment the current value of the globally ascending identifier and release the lock.

### Claim 17 (depends on 16)

The computer system of claim 16 wherein the processor further maintains a second list of in-flight micro-journals in the volatile memory, and wherein the program code further causes the processor to:
move micro-journals in the second list to the first list;
write the one or more modifications included in the transaction, without committing the one or more modifications to the byte-addressable persistent memory;
obtain the lock on the globally ascending identifier and writing a current value of the globally ascending identifier as a metadata commit identifier in the header;
increment the current value of the globally ascending identifier and release the lock; and
add the micro-journal to the second list.

### Claim 18 (depends on 17)

The computer system of claim 17 wherein the program code further causes the processor to, after a crash or failure of the computer system:
reconstruct the globally ascending identifier, the first list of free micro-journals, and the second list of in-flight micro-journals;
order micro-journals in the second list according to their respective journal commit identifiers; and
replay the micro-journals in the second list in order.

### Claim 19 (depends on 18)

The computer system of claim 18 wherein reconstructing the globally ascending identifier, the first list of free micro-journals, and the second list of in-flight micro-journals comprises:
initializing a first variable to zero;
initializing a second variable to the largest journal commit identifier of all micro-journals; and
for each micro-journal:
if the journal commit identifier is less than the metadata commit identifier:
setting the first variable to the greater of the first variable and the metadata commit identifier; and
if the metadata commit identifier is greater than the second variable:
adding the micro-journal to the second list;
else:
adding the micro-journal to the first list;
else:
setting the first variable to the greater of the first variable and the journal commit identifier;
adding the micro-journal to the second list; and
if the journal commit identifier is greater than the second variable, removing all micro-journals from the second list and adding the removed micro-journals to the first list.

### Claim 20 (depends on 19)

The computer system of claim 19 wherein reconstructing the globally ascending identifier, the first list of free micro-journals, and the second list of in-flight micro-journals further comprises:
setting the globally ascending identifier to the first variable plus 1.

### Claim 21 (depends on 17)

The computer system of claim 17 wherein the program code further causes the processor to, prior to an overflow of the globally ascending identifier:
create shadow copies of the micro-journals stored in the byte-addressable persistent memory;
rewrite the journal commit identifiers and the metadata commit identifiers included in the shadow copies based on a new initial value; and
atomically activate the shadow copies of the micro-journals and deactivate the original microjournals.
