364
Read when it has the resources and connection bandwidth. This server-centric view
allows the target node to handle hundreds or thousands of connections since it is in
complete control of all resources for all of the connections and initiates the networking
transactions when it chooses. With the speed and low latency of persistent memory, a
push model can be used where the initiator and target have pre-allocated and registered
memory resources and directly RDMA Write the data without waiting for server-side
resource coordination. Microsoft’s SNIA DevCon RDMA presentation describes the
push/pull model in more detail: (https://www.snia.org/sites/default/files/
SDC/2018/presentations/PM/Talpey_Tom_Remote_Persistent_Memory.pdf).
Remote Replication Error Handling
librpmem replication failures will occur for either a lost socket connection or a lost
RDMA connection. Any error status returned from rpmem_persist(), rpmem_flush(),
and rpmem_drain() is typically treated as an unrecoverable failure. The libpmemobj
user of librpmem API should treat this as a lost socket or RDMA condition and should
wait for all remaining librpmem API calls to complete, call rpmem_close() to close the
connection and clean up the stack, and then force the application to exit. When the
application restarts, the files will be reopened on both ends, and libpmemobj will check
only the file metadata. We recommend you do not proceed before synchronizing local
and remote memory pools with the pmempool-sync(1) command.
Say Hello to the Replicated World
The beauty of the libpmemobj remote replication is that it does not require any changes
to the existing libpmemobj application. If you take any libpmemobj application and
provide it with the poolset file configured to use the remote replica, it will simply start
replicating. No coding required.
To illustrate how to replicate persistent memory, we look at a Hello World type
program demonstrating the replication process directly using the librpmem library.
Listing 18-3 shows a part of the C program that writes the “Hello world” message to
remote memory. If it discovers that the message in English is already there, it translates
it to Spanish and writes it back to remote memory. We walk through the lines of the
program at the end of the listing.
Chapter 18 remote persistent memory
Read when it has the resources and connection bandwidth. This server-centric view
allows the target node to handle hundreds or thousands of connections since it is in
complete control of all resources for all of the connections and initiates the networking
transactions when it chooses. With the speed and low latency of persistent memory, a
push model can be used where the initiator and target have pre-allocated and registered
memory resources and directly RDMA Write the data without waiting for server-side
resource coordination. Microsoft’s SNIA DevCon RDMA presentation describes the
push/pull model in more detail: (https://www.snia.org/sites/default/files/
SDC/2018/presentations/PM/Talpey_Tom_Remote_Persistent_Memory.pdf).
Remote Replication Error Handling
librpmem replication failures will occur for either a lost socket connection or a lost
RDMA connection. Any error status returned from rpmem_persist(), rpmem_flush(),
and rpmem_drain() is typically treated as an unrecoverable failure. The libpmemobj
user of librpmem API should treat this as a lost socket or RDMA condition and should
wait for all remaining librpmem API calls to complete, call rpmem_close() to close the
connection and clean up the stack, and then force the application to exit. When the
application restarts, the files will be reopened on both ends, and libpmemobj will check
only the file metadata. We recommend you do not proceed before synchronizing local
and remote memory pools with the pmempool-sync(1) command.
Say Hello to the Replicated World
The beauty of the libpmemobj remote replication is that it does not require any changes
to the existing libpmemobj application. If you take any libpmemobj application and
provide it with the poolset file configured to use the remote replica, it will simply start
replicating. No coding required.
To illustrate how to replicate persistent memory, we look at a Hello World type
program demonstrating the replication process directly using the librpmem library.
Listing 18-3 shows a part of the C program that writes the “Hello world” message to
remote memory. If it discovers that the message in English is already there, it translates
it to Spanish and writes it back to remote memory. We walk through the lines of the
program at the end of the listing.
Chapter 18 remote persistent memory
