Version 2 of the proof of concept code showed a problem with the way log is appended to the repliation buffer. Currently, LogToFile#appendLogRecord is used to write log to the replication master log buffer. However, the LogAccessFile class that wraps write operations to log file also write checksums. We need these checksums at the slave because without them, the log instants on the slave and master will differ, in turn making recovery impossible (undo operations refer to a specific instant, which will not be correct).
The attached patch, repli_logbuffer_v2.*, changes this erroneous behavior. With this patch, log is appended to the repliation log buffer in LogAccessFile, not LogToFile like now. The patch modifies the following files:
The buffer now accepts chunks of log records from LogAccessFile#writeToLog (i.e., appended to replication buffer in the same method that writes the log to disk) instead of single log records from LogToFile#appendLogRecord
Modified the slave-side log parser to read the new chunk of log record format
Modified appendLog signature to accept log from LogAccessFile instead of from LogToFile
Can be set inReplicationMasterMode, in which log is appended to MasterFactory
Removed the code that appends log to replication log buffer, and tells LogAccessFile to go into replication master mode when needed.
Allsuites and derbyall completed without error