[
https://issues.apache.org/jira/browse/OAK-6453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16129467#comment-16129467
]
Vikas Saurabh edited comment on OAK-6453 at 8/17/17 1:12 AM:
-------------------------------------------------------------
[~chetanm], can you please review the [script|^IndexImportScript.groovy].
I've verified that this works for a import of single index (although, the code
should work in general... I just tested with one) on an AEM setup with oak
1.6.1.
Notable difference from oak-run IndexImporter in 1.8 branch:
* purges {{:data}} and {{:status}} before import
* only imports {{:data}} node
* indexes all indices in a single temp lane
TODO:
* verify with import of oob-reindex-of-multiple-indices
* verify with older branches
** IndexDefinition ctor in 1.4 (and older too I guess) doesn't take index-path
Rough sketch of process to use:
# Create a checkpoint on a running instance
# Use this checkpoint to reindex using oak-run index command
# -Pause async indexing for all lanes that can get affected with the import-
# Run attached script with path of oob-indexed-data-path in Osgi script console
with groovy installed \[0], \[1]
# -Resume the async indices-
# Verify things look ok
# Delete checkpoint created in Step1
_UPDATE_
Interestingly, despite 1.4 not having {{IndexDefinition}} ctor taking
indexPath, the script works on 1.4 instance too. I had to bump {{reindexCount}}
though (as it interfered with locally copied index files)
-1.2, otoh, seems a bit far off atm though.-
_UPDATE2_
* Update the script to now try multiple {{OakDirectory}} ctors which allowed
the script to work at 1.2.2. I haven't tested recent 1.2 branch builds, but
that should also work as far as I can see the code.
* Need to see when did oak-lucene become fairly mature in 1.0 branch. I don't
intend to have the script support very old 1.0 releases ([~chetanm], I'm
guessing this is fine)
* Since step4 in steps above already merges without concurrency check AND that
pausing async indexing isn't reliable anyway, I think we can get rid of step3
and step5 - in worst case, we'd have a failed async indexing cycle on the setup.
\[0]:
http://central.maven.org/maven2/org/apache/felix/org.apache.felix.webconsole.plugins.scriptconsole/1.0.2/org.apache.felix.webconsole.plugins.scriptconsole-1.0.2.jar
\[1]:
http://central.maven.org/maven2/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar
was (Author: catholicon):
[~chetanm], can you please review the [script|^IndexImportScript.groovy].
I've verified that this works for a import of single index (although, the code
should work in general... I just tested with one) on an AEM setup with oak
1.6.1.
Notable difference from oak-run IndexImporter in 1.8 branch:
* purges {{:data}} and {{:status}} before import
* only imports {{:data}} node
* indexes all indices in a single temp lane
TODO:
* verify with import of oob-reindex-of-multiple-indices
* verify with older branches
** IndexDefinition ctor in 1.4 (and older too I guess) doesn't take index-path
Rough sketch of process to use:
# Create a checkpoint on a running instance
# Use this checkpoint to reindex using oak-run index command
# Pause async indexing for all lanes that can get affected with the import
# Run attached script with path of oob-indexed-data-path in Osgi script console
with groovy installed \[0], \[1]
# Resume the async indices
# Verify things look ok
# Delete checkpoint created in Step1
_UPDATE_
Interestingly, despite 1.4 not having {{IndexDefinition}} ctor taking
indexPath, the script works on 1.4 instance too. I had to bump {{reindexCount}}
though (as it interfered with locally copied index files)
1.2, otoh, seems a bit far off atm though.
\[0]:
http://central.maven.org/maven2/org/apache/felix/org.apache.felix.webconsole.plugins.scriptconsole/1.0.2/org.apache.felix.webconsole.plugins.scriptconsole-1.0.2.jar
\[1]:
http://central.maven.org/maven2/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar
> Script to import oak-run generated indexing to older Oak setup
> --------------------------------------------------------------
>
> Key: OAK-6453
> URL: https://issues.apache.org/jira/browse/OAK-6453
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: indexing, run
> Reporter: Chetan Mehrotra
> Assignee: Vikas Saurabh
> Labels: docs-impacting
> Fix For: 1.8
>
> Attachments: IndexImportScript.groovy
>
>
> The indexing tooling implemented in OAK-6081 can be used to perform reindex
> and import the indexes for any Oak 1.7+ setups. For older setups we would be
> using 2 phase approach
> # Perform [out-of-band
> indexing|https://jackrabbit.apache.org/oak/docs/query/oak-run-indexing.html#out-of-band-indexing].
> This can be done via oak-run from 1.7.x against any older version of Oak
> # Import index - For this step we cannot use oak-run from trunk for older
> branches as write operations would not be compatible with older version of
> Oak.
> For import then we have 2 options either
> # backport all the work in OAK-6271 to older branch
> # OR implement a script which can be used with oak-run or Felix Script
> Console to just import the lucene index with any other manual step
> Purpose of this task is to implement such a script
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)