Uploaded image for project: 'Couchbase Ruby client library'
  1. Couchbase Ruby client library
  2. RCBC-342

Support for Serverless Execution Environments

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Done
    • None
    • 3.4.0
    • library

    Description

      Refer to CBD-3502

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            avsej Sergey Avseyev added a comment - - edited

            Testing

            brew install coredns
            

            Create db.example.org with the following content

            $ORIGIN example.org.
            @	3600 IN	SOA sns.dns.icann.org. noc.dns.icann.org. (
            				2017042745 ; serial
            				7200       ; refresh (2 hours)
            				3600       ; retry (1 hour)
            				1209600    ; expire (2 weeks)
            				3600       ; minimum (1 hour)
            				)
             
            	3600 IN NS a.iana-servers.net.
            	3600 IN NS b.iana-servers.net.
             
            _couchbase._tcp 10800 IN SRV 10 10 11210 localhost.
            

            Create Corefile with the following content

            example.org {
                file db.example.org
                log
            }
            

            Run coredns

            $ coredns -dns.port=1053
            example.org.:1053
            CoreDNS-1.10.0
            darwin/amd64, go1.19.1, 
            

            In C++SDK, it is possible to override dns_nameserver and dns_port to "127.0.0.1" and "1053"

            https://github.com/couchbase/couchbase-ruby-client/blob/decbd9d0401a2ef7898b9b60831484b934499e3d/ext/couchbase.cxx#L1917

            origin.options().dns_config = couchbase::core::io::dns_config("127.0.0.1", 1053);
            

            The way how I verify it just for C++SDK:

            1) setup some infinite workload, something equivalent to

            while (true) {
              collection.get("foo")
              sleep(0.1)
            }
            

            2) let it bootstrap using local DNS with connection string "couchbase://example.org" (note that the coredns configured to resolve it to "localhost", so the cluster should be listening on localhost)

            3) while keeping running workload, stop coredns, and replace in file "db.example.org"

            _couchbase._tcp 10800 IN SRV 10 10 11210 localhost.
            

            with something that will resolve to invalid address like:

            _couchbase._tcp 10800 IN SRV 10 10 11210 google.com.
            

            4) start coredns with updated config

            5) stop couchbase server, now the script will start reconnecting sockets (the ops might timeout, but just ingore that), between connection attempts, the C++SDK core will also do DNS SRV refresh, but will get wrong address "google.com" which obviously does not have running server.

            6) wait for a while and start couchbase server

            7) rollback changes in DNS config and restart coredns

            8) after some time, SDK will get new location "localhost" from DNS SRV and re-establish connection. This is expected behavior.

            avsej Sergey Avseyev added a comment - - edited Testing brew install coredns Create db.example.org with the following content $ORIGIN example.org. @ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. ( 2017042745 ; serial 7200 ; refresh (2 hours) 3600 ; retry (1 hour) 1209600 ; expire (2 weeks) 3600 ; minimum (1 hour) )   3600 IN NS a.iana-servers.net. 3600 IN NS b.iana-servers.net.   _couchbase._tcp 10800 IN SRV 10 10 11210 localhost. Create Corefile with the following content example.org { file db.example.org log } Run coredns $ coredns -dns.port=1053 example.org.:1053 CoreDNS-1.10.0 darwin/amd64, go1.19.1, In C++SDK, it is possible to override dns_nameserver and dns_port to "127.0.0.1" and "1053" https://github.com/couchbase/couchbase-ruby-client/blob/decbd9d0401a2ef7898b9b60831484b934499e3d/ext/couchbase.cxx#L1917 origin.options().dns_config = couchbase::core::io::dns_config("127.0.0.1", 1053); The way how I verify it just for C++SDK: 1) setup some infinite workload, something equivalent to while (true) { collection.get("foo") sleep(0.1) } 2) let it bootstrap using local DNS with connection string "couchbase://example.org" (note that the coredns configured to resolve it to "localhost", so the cluster should be listening on localhost) 3) while keeping running workload, stop coredns, and replace in file "db.example.org" _couchbase._tcp 10800 IN SRV 10 10 11210 localhost. with something that will resolve to invalid address like: _couchbase._tcp 10800 IN SRV 10 10 11210 google.com. 4) start coredns with updated config 5) stop couchbase server, now the script will start reconnecting sockets (the ops might timeout, but just ingore that), between connection attempts, the C++SDK core will also do DNS SRV refresh, but will get wrong address "google.com" which obviously does not have running server. 6) wait for a while and start couchbase server 7) rollback changes in DNS config and restart coredns 8) after some time, SDK will get new location "localhost" from DNS SRV and re-establish connection. This is expected behavior.
            Dimitris.Christodoulou Dimitris Christodoulou added a comment - Implemented in C++ core through https://github.com/couchbase/couchbase-ruby-client/pull/57 and https://github.com/couchbase/couchbase-ruby-client/pull/58

            People

              Dimitris.Christodoulou Dimitris Christodoulou
              arun.vijayraghavan Arun Vijayraghavan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty