[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598664#comment-13598664
 ] 

Flavio Junqueira commented on BOOKKEEPER-580:
---------------------------------------------

Hi Sijie, I agree with the goal of not executing close operations 
unnecessarily, but I wonder why not return OK rather than 
LedgerClosedException. 

I'm not sure why you have removed the call to close in BookieRecoveryTest.

About changing the exception caught in the following: 

{noformat}
-        } catch (BKException.BKMetadataVersionException e) {
+        } catch (BKException.BKLedgerClosedException e) {
{noformat} 

We can still get metadata version exceptions in the case of concurrent attempts 
to close a ledger with different clients (distinct ledger handlers). In fact, I 
thought this was the case with TestFencing, so I'm wondering why it is correct 
to replace the exception like that.

One other suggestion is to add comments describing why we need to check if the 
ledger is closed in those two places. These checks are there mostly for 
performance reasons, and for correctness I believe we don't need them, so it 
would be good to have some reminders there for us.


                
> improve close logic
> -------------------
>
>                 Key: BOOKKEEPER-580
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-580
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.3.0
>
>         Attachments: BOOKKEEPER-580.diff, BOOKKEEPER-580.diff
>
>
> currently, bookkeeper client still write ledger metadata to metadata storage 
> even the metadata is already closed or undergoing closing. which would cause 
> lots of bad version metadata update encountering unrecoverable errors in 
> ledger handle. e.g. NotEnoughtBookiesException.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to