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 2019/12/16 06:30:56 UTC

[GitHub] [couchdb] nickva commented on a change in pull request #2363: Switch make elixir to use n = 1

nickva commented on a change in pull request #2363: Switch make elixir to use n = 1
URL: https://github.com/apache/couchdb/pull/2363#discussion_r358069529
 
 

 ##########
 File path: test/elixir/test/reshard_basic_test.exs
 ##########
 @@ -156,8 +156,8 @@ defmodule ReshardBasicTest do
     resp = Couch.get("/#{db}/_shards")
     assert resp.status_code == 200
     shards = resp.body["shards"]
-    assert node1 not in shards["00000000-7fffffff"]
-    assert node1 not in shards["80000000-ffffffff"]
+    # assert node1 not in shards["00000000-7fffffff"]
 
 Review comment:
   Still valid. But maybe better to replace the checks with 
   
   ```
       assert node1 not in Map.get(shards, "00000000-7fffffff", [])
       assert node1 not in Map.get(shards, "80000000-ffffffff", [])
   ```
   
   What that means is before we were checking that after those ranges were split, the copies from the original node and range were gone. With other nodes in that range on node2 and node3, shards[00..-7f..] was returning a list of [node2, node3]. Then with n=1,there are no copies in the those ranges on any nodes so `shards[...]` was failing. The fix is to do a `get` with a default value of `[]`, so it would work on both n=1 and n>1

----------------------------------------------------------------
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