Write ordering for persistent memory
Techniques are provided for implementing write ordering for persistent memory. A set of actions are identified for commitment to persistent memory of a node for executing an operation upon the persistent memory. An episode is created to comprise a first subset of actions of the set of actions that can be committed to the persistent memory in any order with respect to one another such that a consistent state of the persistent memory can be reconstructed in the event of a crash of the node during execution of the operation. The first subset of actions within the episode are committed to the persistent memory and further execution of the operation is blocked until the episode completes.
1 . A method, comprising:
creating a first group of actions to commit to persistent memory of a node in any order while retaining an ability to reconstruct the persistent memory into a consistent state;
identifying existing data, within the persistent memory, that is to be overwritten by data being written by an action of the first group;
tracking, within a log, tracked data used to reconstruct the persistent memory into the consistent state, wherein the tracked data includes the existing data or the data being written by the action;
writing the data into the persistent memory according to a byte-addressable format; and
in response to detecting the node recovering from a failure, initiating a reconstruction process that utilizes the tracked data within the log to reconstruct the persistent memory into the consistent state.
2 . The method of claim 1 , wherein the first group of actions are part of an operation being executed by the node, and wherein the method comprises:
creating a second group of actions to commit to the persistent memory in any order while retaining the ability to reconstruct the persistent memory into the consistent state, wherein the second group of actions are part of the operation being executed by the node; and
in response to the first group of actions being committed to the persistent memory, committing the second group of actions to the persistent memory.
3 . The method of claim 1 , comprising:
mirroring stored data within the persistent memory of the node to a partner persistent memory of a partner node; and
in response to the node failing, redirecting I/O operations from targeting the node to targeting the partner node for commitment to the partner persistent memory.
4 . The method of claim 3 , comprising:
in response to detecting the failure of the node, reconstructing the partner persistent memory into the consistent state before redirecting the I/O operations.
5 . The method of claim 1 , comprising:
identifying a plurality of actions of a write operation targeting the persistent memory;
grouping a first subset of the plurality of actions into the first group; and
committing the first subset of the plurality of actions of the first group to the persistent memory to write the data into the persistent memory.
6 . The method of claim 5 , comprising:
grouping a second subset of the plurality of actions into a second group to commit the persistent memory in any order while retaining the ability to reconstruct the persistent memory into the consistent state; and
committing the second subset of the plurality of actions to the persistent memory.
7 . The method of claim 6 , comprising:
sequentially committing the first subset of the plurality of actions and subsequently the second subset of the plurality of actions to the persistent memory.
8 . The method of claim 6 , comprising:
committing the first subset of the plurality of actions to the persistent memory; and
mirroring the first subset of the plurality of actions to a partner node for commitment to a partner persistent memory.
9 . The method of claim 8 , comprising:
in response to successfully committing the first subset of the plurality of actions to the persistent memory and before the partner node responds that the first subset of the plurality of actions were successfully committed to the partner persistent memory, committing the second subset of the plurality of actions to the persistent memory.
10 . A node comprising:
a memory storing instructions; and
a processor coupled to the memory, the processor configured to execute the instructions to cause the node to:
create a first group of actions to commit to persistent memory of the node in any order while retaining an ability to reconstruct the persistent memory into a consistent state;
identify existing data, within the persistent memory, that is to be overwritten by data being written by an action of the first group;
track, within a log, tracked data used to reconstruct the persistent memory into the consistent state, wherein the tracked data includes the existing data or the data being written by the action;
write the data into the persistent memory according to a byte-addressable format; and
in response to detecting the node recovering from a failure, initiate a reconstruction process that utilizes the tracked data within the log to reconstruct the persistent memory into the consistent state.
11 . The node of claim 10 , wherein the instructions cause the node to:
group a first subset of actions of an operation, targeting the persistent memory, into the first group of actions; and
commit the first group of actions to the persistent memory to write the data into the persistent memory.
12 . The node of claim 11 , wherein the instructions cause the node to:
group a second subset of the actions of the operation into a second group of actions to commit to the persistent memory in any order while retaining the ability to reconstruct the persistent memory into the consistent state; and
commit the second group of actions to the persistent memory.
13 . The node of claim 12 , wherein the instructions cause the node to:
sequentially commit the first group of actions and then the second group of actions to the persistent memory.
14 . The node of claim 12 , wherein the instructions cause the node to:
commit the first group of actions to the persistent memory; and
mirror the first group of actions to a partner node for commitment to a partner persistent memory.
15 . The node of claim 14 , wherein the instructions cause the node to:
in response to successfully committing the first group of actions to the persistent memory and before the partner node responds that the first group of actions were successfully committed to the partner persistent memory, committing the second group of actions to the persistent memory.
16 . A non-transitory machine readable medium comprising instructions for performing a method, which when executed by a node, causes the node to:
create a first group of actions to commit to persistent memory of the node in any order while retaining an ability to reconstruct the persistent memory into a consistent state;
identify existing data, within the persistent memory, that is to be overwritten by data being written by an action of the first group;
track, within a log, tracked data used to reconstruct the persistent memory into the consistent state, wherein the tracked data includes the existing data or the data being written by the action;
write the data into the persistent memory according to a byte-addressable format; and
in response to detecting the node recovering from a failure, initiate a reconstruction process that utilizes the tracked data within the log to reconstruct the persistent memory into the consistent state.
17 . The non-transitory machine readable medium of claim 16 , wherein the first group of actions are part of an operation being executed by the node, and wherein the instructions cause the node to:
create a second group of actions to commit to the persistent memory in any order while retaining the ability to reconstruct the persistent memory into the consistent state, wherein the second group of actions are part of the operation being executed by the node; and
in response to the first group of actions being committed to the persistent memory, commit the second group of actions to the persistent memory.
18 . The non-transitory machine readable medium of claim 16 , wherein the instructions cause the node to:
redirect I/O operations from targeting the node to targeting a partner node for commitment to a partner persistent memory of the partner node based upon the node failing.
19 . The non-transitory machine readable medium of claim 18 , wherein the instructions cause the node to:
reconstruct the partner persistent memory into the consistent state before redirecting the I/O operations.
20 . The non-transitory machine readable medium of claim 16 , wherein the instructions cause the node to:
mirror stored data within the persistent memory of the node to a partner persistent memory of a partner node; and
in response to the node failing, redirect I/O operations from targeting the node to targeting the partner node for commitment to the partner persistent memory.