You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2019/04/01 19:58:22 UTC

[couchdb] branch reshard updated: [fixup|mem3_reshard_job] use explicit split ranges in the change log

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

vatamane pushed a commit to branch reshard
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/reshard by this push:
     new 6e2fba8  [fixup|mem3_reshard_job] use explicit split ranges in the change log
6e2fba8 is described below

commit 6e2fba84ed4ae51d9fc27ac37128ee9009a9048a
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Mon Apr 1 15:57:30 2019 -0400

    [fixup|mem3_reshard_job] use explicit split ranges in the change log
    
    ```
            [
                "split",
                "00000000-ffffffff",
                [
                    "00000000-7fffffff",
                    "80000000-ffffffff"
                ],
                "node3@127.0.0.1"
            ]
    ```
---
 src/mem3/src/mem3_reshard_dbdoc.erl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mem3/src/mem3_reshard_dbdoc.erl b/src/mem3/src/mem3_reshard_dbdoc.erl
index a9de818..7eb3e9f 100644
--- a/src/mem3/src/mem3_reshard_dbdoc.erl
+++ b/src/mem3/src/mem3_reshard_dbdoc.erl
@@ -169,7 +169,8 @@ update_shard_props({Props0}, #shard{} = Source, [#shard{} | _] = Targets) ->
 
     Changelog = couch_util:get_value(<<"changelog">>, Props2, []),
     {Node, Range} = {node_key(Source), range_key(Source)},
-    ChangelogEntry = [[<<"split">>, Range, length(Targets), Node]],
+    TRanges = [range_key(T) || T <- Targets],
+    ChangelogEntry = [[<<"split">>, Range, TRanges, Node]],
     ChangelogKV = {<<"changelog">>, Changelog ++ ChangelogEntry},
     Props3 = lists:keyreplace(<<"changelog">>, 1, Props2, ChangelogKV),