[MXS-4944] Logically identical runtime configurations are not erased Created: 2024-01-19  Updated: 2024-02-06

Status: Open
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 6.4.13, 22.08.11, 23.02.8, 23.08.4
Fix Version/s: None

Type: Bug Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
PartOf
is part of MXS-4761 Upgrade Risk Assessment Tool In Progress
Sprint: MXS-SPRINT-201

 Description   

If a runtime modification is done that is subsequently reverted and the configuration is logically identical to how it was on startup, the overriding file still remains. The desired behavior would be that only modifications that are meaningful should be persisted and configurations that are logically identical are discarded automatically.



 Comments   
Comment by markus makela [ 2024-02-06 ]

With the way the configuration processing happens on startup right now, this is not simple to implement.

The first obstacle is the way the configuration processing happens right at process startup. If there is a stored configuration file for an object, it completely overwrites the one in the base section and the object that would've been constructed from the static configuration section will never exist. This means that the object after startup cannot be used as the baseline to which future configuration states are compared to as it may already be in a configuration state that's not from the static configuration. One option would be to do the initialization in two steps: first from the static configuration and then from the dynamic configuration. This would complicate the current configuration processing procedure but doing the startup in two phases would make it a little bit easier to deal with. This would result in the most accurate comparison as the object's themselves would produce the configuration state that is compared.

Another alternative that does not require changes to how the startup is done is to simply do it on the configuration level. The static configuration data is kept alive (or if it isn't it's trivial to do so) and it can be used to detect when the dynamic configuration is identical to the static one. Since the generated configuration sections are complete configurations, they should produce a relatively stable configuration that can be used for literal comparisons. Problems that will be seen with this approach are the elimination of values that are explicit in one configuration and implicit in another. Some examples of these are variables that are set to the module's default values and variables that are enabled in one but aren't in other but would be implicitly enabled by another. Type conversions would also have to be done to generate a "normalized" configuration. The values 3600s, 60m and 1h are all equivalent which means even the static configuration still needs to be processed before it can be used for comparisons. One thing that can be leveraged is the mxs::Configuration object that could do the type comparisons and report whether the values are identical.

Generated at Thu Feb 08 04:32:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.