emqx icon indicating copy to clipboard operation
emqx copied to clipboard

fix: cluster/local-override.conf does not take effect at vm.args/app.config

Open zhongwencool opened this issue 2 years ago • 3 comments

Config changes such as log levels etc can be applied from dashboard in realtime. However due to the sys.config (or app.config) generation did not take cluster-override (nor local-override) into account. such config change are not persisted.

This PR tries to include both cluster and local overrides into config generation stage.

  • [x] Verify space is allowed in data_dir config (and env override)
  • [ ] Fix emqx.cmd for Windows

zhongwencool avatar Sep 05 '22 14:09 zhongwencool

Pull Request Test Coverage Report for Build 3049662246

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 33 unchanged lines in 12 files lost coverage.
  • Overall coverage decreased (-0.03%) to 77.361%

Files with Coverage Reduction New Missed Lines %
apps/emqx_conf/src/emqx_conf_schema.erl 1 92.31%
apps/emqx_dashboard/src/emqx_dashboard_monitor.erl 1 69.44%
apps/emqx/src/emqx_broker.erl 1 81.87%
apps/emqx/src/emqx_cm.erl 1 88.99%
apps/emqx/src/emqx_limiter/src/emqx_limiter_schema.erl 1 85.92%
apps/emqx/src/emqx_logger_textfmt.erl 1 47.37%
apps/emqx/src/emqx_message.erl 1 94.12%
apps/emqx/src/emqx_router_utils.erl 1 60.47%
apps/emqx_gateway/src/mqttsn/emqx_sn_frame.erl 2 64.04%
apps/emqx/src/persistent_session/emqx_persistent_session.erl 2 93.01%
<!-- Total: 33
Totals Coverage Status
Change from base Build 3049512272: -0.03%
Covered Lines: 20626
Relevant Lines: 26662

💛 - Coveralls

coveralls avatar Sep 05 '22 15:09 coveralls

fix emqx.cmd for windows too. also: test space in data dir.

/data1/test good/ is ok.

I'm not familiar with cmd on windows, I don't have a windows environment to debug, maybe find someone to help this out.

zhongwencool avatar Sep 06 '22 06:09 zhongwencool

will fix windows in another PR.

zmstone avatar Sep 15 '22 09:09 zmstone

as discussed. we will need to fix it in a different approach. the hocon_cli is not quite helpful in this case. we'll need to perform config generation just like how emqx_config:init_load does:

  1. load base config (emqx.conf + merge envs)
  2. read data_dir from loaded base config, so we know where the {cluster|loca}-override.conf files are, and also know to generate the app.<time>.config file.
  3. applycluster-overrides.conf + local-overrides.conf on top of the base config
  4. generate app.

zmstone avatar Dec 27 '22 12:12 zmstone