Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-57682

INI writes are not atomic

    XMLWordPrintable

Details

    • 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

        Activity

          People

            neelima.premsankar Neelima Premsankar
            neelima.premsankar Neelima Premsankar
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty