[
https://issues.apache.org/jira/browse/OAK-9256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17220586#comment-17220586
]
Miroslav Smiljanic edited comment on OAK-9256 at 10/26/20, 10:36 AM:
---------------------------------------------------------------------
Hi [~adulceanu]
{quote} * in {{AzureUtilities.readBufferFully()}}, in order to keep the code
simple, we could just check the http status code coming directly from the
exception with {{e.getHttpStatusCode}}(){quote}
Good suggestion (y), haven't seen before that the same info is available in the
exception.
Modified patch: [^OAK-9256_2.patch]
{quote} * It's not clear to me why we need to introduce the new
{{FileNotFoundInArchiveException}}, when we already have the
{{SegmentNotFoundException}}. I would just re-use the latter and change
accordingly the test case(s).{quote}
Method org.apache.jackrabbit.oak.segment.azure.AzureUtilities#readBufferFully
is also used in
[AzureSegmentArchiveReader#doReadDataFile|https://github.com/apache/jackrabbit-oak/blob/jackrabbit-oak-1.34.0/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureSegmentArchiveReader.java#L80]
and JavaDoc says:
{noformat}
/**
* Reads a data file inside the archive. This entry is not a segment. Its full
name is given by archive name + extension.
{noformat}
This is the reason why I thought that it would make sense to introduce
FileNotFoundInArchiveException, as a super class for SegmentNotFoundException.
was (Author: smiroslav):
Hi [~adulceanu]
{quote} * in {{AzureUtilities.readBufferFully()}}, in order to keep the code
simple, we could just check the http status code coming directly from the
exception with {{e.getHttpStatusCode}}(){quote}
Good suggestion (y), haven't seen before that the same info is available in the
exception.
Modified patch: [^OAK-9256_2.patch]
{quote} * It's not clear to me why we need to introduce the new
{{FileNotFoundInArchiveException}}, when we already have the
{{SegmentNotFoundException}}. I would just re-use the latter and change
accordingly the test case(s).{quote}
Method org.apache.jackrabbit.oak.segment.azure.AzureUtilities#readBufferFully
is also used in
[AzureSegmentArchiveReader#doReadDataFile|https://github.com/apache/jackrabbit-oak/blob/jackrabbit-oak-1.34.0/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureSegmentArchiveReader.java#L80]
and JavaDoc says:
{noformat}
/**
* Reads a data file inside the archive. This entry is not a segment. Its full
name is given by archive name + extension.
{noformat}
This is the reason why I thought that it would make sens to introduce
FileNotFoundInArchiveException, as a super class for SegmentNotFoundException.
> Missing segment not detected in AzureSegmentArchiveReader
> ---------------------------------------------------------
>
> Key: OAK-9256
> URL: https://issues.apache.org/jira/browse/OAK-9256
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: segment-azure
> Affects Versions: 1.24.0, 1.34.0
> Reporter: Miroslav Smiljanic
> Assignee: Andrei Dulceanu
> Priority: Major
> Attachments: OAK-9256.patch, OAK-9256_2.patch, test_case.patch
>
>
> If segment has been deleted after segment reader has been initiated, that can
> go unnoticed and instead of reporting missing segment, exception
> RepositoryNotReachableException is thrown, which does not correctly describe
> the situation.
> Test case attached: [^test_case.patch]
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)