[
https://issues.apache.org/jira/browse/DERBY-2926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12521423
]
Knut Anders Hatlen commented on DERBY-2926:
-------------------------------------------
One more question related to #14:
It seems the code reallocates the buffer as long as its length is not equal to
the default size, even if the new buffer will be of the exact same size as the
old one (I was thinking this could happen if you for instance update a LOB, so
that you get a large number of consecutive log records with identical size, but
larger than default size). I think this simplified code would behave the same
way and save buffer allocation in those cases:
int requiredSize = Math.max(defaultBufferSize, current.size());
if (outBufferData.length != requiredSize) {
outBufferData = new byte[requiredSize];
}
> 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: Services
> Affects Versions: 10.4.0.0
> Reporter: Jørgen Løland
> Assignee: Jørgen Løland
> Fix For: 10.4.0.0
>
> Attachments: bytebuffer_v1-fixheader.diff,
> bytebuffer_v1-fixheader.stat, bytebuffer_v1.diff, bytebuffer_v1.stat,
> bytebuffer_v1a.diff, bytebuffer_v1a.stat, bytebuffer_v2.diff,
> bytebuffer_v2.stat, bytebuffer_v2b.diff, bytebuffer_v2b.stat
>
>
> 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.