Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-16035

As a peer admin, I need a way to 'unjoin' a channel

    Details

    • SDK Impact:
      Unset
    • System Test Impact:
      Unset
    • Documentation Impact:
      Unset

      Description

      Background

      For a peer which is joined to a channel, if the peer's org is evicted from the channel (and cannot receive blocks), the peer will spend resources and spam log messages attempting to pull blocks from that channel forever.

      Objective

      Similar to the peer reset command, it would be very nice to add an option to simply delete the channel blockchain on the org's peer, effectively 'unjoin'ing the channel.

      Proposal

      When a peer is unjoined from a channel, ideally all the ledger data for the channel should be deleted from the peer. However, because a single instance of golevelDB is used for each store (except for blockstore), it is not feasible to delete ledger data at a per-channel basis. Therefore we propose the following design:

      Add a “peer node unjoin -c <channelID>” command (peer must be stopped).
      The unjoin command will:

      • tag the channel as "unjoined" in the peer's ledgerProvider database so that the channel does not get initialized upon next peer start.
      • delete the channel's blockstore from the peer's /chains directory

      Note that the channel data will not get deleted from the other internal cross-channel data stores. It will be orphaned (unreferenced from peer).

      Once tagged as "unjoined", the peer will not be able to re-join the channel (since there is orphaned data for that channel).

      If a peer administrator wants to completely delete the channel data from the internal cross-channel data stores, or wants to rejoin the peer to the channel, they can do a "peer node reset" which truncates all channels to genesis block and deletes the internal cross-channel data stores. As of this proposal it will also remove any channels tagged as "unjoined" in ledgerProvider database. Upon next peer restart, the peer will automatically pull blocks and rebuild the internal cross-channel data stores for the remaining joined channels.

      Future enhancement:

      Once ledger has truly per-channel databases in a future release, it will be possible for the unjoin command to immediately delete all data for the channel.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                wenjian Wenjian Qiao
                Reporter:
                jyellick Jason Yellick
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Git Source Code