This is an automated email from the ASF dual-hosted git repository.

chewbranca pushed a commit to branch 3631-3.x-fix-pq-shard-creation
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 2ae00b052b25f23565a8746798cf7c5c5830e5cf
Author: Russell Branca <[email protected]>
AuthorDate: Thu Jun 17 11:32:18 2021 -0700

    Fix fabric_util:get_db shard creation
---
 src/fabric/src/fabric_util.erl | 5 ++++-
 src/mem3/src/mem3_util.erl     | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/fabric/src/fabric_util.erl b/src/fabric/src/fabric_util.erl
index 8aa14e7..88f439b 100644
--- a/src/fabric/src/fabric_util.erl
+++ b/src/fabric/src/fabric_util.erl
@@ -105,7 +105,10 @@ get_db(DbName, Options) ->
     Nodes = [node()|erlang:nodes()],
     Live = [S || #shard{node = N} = S <- Shards, lists:member(N, Nodes)],
     Factor = list_to_integer(config:get("fabric", "shard_timeout_factor", 
"2")),
-    get_shard(Live, [{create_if_missing, true} | Options], 100, Factor).
+    DbOpts = mem3_shards:opts_for_db(DbName),
+    Options1 = [{create_if_missing, true} | Options],
+    Options2 = mem3_util:merge_opts(DbOpts, Options1),
+    get_shard(Live, Options2, 100, Factor).
 
 get_shard([], _Opts, _Timeout, _Factor) ->
     erlang:error({internal_server_error, "No DB shards could be opened."});
diff --git a/src/mem3/src/mem3_util.erl b/src/mem3/src/mem3_util.erl
index 28cb177..0209835 100644
--- a/src/mem3/src/mem3_util.erl
+++ b/src/mem3/src/mem3_util.erl
@@ -16,7 +16,7 @@
     n_val/2, q_val/1, to_atom/1, to_integer/1, write_db_doc/1, delete_db_doc/1,
     shard_info/1, ensure_exists/1, open_db_doc/1, get_or_create_db/2]).
 -export([is_deleted/1, rotate_list/2]).
--export([get_shard_opts/1, get_engine_opt/1, get_props_opt/1]).
+-export([get_shard_opts/1, get_engine_opt/1, get_props_opt/1, merge_opts/2]).
 -export([get_shard_props/1, find_dirty_shards/0]).
 -export([
     iso8601_timestamp/0,

Reply via email to