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

Miroslav Smiljanic commented on OAK-9914:
-----------------------------------------

The second Oak process started in read-only mode should not start recovery for 
the last archive when it is not closed because the first process is actively 
writing there. 

It 
[happens|https://github.com/apache/jackrabbit-oak/blob/jackrabbit-oak-1.44.0/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureArchiveManager.java#L114]
 because "closed" marker is missing.

Right now, I am thinking about two possible approaches.

In the first one, the exception should not be thrown if the archive being 
inspected is the latest one:  [^AzureArchiveManager.patch] 

Another approach could be to use system property to instruct  
AzureArchiveManager not to throw the exception. The property can be used, for 
example, in *oak-run* that starts Oak process in read-only mode.

I was also thinking of checking for the presence of the blob "repo.lock" and 
its lease state but did not like the idea.
 

> Starting Oak with Azure persistence in read-only mode while another Oak 
> process is running will initiate repo recovery
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: OAK-9914
>                 URL: https://issues.apache.org/jira/browse/OAK-9914
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: segment-azure
>    Affects Versions: 1.44.0
>            Reporter: Miroslav Smiljanic
>            Priority: Major
>         Attachments: AzureArchiveManager.patch, OAK-9914_test.patch
>
>
> The sequence of events:
>  # Oak process with read/write file store utilizing Azure persistence is 
> already running 
>  # New Oak process is starting up, with read-only file store using Azure 
> persistence and the same storage account and container like the previous Oak 
> process
>  ## New Oak process starts recovery procedure for the last tar directory that 
> is not closed
> Scenario presented in the attached test case:
> [^OAK-9914_test.patch] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to