[FAB-5459] Recompute configmap instead of updating
[FAB-5459] Recompute configmap instead of updating

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

or

  [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
case.

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: Jason Yellick <3a1724207862302656e55e6f840a9996dad69e59@us.ibm.com>

stemlending/fabric,xixuejia/fabric,ckeyer/fabric,mqshen/fabric,blockc/fabric,blockc/fabric,blockc/fabric,hyperledger/fabric,binhn/fabric,mqshen/fabric,lukehuangch/fabric,binhn/fabric,ckeyer/fabric,jimthematrix/fabric,muralisrini/fabric,hyperledger/fabric,lukehuangch/fabric,lukehuangch/fabric,lukehuangch/fabric,lukehuangch/fabric,manish-sethi/fabric-sidedb,ckeyer/fabric,ckeyer/fabric,binhn/fabric,manish-sethi/fabric-sidedb,stemlending/fabric,blockc/fabric,stemlending/fabric,jimthematrix/fabric,manish-sethi/fabric-sidedb,mqshen/fabric,lukehuangch/fabric,muralisrini/fabric,mqshen/fabric,mqshen/fabric,ckeyer/fabric,blockc/fabric,manish-sethi/fabric-sidedb,blockc/fabric,lukehuangch/fabric,ckeyer/fabric,manish-sethi/fabric-sidedb,xixuejia/fabric,blockc/fabric,manish-sethi/fabric-sidedb,ckeyer/fabric,xixuejia/fabric,muralisrini/fabric,manish-sethi/fabric-sidedb,mqshen/fabric,mqshen/fabric,manish-sethi/fabric,stemlending/fabric,manish-sethi/fabric