[ https://issues.apache.org/jira/browse/DERBY-2977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jørgen Løland updated DERBY-2977: --------------------------------- Attachment: repli_logbuffer_v2.diff repli_logbuffer_v2.stat 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: M java/engine/org/apache/derby/impl/services/replication/buffer/LogBufferElement.java M java/engine/org/apache/derby/impl/services/replication/buffer/ReplicationLogBuffer.java 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 M java/engine/org/apache/derby/impl/services/replication/slave/ReplicationLogScan.java Modified the slave-side log parser to read the new chunk of log record format M java/engine/org/apache/derby/impl/services/replication/master/MasterController.java M java/engine/org/apache/derby/iapi/services/replication/master/MasterFactory.java Modified appendLog signature to accept log from LogAccessFile instead of from LogToFile M java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java Can be set inReplicationMasterMode, in which log is appended to MasterFactory M java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java 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 > Replication: Add a ReplicationMaster controller that will manage replication > on the master side > ----------------------------------------------------------------------------------------------- > > Key: DERBY-2977 > URL: https://issues.apache.org/jira/browse/DERBY-2977 > Project: Derby > Issue Type: Sub-task > Components: Services > Affects Versions: 10.4.0.0 > Reporter: Jørgen Løland > Assignee: Jørgen Løland > Attachments: derby_2977_1.diff, derby_2977_1.stat, > derby_2977_1b.diff, derby_2977_1b.stat, derby_2977_1c.diff, > derby_2977_1c.stat, repli_logbuffer_v2.diff, repli_logbuffer_v2.stat > > > The replication master role includes many tasks: > * set up a network connection to the slave > * sending the database to the slave before starting replication > * make sure that log records are appended to the network buffer, and that the > log is later sent to the slave > * etc > This issue is for adding a controller that will start/stop/initiate all > services needed for the replication master role. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.