1. 01 Aug, 2017 1 commit
  2. 30 Jul, 2017 6 commits
  3. 29 Jul, 2017 1 commit
  4. 28 Jul, 2017 2 commits
    • Jason Yellick's avatar
      [FAB-5525] Fix configtx memory allocation bug · b3c14300
      Jason Yellick authored
      The configtx code uses an 'append(...)' against a slice, and records the
      new slice address when computing the config map.  Through sheer dumb
      luck, this code works for config groups which are only nested 2 levels
      deep, because the append call triggers a true new memory allocation.
      However, for config groups 3 levels deep (such as consortium groups),
      the append call actually re-uses the underlying memory for the slice.
      This causes the path to be corrupted internally for the consortium group
      items, and cause the wrong policy to be resolved when checking for a
      policy which has been specified relatively.
      This fix manually allocates new memory, copies it, and then appends the
      Change-Id: I0f4df619e006cdfebba60173156bda597d42a544
      Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>
    • Srinivasan Muralidharan's avatar
  5. 27 Jul, 2017 11 commits
  6. 26 Jul, 2017 18 commits
  7. 25 Jul, 2017 1 commit
    • Jason Yellick's avatar
      [FAB-5459] Recompute configmap instead of updating · 6eab9cf6
      Jason Yellick authored
      The configtx validation code works by transforming the ConfigGroup tree
      structure into a map, where each config element has a fully qualified
      key like:
        [Groups] /Channel/Application
        [Policy] /Channel/Application/Readers
      This flattened structure makes it easier to check which elements have
      been modified, as the maps may simply be iterated over, rather than
      walking the config tree.
      After applying a config update, the current config map is copied, and
      the elements which were updated are overlayed onto the old config.  This
      map is then converted back into a tree structure and serialized to be
      the new config tree.
      The current code adopts the updated config map as the current config
      map.  However, this produces the bug described in 5459.  Because the
      updated config map is the overlay of the new config onto the old
      config, the updated config may contain orphaned nodes which appear in
      the map, but which do not appear in the config tree.
      Consequently, when a subsequent update arrives, it is validated not
      only against the current config, but also against the orphaned nodes
      which are still in the updated config map.
      This CR changes the logic to discard the updated config map (which may
      contain this orphaned nodes) and instead has the config map recomputed
      every time a new config is adopted.  This is more obviously
      deterministic and mimics the way a new ordering node would initialize
      the config after being restarted.
      Note: There is no accompanying test case with this.  I had originally
      written a test case which demonstrated that nodes were orphaned in the
      updated config.  However, this is expected and not a useful test case.
      Similarly, forcing the update config map to have updated nodes, then
      testing that that map is not adopted does not provide a valuable test
      So, instead of a test, this CR opts for some code comments and this
      lengthly commit explaining the change.
      Change-Id: Idc847cd5e237531e4a8b978f3465e30a909eb94f
      Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>