Details
-
Bug
-
Resolution: Fixed
-
Major
-
7.1.2
-
Triaged
-
0
-
No
Description
(1) Writes to the INI file are not atomic in couch_config_writer:save_to_file.
This may cause the INI file to be corrupted.
This was likely the cause for:
CBSE-14589
CBSE-14099
Also need to check other places where file:write_file is used. It looks like misc:atomic_write_file is used in many places in ns_server but not all. Need to check whether this is sufficient or atomic writes are necessary in other places.
(2) In addition, in ns_server, we don't check the status of a couch_config:set to confirm it succeeded. It may silently fail and corrupt the INI in the process.
- On 7.2 and above, we at least check the status of couch_config:set when the db/index directories are updated.
On older releases, we ignore the status of couch_config:set when db/index directories are updated. - On all releases, we ignore the status of couch_config:set while setting log level.
Attachments
For Gerrit Dashboard: MB-57682 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
193326,3 | MB-57682: Write to INI file atomically. | unstable | couchdb | Status: MERGED | +2 | +1 |
193452,1 | MB-57682: Check that write to INI file succeeds. | master | ns_server | Status: ABANDONED | 0 | +1 |
193453,2 | MB-57682: Verify couch_config:set succeeded. | neo | ns_server | Status: MERGED | +2 | +1 |
193736,2 | MB-57682: Write to INI file atomically. | neo | couchdb | Status: MERGED | +2 | +1 |
193752,2 | Merge remote-tracking branch 'couchbase/neo' | master | ns_server | Status: MERGED | +2 | +1 |