[ 
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

        

Reply via email to