You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "dhruba borthakur (JIRA)" <ji...@apache.org> on 2010/12/20 11:41:00 UTC

[jira] Created: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Last modification time of a bookkeeper ledger
---------------------------------------------

                 Key: ZOOKEEPER-959
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
             Project: ZooKeeper
          Issue Type: Improvement
          Components: contrib-bookkeeper
            Reporter: dhruba borthakur


I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977529#action_12977529 ] 

dhruba borthakur commented on ZOOKEEPER-959:
--------------------------------------------

hi flavio, I have not yet started work on this item. If you have the bandwidth, I would really like to use any patch you might generate. 

> Last modification time of a bookkeeper ledger
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-959
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>            Reporter: dhruba borthakur
>             Fix For: 3.4.0
>
>
> I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977455#action_12977455 ] 

Flavio Junqueira commented on ZOOKEEPER-959:
--------------------------------------------

Dhruba, When you say that it makes sense to use the client's time, do you mean the application code or the bookkeeper client code? This could be done directly by the application by adding a timestamp before adding an entry to a ledger. 

> Last modification time of a bookkeeper ledger
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-959
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>            Reporter: dhruba borthakur
>             Fix For: 3.4.0
>
>
> I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977138#action_12977138 ] 

dhruba borthakur commented on ZOOKEEPER-959:
--------------------------------------------

A ledger can at most be written to by one writer. So it makes sense to use the client's time as the modification time of the ledger.

> Also, could the last modification time be a little lazy?

If the HDFS NameNode uses BK to store edits logs, then the lazy approach would not work very well. 

> Last modification time of a bookkeeper ledger
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-959
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>            Reporter: dhruba borthakur
>             Fix For: 3.4.0
>
>
> I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977918#action_12977918 ] 

dhruba borthakur commented on ZOOKEEPER-959:
--------------------------------------------

I agree that it will be an overhead for many applications that do not need this feature. In fact, the space overhead to store the mtimes could be a large percentage of the data itself!

> i was thinking the timestamps would be updated only on close or recovery.
This could work for some apps (but not for the namenode as it stands now).

The NN would like to find out the last modification time of the ledger. It currently uses this feature to find out the ledger that has the latest data. In future, the NN will store the last transactionId (instead of using the file/ledger mtime) along with each record. 

So, in short, I guess the NN would not need any mtime support from BK. 


> Last modification time of a bookkeeper ledger
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-959
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>            Reporter: dhruba borthakur
>             Fix For: 3.4.0
>
>
> I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973178#action_12973178 ] 

Flavio Junqueira commented on ZOOKEEPER-959:
--------------------------------------------

One concern I have is how to decide what reference to use for the modification time. As a ledger is distributed across multiple bookies and we don't assume synchronized clocks, we cannot rely upon a single value to reflect the last update time of each bookie. A simpler approach is to use the client time as a reference. 

The next concern is making it fault tolerant. If we are to make it tolerant to crashes of the client writer, then one option is to write to ZooKeeper, but that would impose a significant overhead if we are to modify upon every operation, and the value in ZooKeeper might not be consistent with updates on the bookies.

An alternative to writing to ZooKeeper would be sending a timestamp along with every entry. We can then either store the timestamp with the entry or have the bookie update the timestamp of the ledger on the side. The advantage of storing a timestamp with each entry is that it makes recovering the timestamp of the last written entry straightforward. 

Now, the easiest solution of all would be to have the application tagging an entry with a timestamp before calling addEntry (or asyncAddEntry). To get the last update of a ledger, one just have to read the last entry and parse it. This option would be completely transparent to BK.

> Last modification time of a bookkeeper ledger
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-959
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>            Reporter: dhruba borthakur
>
> I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-959:
------------------------------------

    Fix Version/s: 3.4.0

> Last modification time of a bookkeeper ledger
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-959
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>            Reporter: dhruba borthakur
>             Fix For: 3.4.0
>
>
> I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12976969#action_12976969 ] 

Mahadev konar commented on ZOOKEEPER-959:
-----------------------------------------

Flavio,
 I was thinking that taggin at the server might make more sense since usually servers are run in a single data center and have NTP running and are monitored (so time difference should not be huge), but as you stated writing at the client might give you more consistent view of each entry, so that enty id X has a lesser time stamp than id X+1. This would be hard to guarantee with time stamping at the server. So, I think you are right that client side would make more sense.

Also, could the last modification time be a little lazy? lets say you use zookeeper, and only update it every 20 transactions or so ? (ofcourse you always update it on a close ledger). Would that be sufficient? The only issue with such semantics is that it usually causes a lot of confusion later! So maybe its not that good an idea.

> Last modification time of a bookkeeper ledger
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-959
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>            Reporter: dhruba borthakur
>             Fix For: 3.4.0
>
>
> I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977508#action_12977508 ] 

dhruba borthakur commented on ZOOKEEPER-959:
--------------------------------------------

I am fine doing it in the application code for my application. 

However, it is possible that when more diverse apps want to use bookkeeper, they would also like to do the same in their own applications. If this is a oft repeated use-case, it might make sense to put that in the bookkeeper client code itself. what do you think?

> Last modification time of a bookkeeper ledger
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-959
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>            Reporter: dhruba borthakur
>             Fix For: 3.4.0
>
>
> I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977827#action_12977827 ] 

Benjamin Reed commented on ZOOKEEPER-959:
-----------------------------------------

flavio and i talked about this this morning. i think flavio's proposal works. it does have the downside of adding per record overhead. for some applications this might be a feature because you can put each record on a timeline, but for others that don't care, it would be an unnecessary overhead. another option would be to put timestamps into the znode that represents the ledger. we obviously wouldn't update the timestamp on every write. i was thinking the timestamps would be updated only on close or recovery. i think that would be sufficient for your needs. right?

> Last modification time of a bookkeeper ledger
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-959
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>            Reporter: dhruba borthakur
>             Fix For: 3.4.0
>
>
> I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-959) Last modification time of a bookkeeper ledger

Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977526#action_12977526 ] 

Flavio Junqueira commented on ZOOKEEPER-959:
--------------------------------------------

I'm also fine either way, but it does sound like other applications can benefit from this feature, even though I'm not aware at this point of other applications with such a requirement. 

Another reason perhaps to introduce it to the bk client library is that we have to make modifications to introduce the length of the ledger, so we might just introduce a timestamp as well. 

Btw, I was actually wondering if you have been working on a patch for this feature and for ZOOKEEPER-465 or if you prefer to have me doing it. I don't mind working on it, but I'd like to confirm so that we don't duplicate work.

> Last modification time of a bookkeeper ledger
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-959
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-959
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>            Reporter: dhruba borthakur
>             Fix For: 3.4.0
>
>
> I would like to discuss how hard or easy it will be to implement a bookkeeper api that returns the last modification time of a ledger. This is related to ZOOKEEPER-465.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.