Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When doing a hot upgrade with relup release handling, the application parameters are gone. [JIRA: RIAK-3081] #880

Open
jvdvleuten opened this issue Dec 4, 2016 · 0 comments

Comments

@jvdvleuten
Copy link

When doing a hot upgrade, all application parameters are gone. When using the correct .conf file, it still misses some parameters because they are set using application:set_env/3. After the upgrade, the riak_core application is thus broken.

See this quote on the release handling manual page:

http://erlang.org/doc/design_principles/release_handling.html#id84983

Specifically, the application configuration parameters are automatically updated according to (in increasing priority order):

The data in the boot script, fetched from the new application resource file App.app
The new sys.config
Command-line arguments -App Par Val
This means that parameter values set in the other system configuration files and values set using application:set_env/3 are disregarded.

Application parameters are set and appended when starting riak_core here:

https://github.com/basho/riak_core/blob/develop/src/riak_core_app.erl#L42

I have now manually created this function and exported it, mimicking the function body:

add_bucket_defaults() ->
    %% add these defaults now to supplement the set that may have been
    %% configured in app.config
    riak_core_bucket:append_bucket_defaults(riak_core_bucket_type:defaults(default_type)),
    ok.

I then call it in my relup file as follows:

{apply,{my_app,add_bucket_defaults,[]}}

Any other more elegant ideas? Am I missing something here?

@Basho-JIRA Basho-JIRA changed the title When doing a hot upgrade with relup release handling, the application parameters are gone. When doing a hot upgrade with relup release handling, the application parameters are gone. [JIRA: RIAK-3081] Dec 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants