db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jørgen Løland (JIRA) <j...@apache.org>
Subject [jira] Commented: (DERBY-2926) Replication: Add a log buffer for log records that should be shipped to the slave
Date Mon, 16 Jul 2007 07:03:11 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512876
] 

Jørgen Løland commented on DERBY-2926:
--------------------------------------

>Another approach here would be to use a large circular byte buffer and
>administer space in it yourself. 

Thank you for the link, Dag.

The initial log buffer plan was to make a log buffer of linked
list LogElements, each containing exactly one Derby log record.
Simple to write, but will generate lots of small, short-lived
objects.

Based on the comments from Mike and Dag, I see that we have an
alternative strategy in reusing code from LogAccessFile. Although
I am not sure if LogAccessFile can be used as a log buffer as it
is, we can reuse much of the code. Basically, this would mean
that the log buffer is written as a circular byte buffer. The
slave will have to unserialize the byte buffers to get the log
records, but that should be fairly easy.

The byte buffer strategy requires far less objects since each
buffer can contain many log records. Furthermore, reusing
LogAccessFile means I don't have to add a separate "beast",
although some modifications may be required. Finally, LogToFile
can still be the place where log records are added to the buffer.
This is nice because of the single point of entry considerations.

The alternative strategy seems to be better than the original
one. I will give that a try.

> 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.


Mime
View raw message