Bug 1707731
| Summary: | [Upgrade] Config files are not upgraded to new version | |||
|---|---|---|---|---|
| Product: | [Community] GlusterFS | Reporter: | Aravinda VK <avishwan> | |
| Component: | geo-replication | Assignee: | Shwetha K Acharya <sacharya> | |
| Status: | CLOSED NEXTRELEASE | QA Contact: | ||
| Severity: | unspecified | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | mainline | CC: | bugs | |
| Target Milestone: | --- | Keywords: | Reopened | |
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1708064 1764003 1764171 (view as bug list) | Environment: | ||
| Last Closed: | 2019-07-22 06:45:56 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1708064, 1764003, 1764171 | |||
|
Description
Aravinda VK
2019-05-08 08:30:23 UTC
## Reading Old format:
Config file consists of a section named "__section_order__", read that to get the order of different section. Sort the section based on order(based on values), and prepare a dict with values updated from each section.
For example:
```
[__section_order__]
sec1=0
sec2=2
sec3=1
[sec1]
log_level = INFO
[sec2]
log_level = DEBUG
[sec3]
log_level = ERROR
```
configs = {}
for sec in sorded_sections():
for item_key, item_value in sec.items:
configs[item_key] = item_value
With this logic, `log_level` will have final value "DEBUG"
## Upgrade:
During Geo-rep start(In gsyncd.py):
- Read the session config and see it is a new format or old
- If it is old format, read the config as explained above
- Compare the configs collected and write to new config only if it is different from Default configs
- Reload the new config
To get the old format config,
- Install old version of Glusterfs(<4) and create a geo-rep session.
- Set some configurations in Geo-rep
- Copy the config file for reference
- Old parsing code can be referred here https://github.com/gluster/glusterfs/blob/release-3.13/geo-replication/syncdaemon/configinterface.py
REVIEW: https://review.gluster.org/22894 (geo-rep: Upgrading config file to new version) posted (#1) for review on master by Shwetha K Acharya REVIEW: https://review.gluster.org/22894 (geo-rep: Upgrading config file to new version) merged (#7) on master by Sunny Kumar REVIEW: https://review.gluster.org/22982 (geo-rep: Test case for upgrading config file) posted (#1) for review on master by Shwetha K Acharya REVIEW: https://review.gluster.org/22982 (geo-rep: Test case for upgrading config file) merged (#5) on master by Sunny Kumar |