You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/02/26 19:20:22 UTC

[GitHub] [couchdb] davisp opened a new pull request #2602: Prototype/fdb layer rebase

davisp opened a new pull request #2602: Prototype/fdb layer rebase
URL: https://github.com/apache/couchdb/pull/2602
 
 
   Opening this as a PR so people can see the diff between a rebased `prototype/fdb-layer` on top of master. I took notes that are pasted below while doing the rebase that logs all commits (in the original `prototype/fdb-layer`) that conflicted with `master` as well as a short description on the remedy/severity of the conflict.
   
   609a45ddb Update build system for FoundationDB
   ---
   
   Both of these conflicts are trivial. The Makefile change is to just
   merge some new options for the exunit run. The rebar.config.script
   is just a conflict when adding erlfdb as a dependency.
   
     * Makefile
     * rebar.config.script
   
   9178462f7 Disable eunit test suite in fabric
   ---
   
   All of these are just conflicts on the commented out test suite.
   
     * src/fabric/src/fabric_db_create.erl
     * src/fabric/src/fabric_doc_open.erl
     * src/fabric/src/fabric_doc_open_revs.erl
     * src/fabric/src/fabric_doc_purge.erl
     * src/fabric/src/fabric_doc_update.erl
     * src/fabric/src/fabric_view.erl
     * src/fabric/test/eunit/fabric_rpc_purge_tests.erl
   
   0cf5f463d Start switching chttpd HTTP endpoints to fabric2
   ---
   
   Trivial conflict, s/parse_params/parse_body_and_query/
   
     * src/chttpd/src/chttpd_db.erl
   
   393168509 Implement `_users` db authentication
   ---
   
   Trivial conflict, merge read-only security objects on _users db.
   
     * src/chttpd/src/chttpd_db.erl
   
   0c2d674d6 CouchDB background jobs
   ---
   
   Trivial conflict, added the couch_jobs config section
   
     * rel/overlay/etc/default.ini
   
   40561bc83 Remove tests for deprecated features.
   ---
   
   Trivial, this commit is just deleting tests that are no longer
   applicable.
   
     * test/elixir/test/partition_crud_test.exs
     * test/elixir/test/partition_ddoc_test.exs
     * test/elixir/test/partition_helpers.exs
     * test/elixir/test/partition_mango_test.exs
     * test/elixir/test/partition_size_limit_test.exs
     * test/elixir/test/partition_size_test.exs
     * test/elixir/test/partition_view_update_test.exs
     * test/elixir/test/reshard_all_docs_test.exs
     * test/elixir/test/reshard_basic_test.exs
     * test/elixir/test/reshard_changes_feed.exs
     * test/elixir/test/reshard_helpers.exs
   
   a8e306d5d Implement _all_dbs/_all_docs API parameters
   ---
   
   Trivial, s/parse_params/parse_body_and_query/
   
     * src/chttpd/src/chttpd_db.erl
   
   d42d9b75e Expose ICU ucol_getSortKey
   ---
   
   Trivial, conflict was over adding tests to the bottom of the module
   
     * src/couch/test/eunit/couch_util_tests.erl
   
   d5d5b5fae Implement _all_docs/queries
   ---
   
   Non trivial, need to double check this one
   
     * src/chttpd/src/chttpd_db.erl
   
   5c3517ab6 Fix _changes heartbeat option
   ---
   
   Trivial, s/timeout/{timeout, _ResponseType}/
   
     * src/chttpd/src/chttpd_db.erl
   
   583d7feea Pass contexts to fabric2_db functions
   ---
   
   Trivial, same s/parse_params/parse_body_and_query/ conflict
   
     * src/chttpd/src/chttpd_db.erl
   
   e93d1b450 Add ctrace application
   ---
   
   Trivial, just merge new deps/ignores into changed deps/ignores. I.e.,
   changes are orthogonal but occur near each other.
   
     * .gitignore
     * rebar.config.script
   
   77e6901ae Silence test suite warning message about crypto
   ---
   
   Skipped. Simple patch that was done independently on master but
   without a comment.
   
     * src/couch/src/test_util.erl
   
   ea23fa1bf Bump ioq to 2.1.3
   ---
   
   Theoretically trivial dep change but need to double check why the
   original patch has hqueue/smoosh/ken listed as deps, but not in the merge.
   
     * rebar.config.script
   
   bd3c021bd Support jaeger http reporter
   ---
   
   Trivial change to jaeger_passage version
   
     * rebar.config.script
   
   bf397366f Update httpotion to 3.1.3
   ---
   
   Skipped, master already has the httpotion update
   
     * mix.exs
     * mix.lock
     * test/elixir/lib/couch.ex
   
   8650a4e0b Support setting base_url in Couch test helper
   ---
   
   Non-trivial! Need to audit elixir test suite for calls to
   `Couch.login` to update handling the base_url parameter.
   
     * test/elixir/lib/couch.ex
   
   17055f4a4 Encode startkey/endkey for all_docs (#2538)
   ---
   
   Trivial, both added tests to the bottom of a module
   
     * test/elixir/test/all_docs_test.exs
   
   951cfd173 Sync Makefile with master (#2566)
   ---
   
   Skipped, this was a sync of Makefile to master which is what
   we're doing with this rebase.
   
     * Makefile
   
   
   ded6d6478 Revert "Support setting base_url in Couch test helper"
   ---
   
   Trivial, undoing the non-trivial merge from 8650a4e0b
   
     * test/elixir/lib/couch.ex
   
   8c75367cd Support setting base_url in Couch test helper (take 2)
   ---
   
   Non-trivial! Have to audit all Elixir calls to `Couch.login`
   
     * test/elixir/lib/couch.ex

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] iilyak commented on issue #2602: Prototype/fdb layer rebase

Posted by GitBox <gi...@apache.org>.
iilyak commented on issue #2602: Prototype/fdb layer rebase
URL: https://github.com/apache/couchdb/pull/2602#issuecomment-591986140
 
 
   The `expect` argument is only used in `./test/elixir/test/auth_cache_test.exs`
   ```
   ./test/elixir/test/auth_cache_test.exs
   59:    resp = Couch.login(user, password, :fail)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] davisp commented on issue #2602: Prototype/fdb layer rebase

Posted by GitBox <gi...@apache.org>.
davisp commented on issue #2602: Prototype/fdb layer rebase
URL: https://github.com/apache/couchdb/pull/2602#issuecomment-591677431
 
 
   Looks mostly good. We've got to go through the `Couch.login` calls in exunit tests and I have to fix chttpd_changes.erl since its based on a now outdated couch_changes.erl. Will get to that tomorrow.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] davisp merged pull request #2602: Prototype/fdb layer rebase

Posted by GitBox <gi...@apache.org>.
davisp merged pull request #2602: Prototype/fdb layer rebase
URL: https://github.com/apache/couchdb/pull/2602
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] iilyak commented on issue #2602: Prototype/fdb layer rebase

Posted by GitBox <gi...@apache.org>.
iilyak commented on issue #2602: Prototype/fdb layer rebase
URL: https://github.com/apache/couchdb/pull/2602#issuecomment-592464389
 
 
   I propose following change:
   ```
   diff --git a/src/chttpd/test/exunit/tracing_test.exs b/src/chttpd/test/exunit/tracing_test.exs
   index b50ef936e..f66fb87a2 100644
   --- a/src/chttpd/test/exunit/tracing_test.exs
   +++ b/src/chttpd/test/exunit/tracing_test.exs
   @@ -29,7 +29,7 @@ defmodule Couch.Test.OpenTracing do
   
      setup context do
        db_name = Utils.random_name("db")
   -    session = Couch.login(context.base_url, context.user, context.pass)
   +    session = Couch.login(context.user, context.pass, base_url: context.base_url)
   
        on_exit(fn ->
          delete_db(session, db_name)
   diff --git a/test/elixir/lib/couch.ex b/test/elixir/lib/couch.ex
   index cf105c743..9b577e002 100644
   --- a/test/elixir/lib/couch.ex
   +++ b/test/elixir/lib/couch.ex
   @@ -3,7 +3,6 @@ defmodule Couch.Session do
      CouchDB session helpers.
      """
   
   -  @enforce_keys [:cookie]
      defstruct [:cookie, :error, :base_url]
   
      def new(cookie, error \\ "") do
   @@ -165,26 +164,25 @@ defmodule Couch do
        login(user, pass)
      end
   
   -  def login(user, pass, expect \\ :success) do
   -    base_url = System.get_env("EX_COUCH_URL") || "http://127.0.0.1:15984"
   -    login(base_url, user, pass, expect)
   -  end
   -
   -  def login(base_url, user, pass, expect \\ :success) do
   +  def login(user, pass, options \\ []) do
   +    options = options |> Enum.into(%{})
   +    base_url = Map.get_lazy(options, :base_url, fn ->
   +      System.get_env("EX_COUCH_URL") || "http://127.0.0.1:15984"
   +    end)
        resp = Couch.post(
          "/_session",
          body: %{:username => user, :password => pass},
          base_url: base_url
        )
   -
   -    if expect == :success do
   +    if Map.get(options, :expect, :success) == :success do
          true = resp.body["ok"]
          cookie = resp.headers[:"set-cookie"]
          [token | _] = String.split(cookie, ";")
   -      %Couch.Session{cookie: token}
   +      %Couch.Session{cookie: token, base_url: base_url}
        else
          true = Map.has_key?(resp.body, "error")
   -      %Couch.Session{error: resp.body["error"]}
   +      %Couch.Session{error: resp.body["error"], base_url: base_url}
        end
      end
   +
    end
   diff --git a/test/elixir/test/auth_cache_test.exs b/test/elixir/test/auth_cache_test.exs
   index 2ba396de7..5582b2f96 100644
   --- a/test/elixir/test/auth_cache_test.exs
   +++ b/test/elixir/test/auth_cache_test.exs
   @@ -56,7 +56,7 @@ defmodule AuthCacheTest do
      end
   
      defp login_fail(user, password) do
   -    resp = Couch.login(user, password, :fail)
   +    resp = Couch.login(user, password, expect: :fail)
        assert resp.error, "Login error is expected."
      end
   ```
   
   Unfortunately I cannot test it. My attempts fail with:
   ```
   ==> chttpd (compile)
   /Users/iilyak@ca.ibm.com/dev/fdb-dbcore/src/couchdb/src/chttpd/src/chttpd_changes.erl:88: field seq_btree undefined in record mrview
   Compiling /Users/iilyak@ca.ibm.com/dev/fdb-dbcore/src/couchdb/src/chttpd/src/chttpd_changes.erl failed:
   ERROR: compile failed while processing /Users/iilyak@ca.ibm.com/dev/fdb-dbcore/src/couchdb/src/chttpd: rebar_abort
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] iilyak edited a comment on issue #2602: Prototype/fdb layer rebase

Posted by GitBox <gi...@apache.org>.
iilyak edited a comment on issue #2602: Prototype/fdb layer rebase
URL: https://github.com/apache/couchdb/pull/2602#issuecomment-592464389
 
 
   I propose following change:
   ```
   diff --git a/src/chttpd/test/exunit/tracing_test.exs b/src/chttpd/test/exunit/tracing_test.exs
   index b50ef936e..f66fb87a2 100644
   --- a/src/chttpd/test/exunit/tracing_test.exs
   +++ b/src/chttpd/test/exunit/tracing_test.exs
   @@ -29,7 +29,7 @@ defmodule Couch.Test.OpenTracing do
   
      setup context do
        db_name = Utils.random_name("db")
   -    session = Couch.login(context.base_url, context.user, context.pass)
   +    session = Couch.login(context.user, context.pass, base_url: context.base_url)
   
        on_exit(fn ->
          delete_db(session, db_name)
   diff --git a/test/elixir/lib/couch.ex b/test/elixir/lib/couch.ex
   index cf105c743..9b577e002 100644
   --- a/test/elixir/lib/couch.ex
   +++ b/test/elixir/lib/couch.ex
   @@ -3,7 +3,6 @@ defmodule Couch.Session do
      CouchDB session helpers.
      """
   
   -  @enforce_keys [:cookie]
      defstruct [:cookie, :error, :base_url]
   
      def new(cookie, error \\ "") do
   @@ -165,26 +164,25 @@ defmodule Couch do
        login(user, pass)
      end
   
   -  def login(user, pass, expect \\ :success) do
   -    base_url = System.get_env("EX_COUCH_URL") || "http://127.0.0.1:15984"
   -    login(base_url, user, pass, expect)
   -  end
   -
   -  def login(base_url, user, pass, expect \\ :success) do
   +  def login(user, pass, options \\ []) do
   +    options = options |> Enum.into(%{})
   +    base_url = Map.get_lazy(options, :base_url, fn ->
   +      System.get_env("EX_COUCH_URL") || "http://127.0.0.1:15984"
   +    end)
        resp = Couch.post(
          "/_session",
          body: %{:username => user, :password => pass},
          base_url: base_url
        )
   -
   -    if expect == :success do
   +    if Map.get(options, :expect, :success) == :success do
          true = resp.body["ok"]
          cookie = resp.headers[:"set-cookie"]
          [token | _] = String.split(cookie, ";")
   -      %Couch.Session{cookie: token}
   +      %Couch.Session{cookie: token, base_url: base_url}
        else
          true = Map.has_key?(resp.body, "error")
   -      %Couch.Session{error: resp.body["error"]}
   +      %Couch.Session{error: resp.body["error"], base_url: base_url}
        end
      end
   +
    end
   diff --git a/test/elixir/test/auth_cache_test.exs b/test/elixir/test/auth_cache_test.exs
   index 2ba396de7..5582b2f96 100644
   --- a/test/elixir/test/auth_cache_test.exs
   +++ b/test/elixir/test/auth_cache_test.exs
   @@ -56,7 +56,7 @@ defmodule AuthCacheTest do
      end
   
      defp login_fail(user, password) do
   -    resp = Couch.login(user, password, :fail)
   +    resp = Couch.login(user, password, expect: :fail)
        assert resp.error, "Login error is expected."
      end
   ```
   
   Unfortunately I cannot test it. My attempts fail with:
   ```
   ==> chttpd (compile)
   src/couchdb/src/chttpd/src/chttpd_changes.erl:88: field seq_btree undefined in record mrview
   Compiling src/couchdb/src/chttpd/src/chttpd_changes.erl failed:
   ERROR: compile failed while processing src/couchdb/src/chttpd: rebar_abort
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] davisp commented on issue #2602: Prototype/fdb layer rebase

Posted by GitBox <gi...@apache.org>.
davisp commented on issue #2602: Prototype/fdb layer rebase
URL: https://github.com/apache/couchdb/pull/2602#issuecomment-592696609
 
 
   @iilyak Thanks! I'm working on fixing that issue with the changes code. I'll pull your diff in once I've got that cleaned up.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services