You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Matteo Merli (JIRA)" <ji...@apache.org> on 2012/05/30 02:09:23 UTC

[jira] [Created] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Matteo Merli created BOOKKEEPER-273:
---------------------------------------

             Summary: LedgerHandle.deleteLedger() should be idempotent
                 Key: BOOKKEEPER-273
                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
             Project: Bookkeeper
          Issue Type: Bug
          Components: bookkeeper-client
    Affects Versions: 4.1.0
            Reporter: Matteo Merli
            Priority: Minor


Deleting a non-existing ledger should silently succeed. 

Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 

This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285354#comment-13285354 ] 

Sijie Guo commented on BOOKKEEPER-273:
--------------------------------------

I like the idea Uma proposed, changing deleteLedger to return a boolean result indicating whether the file is deleted succeed or not. If we want to do it, it would be API change and I would suggest marking it as 4.2.0. 

BTW, it would be better to generate the patch with '-no-prefix' option, which might be easy for users to apply.
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Posted by "Matteo Merli (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285701#comment-13285701 ] 

Matteo Merli commented on BOOKKEEPER-273:
-----------------------------------------

Updated the patch to throw BKNoSuchLedgerExistsException when the ledger doesn't exist.
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285534#comment-13285534 ] 

Sijie Guo commented on BOOKKEEPER-273:
--------------------------------------



> With respect to the issue of this jira, I believe we would return true in the case the ledger has already been deleted and return false if the operation really fails, right?

I think the proposal is returning true when deleting the ledger successfully, returning false when the ledger doesn't exist, throwing exception when encountering exceptions during deletion. Just as File#delete() in JDK, http://docs.oracle.com/javase/1.4.2/docs/api/java/io/File.html#delete()

>  At the time we were designing the api, we've set as one of our guidelines to have synchronous calls indicating an error by throwing an exception and asynchronous calls indicating errors with a return code.

I agreed that we need to keep compatibility in 4.x versions. One bad thing for now is user can't know the detail reason when receiving ZKException return code in ledger deletion. I would suggest returning NoSuchLedgerExistsException when deleting non-existed ledgers, which could keep compatibility and make user clear about what happened.
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

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

Flavio Junqueira commented on BOOKKEEPER-273:
---------------------------------------------

@matteo I agree with the change. Interestingly, there is a mismatch between the synchronous version of delete ledger and the asynchronous version. The asynchronous version propagates the zookeeper error code, but the synchronous one doesn't, it simply logs the error code. The asynchronous version seems to be leaking some info about the internals.

@uma,sijie At the time we were designing the api, we've set as one of our guidelines to have synchronous calls indicating an error by throwing an exception and asynchronous calls indicating errors with a return code. If we make the change Uma proposes, then we will be breaking this guideline and symmetry. Do you guys feel that it is a strong enough reason to break compatibility? Of course, doing it earlier is better, so now it is a good time to talk about it. Also, I think that a change that breaks compatibility should be in 5.0, no?

With respect to the issue of this jira, I believe we would return true in the case the ledger has already been deleted and return false if the operation really fails, right? Throwing an exception compared to just returning a boolean enables us to convey more information about the error, even if we are not conveying a lot right now. 
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285315#comment-13285315 ] 

Uma Maheswara Rao G commented on BOOKKEEPER-273:
------------------------------------------------


I agree the case. Even normal file system also will not throw any exceptions on delete failures, but it will indicate with false about the opeation status.
Unfortunately deleteLedger is void API. But this will be a behaviour change, So, let's discuss with Ivan/Flavio. Existing customers might have the opinion of throwing exception when NoNode also. If the change approves, you may want to add test for this behavior... .Alternatively, can we set a different exception code in this case?
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

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

Matteo Merli updated BOOKKEEPER-273:
------------------------------------

    Attachment: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
    
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285579#comment-13285579 ] 

Ivan Kelly commented on BOOKKEEPER-273:
---------------------------------------

+1 on NoSuchLedgerExistsException. Any code already has to catch BKException, so this won't break BC, but it will allow them to know that the failure was only due to the ledger not existing.
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Posted by "Matteo Merli (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285711#comment-13285711 ] 

Matteo Merli commented on BOOKKEEPER-273:
-----------------------------------------

