[
https://issues.apache.org/jira/browse/DERBY-2926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512012
]
Jørgen Løland commented on DERBY-2926:
--------------------------------------
Note the questions below...
PLAN:
I am planing to write the buffer as a linked list of ReplicationLogRecord
objects, each containing the same information that is passed to
LogToFile.appendLogRecord:
byte[] data
int offset
int length
byte[] optionaldata
int optionalDataOffset
int optionalDataLength
This is the same information that is sent in DERBY-2872 using RMI calls. Log
records will be appended to the buffer somewhere in the LogFactory, while a log
shipping service will remove log records from it. Adding and removing log
records from the buffer is not part of this jira.
QUESTIONS:
* It will be very easy to recycle the ReplicationLogRecord objects that make up
the linked list. Once the log-information in an object has been shipped to the
slave, the object could be put in a pool of recycled objects. This would
significantly reduce the number of ReplicationLogRecord objects that must be
created and garbage collected, but may increase the memory usage since the
objects in the pool are not removed from memory. *Is recycling considered good
or bad practice?*
* Will it be ok to create a new directory for this, e.g.
java/engine/org/apache/derby/impl/store/replication/buffer/ ? It is likely that
more replication functionality will be added to store later, and
/store/replication could then be used for all of this.
> Replication: Add a log buffer for log records that should be shipped to the
> slave
> ---------------------------------------------------------------------------------
>
> Key: DERBY-2926
> URL: https://issues.apache.org/jira/browse/DERBY-2926
> Project: Derby
> Issue Type: Sub-task
> Components: Store
> Affects Versions: 10.4.0.0
> Reporter: Jørgen Løland
> Assignee: Jørgen Løland
>
> When a Derby instance has the master role for a database, log records are
> shipped to the slave to keep it up to date. A buffer is needed because the
> log records should not be shipped one at a time. Also, writing the log
> records to a buffer instead of sending them immediately removes the network
> communication from the critical path for the transaction.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.