db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen (JIRA) <j...@apache.org>
Subject [jira] Commented: (DERBY-3359) The log shipper needs to be modified to vary the shipping intervals dynamically (based on load)
Date Fri, 08 Feb 2008 14:55:12 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567058#action_12567058
] 

Øystein Grøvlen commented on DERBY-3359:
----------------------------------------

Thanks, for the patch Narayanan.  I think I have convinced myself that
the code would work, but I am not sure that it matches the description
of the basic idea above.  The description says:

> If the fill information is less than 10 the log shipper will ship
> with a MAX ms delay or when a buffer becomes full whichever comes
> first.

I do not think this is what is implemented.  If there is 10 or more
log buffers, it seems workToDo() will do nothing when the first log
buffer goes full.  I would consider reasoning around lastShippingTime
instead of nextShippingTime.  I think that would also make the
logic easier to understand.  In other words, I suggest something like
this in workToDo():

   if (fi >= 80) {
       notify();
   } else if (System.currentTimeMillis() - lastShippingTime) > MID) {
       // Minimum MID time between messages unless buffer is almost full
       notify();
   }

Some minor things:

1. It seems to me that MIN would be a more descriptive name than MID.
   It is the minimum interval when not in "Panic mode".

2. I suggest increasing MID to 100.

3. The MAX value could be higher.  I would think a default latency of
   5 seconds should be acceptable.

4. The last sentence of Javadoc for MAX needs an explanation.  

5. ReplicationLogBuffer: Why add a new constructor?  I think it would
   be better to just add a parameter to the existing.  Having the
   original constructor, opens for objects that will give null pointer
   exceptions where mf is referred.

6. Comments in ReplicationLogBuffer refers to LogShipper, but
   strictly speaking ReplicationLogBuffer does not know of any
   LogShipper, just that the MasterFactory wants to know when there is
   more work to be done.

7. I think you should use final fields for the thresholds (10/80).  That
    would make them easier to change if necessary.


> The log shipper needs to be modified to vary the shipping intervals dynamically (based
on load)
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3359
>                 URL: https://issues.apache.org/jira/browse/DERBY-3359
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: V.Narayanan
>            Assignee: V.Narayanan
>         Attachments: DynamicLogShipping_v1.diff, DynamicLogShipping_v1.stat, DynamicLogShipping_v2.diff,
DynamicLogShipping_v2.stat
>
>


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