[
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