Updated the patch with formatting and exception full name.
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

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

Flavio Junqueira commented on BOOKKEEPER-273:
---------------------------------------------

+1 for me too on NoSuchLedgerExistsException.
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

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

Matteo Merli updated BOOKKEEPER-273:
------------------------------------

    Attachment: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
    
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285742#comment-13285742 ] 

Hudson commented on BOOKKEEPER-273:
-----------------------------------

Integrated in bookkeeper-trunk #536 (See [https://builds.apache.org/job/bookkeeper-trunk/536/])
    BOOKKEEPER-273: LedgerHandle.deleteLedger() should be idempotent (Matteo Merli via ivank) (Revision 1344301)

     Result = UNSTABLE
ivank : 
Files : 
* /zookeeper/bookkeeper/trunk/CHANGES.txt
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java

                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Assignee: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285550#comment-13285550 ] 

Uma Maheswara Rao G commented on BOOKKEEPER-273:
------------------------------------------------

{quote}
 would suggest returning NoSuchLedgerExistsException when deleting non-existed ledgers, which could keep compatibility and make user clear about what happened.
{quote}
This is one more option alternatively I proposed in my previous comment.
see in my above comment: [Alternatively, can we set a different exception code in this case?|https://issues.apache.org/jira/browse/BOOKKEEPER-273?focusedCommentId=13285315&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13285315]
I too agreed with Flavio about maintainng the compatibility for 4.x versions. For this version, fix could be like this suggestion. So, that we can maintain compatiobility for 4.x versions and also will be able to indicate the users about the status with correct exception.

For version 5.0, may be we can think/ discuss more about this API behavior change. Since we don't want to break the compatibility in 4.x versions, Let's go ahead with above suggestion? If yes, it may be better to move to separate JIRA about the below discussions then?
{quote}
I think the proposal is returning true when deleting the ledger successfully, returning false when the ledger doesn't exist, throwing exception when encountering exceptions during deletion. Just as File#delete() in JDK, http://docs.oracle.com/javase/1.4.2/docs/api/java/io/File.html#delete()
{quote}
{quote}
@uma,sijie At the time we were designing the api, we've set as one of our guidelines to have synchronous calls indicating an error by throwing an exception and asynchronous calls indicating errors with a return code. If we make the change Uma proposes, then we will be breaking this guideline and symmetry. Do you guys feel that it is a strong enough reason to break compatibility? Of course, doing it earlier is better, so now it is a good time to talk about it. Also, I think that a change that breaks compatibility should be in 5.0, no?
{quote}

Thanks,
Uma
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285714#comment-13285714 ] 

Ivan Kelly commented on BOOKKEEPER-273:
---------------------------------------

lgtm +1. committing
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285705#comment-13285705 ] 

Ivan Kelly commented on BOOKKEEPER-273:
---------------------------------------

Two small niggles with the patch.
a) the javadoc should specify BKException.BKNoSuchLedgerExistsException rather than BKNoSuchLedgerExistsException, so that javadoc can generate a link for it. (mvn javadoc:aggregate generates the javadoc btw)
b) the else should be on the same line. Use zookeeper's coding standard, which in turn uses the sun standard. [1][2]

[1] https://cwiki.apache.org/confluence/display/ZOOKEEPER/HowToContribute
[2] http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-142311.html#449
                
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BOOKKEEPER-273) LedgerHandle.deleteLedger() should be idempotent

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

Matteo Merli updated BOOKKEEPER-273:
------------------------------------

    Attachment: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
    
> LedgerHandle.deleteLedger() should be idempotent
> ------------------------------------------------
>
>                 Key: BOOKKEEPER-273
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-273
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>    Affects Versions: 4.1.0
>            Reporter: Matteo Merli
>            Priority: Minor
>             Fix For: 4.1.0
>
>         Attachments: 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch, 0001-BOOKKEEPER-273-LedgerHandle.deleteLedger-should-be-i.patch
>
>
> Deleting a non-existing ledger should silently succeed. 
> Current behavior is to raise a ZKException, but it's not possible to know whether there was some error or the ledger does not exists anymore. 
> This scenario will happen when a previous deleteLedger() call succeeded but the client crashed before updating its own ledger list.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira