How to override install run modes at startup?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to override install run modes at startup?

Bertrand Delacretaz
Hi,

In some upgrade cases I need to be able to force an install runmode to
change - for example with this:

  sling.run.mode.install.options = foo,bar

which makes foo and bar mutually exclusive. I have an existing
instance with a foo run mode that needs to be switched to bar at
startup.

IIUC this is currently not possible except by deleting the
sling.options.file which is not good - that file might include other
important settings.

How should we make that possible?

One option is to specify the new run mode like FORCE:bar to express
that we want to override the stickiness of the foo run mode, but maybe
someone has a better idea?

-Bertrand
Reply | Threaded
Open this post in threaded view
|

Re: How to override install run modes at startup?

Carsten Ziegeler
Am 07.01.15 um 18:26 schrieb Bertrand Delacretaz:

> Hi,
>
> In some upgrade cases I need to be able to force an install runmode to
> change - for example with this:
>
>   sling.run.mode.install.options = foo,bar
>
> which makes foo and bar mutually exclusive. I have an existing
> instance with a foo run mode that needs to be switched to bar at
> startup.
>
> IIUC this is currently not possible except by deleting the
> sling.options.file which is not good - that file might include other
> important settings.
>
> How should we make that possible?
>
> One option is to specify the new run mode like FORCE:bar to express
> that we want to override the stickiness of the foo run mode, but maybe
> someone has a better idea?
>
I think we shouldn't make this possible :) The stickyness of the options is,
there for a good reason as usually switching is not working. If we now
provide an easy way to do exactly that, people will use it and run into
trouble.

I would rather go with a simple tool, that reads the sling.options.file,
changes it and writes it back.

Carsten
--
Carsten Ziegeler
Adobe Research Switzerland
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: How to override install run modes at startup?

Bertrand Delacretaz
Hi,

On Thursday, January 8, 2015, Carsten Ziegeler <[hidden email]> wrote:

> ...The stickyness of the options is,
> there for a good reason as usually switching is not working. If we now
> provide an easy way to do exactly that, people will use it and run into
> trouble....

Ok, I agree that this shouldn't be too easy but creating a separate tool as
you suggest won't work for my use case. I need to do this in automated
testing and locating and running external tools is a pain in that context.
>
>
How about using a framework property such as
sling.remove.runmodes=foo,someOtherRunmode ?
This clearly exposes what's happening and we can log a warning to expose
the potential issues.

If we don't implement something like this people will just delete the
sling.options.file which is worse IMO.

-Bertrand
Reply | Threaded
Open this post in threaded view
|

Re: How to override install run modes at startup?

Felix Meschberger-3
Hi

Ok, according to an off-line discussion, this is really related to the question of how to make sure Sling starts in the correct runmode after having migrated the JCR repository from, say, Jackrabbit 2 to Oak.

First I think, the migration of the persistence is an explicit and different step from the upgrade of the Sling application (keeping the persistence). So, I think to migrate the persistence, a special tool is needed in any case.

I thus think, that this standalone tool changing the persistence should be extended to go into the runmode persistence file and update the respective flag. Such that from a POV of Sling, the persistence is just there as expected.

WDYT ?

Regards
Felix

> Am 08.01.2015 um 10:51 schrieb Bertrand Delacretaz <[hidden email]>:
>
> Hi,
>
> On Thursday, January 8, 2015, Carsten Ziegeler <[hidden email]> wrote:
>
>> ...The stickyness of the options is,
>> there for a good reason as usually switching is not working. If we now
>> provide an easy way to do exactly that, people will use it and run into
>> trouble....
>
> Ok, I agree that this shouldn't be too easy but creating a separate tool as
> you suggest won't work for my use case. I need to do this in automated
> testing and locating and running external tools is a pain in that context.
>>
>>
> How about using a framework property such as
> sling.remove.runmodes=foo,someOtherRunmode ?
> This clearly exposes what's happening and we can log a warning to expose
> the potential issues.
>
> If we don't implement something like this people will just delete the
> sling.options.file which is worse IMO.
>
> -Bertrand

Reply | Threaded
Open this post in threaded view
|

Re: How to override install run modes at startup?

Bertrand Delacretaz
On Thu, Jan 8, 2015 at 12:10 PM, Felix Meschberger <[hidden email]> wrote:
> ...I thus think, that this standalone tool changing the persistence should be
> extended to go into the runmode persistence file and update the respective flag.
> Such that from a POV of Sling, the persistence is just there as expected....

I agree, that's my use case indeed and special processing is needed to
migrate the Jackrabbit data to Oak anyway, using Oak's conversion tool
[1].

So it makes sense to include the runmode change processing with that
tool so that the data conversion goes along with the runmode migration
- I'll probably create an example in my whiteboard that people can use
if they need to do that.

-Bertrand

[1] https://svn.apache.org/repos/asf/jackrabbit/oak/trunk/oak-upgrade/