You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2015/01/07 18:26:51 UTC

How to override install run modes at startup?

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

Re: How to override install run modes at startup?

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Thu, Jan 8, 2015 at 12:10 PM, Felix Meschberger <fm...@adobe.com> 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/

Re: How to override install run modes at startup?

Posted by Felix Meschberger <fm...@adobe.com>.
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 <bd...@apache.org>:
> 
> Hi,
> 
> On Thursday, January 8, 2015, Carsten Ziegeler <cz...@apache.org> 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


Re: How to override install run modes at startup?

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Thursday, January 8, 2015, Carsten Ziegeler <cz...@apache.org> 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

Re: How to override install run modes at startup?

Posted by Carsten Ziegeler <cz...@apache.org>.
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
cziegeler@apache.org