[
https://issues.apache.org/jira/browse/OAK-1849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14056061#comment-14056061
]
Amit Jain commented on OAK-1849:
--------------------------------
When doing GC for the hetrogeneous case as described above, we need a way to
check that all the disparate cluster/nodes sharing the data store have marked
used references before sweeping the data store of garbage blobs.
>From an offline discussion with [~tmueller] the following approach was
>identified.
# Need a {{repositoryId}} which identifies disparate clusters to the DataStore.
## For the DocumentNodeStore we can generate a UUID and keep it in Mongo to be
used by all connected cluster nodes.
## Need to check the mechanism for the SegmentNodeStore.
# Register this in the DataStore for all clusters sharing it.
## Create a file at the root {{repository-<repositoryId>.txt}} for each unique
{{repositoryId}}, this can have some additional repository info stored in the
file.
# When running the GC {{mark}} phase on each cluster, a file
{{referenced-<repositoryId>-<timestamp>.txt}} created which tracks all marked
references.
# When the GC {{sweep()}} phase is run, before continuing it is ensured that
all repositories have marked references being used.
## Only deleting the blobs whose last modified timestamp is older than the
oldest references file read, by a configurable period (currently it is set to
24 hours).
## Removing the references-* files at the end of a successful {{sweep()}}.
> DataStore GC support for heterogeneous deployments using a shared datastore
> ---------------------------------------------------------------------------
>
> Key: OAK-1849
> URL: https://issues.apache.org/jira/browse/OAK-1849
> Project: Jackrabbit Oak
> Issue Type: Bug
> Reporter: Amit Jain
>
> If the deployment is such that there are 2 or more different instances with a
> shared datastore, triggering Datastore GC from one instance will result in
> blobs used by another instance getting deleted, causing data loss.
--
This message was sent by Atlassian JIRA
(v6.2#6252)