[
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