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

Improve robustness of changes to memcached network interfaces configuration

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • backlog
    • None
    • ns_server
    • None
    • 1

    Description

      We need to improve the ability to report a clear error to user when memcached fail to listen to a port. Ideally, we need an independent and robust control path channel between memcached and ns_server that is independent of the ports used for datapath. Any failure to setup or change to use a port will be reported back on that channel, and ns_server can report that to the user.

      One proposal presented in MB-39620 and has a few challenges (possible race, local encryption). An alternative is to use Unix Domain Socket (UDS) for local IPC. The advantages : 1) It is secure and efficient (no encryption needed). 2) No failures due to taken port. 3) Lightweight and portable.

      Erlang has support for UDS, but only in linux. Windows has UDS support, but only since 2018 (does not cover 2016 server). But these limitations can be addressed by creating our own Erlang NIF (example: https://github.com/saleyn/euds), and even if we want to support earlier versions of windows, we can, by using Named Pipes instead.

      The common implementation can be a library that can be used for both in NS_SERVER Erlang NIF and a wrapper implementation in C/C++ by memcached. It is preferred that ns_server acts as the server and memcached connects to it on bootstrapping. From the point of successful connection, both sides can read and write. It is than that NS_SERVER can post control channel commands, such as network interface changes.

      The usage of UDS can provide a good solution to local encryption requirement as it is both secure and efficient.

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-46863
          # Subject Branch Project Status CR V

          Activity

            People

              dfinlay Dave Finlay
              steve.watanabe Steve Watanabe
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change

                  PagerDuty