@codingwangqi good catch. I think some discussions are required for this line.

@eolivelli I was actually looking into the the implementation. it seems that we 
treat every validation failure as 'NoSuchLedgerException'. It seems to be a 
problem to me, because if someone drops some other validation logic in 
`validate`, it will still be treated as `NoSuchLedgerException`, then it 
becomes wrong.

```
if (!validate()) {
                cb.openComplete(BKException.Code.NoSuchLedgerExistsException, 
null, null);
                return;
            }
```

`validate` should probably just return a proper rc code.

```
int rc = validate();
if (Code.OK != rc) {
    cd.openComplete(rc);
   return;
}
```

[ Full content available at: https://github.com/apache/bookkeeper/pull/1638 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to