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

The new peer node would not update ledger if the channel committed a chaincode with 'init-required=false' flag

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • High
    • Resolution: Invalid: Environment Issue
    • v2.2.0
    • None
    • fabric-peer
    • Hide
      Step1:
      use "init-required=false" flag to approve the chaincode definition on peer0 node of each org, then commit it.
      Step2:
      Enter the peer1 container (of any org), fetch the zero block and join the target channel.
      Step3:
      Then this bug will have a great possibility to happend. When you use 'peer channel getinfo -c mychannel' command to check the block status,
      you would find that the blockchain height stay at 1 and never change.
      Sometimes——i would rather say——seldom,it may not happen,but when you try some more times,it would bother you too.
      Show
      Step1: use "init-required=false" flag to approve the chaincode definition on peer0 node of each org, then commit it. Step2: Enter the peer1 container (of any org), fetch the zero block and join the target channel. Step3: Then this bug will have a great possibility to happend. When you use 'peer channel getinfo -c mychannel' command to check the block status, you would find that the blockchain height stay at 1 and never change. Sometimes——i would rather say——seldom,it may not happen,but when you try some more times,it would bother you too.

    Description

      Description

      I found a bug while employing a chaincode with 'init-required=false' flag on the peer node.
      When this bug happens, the new joining node can't get any ledger through gossip protocol.
      I have no idea which parts of code work wrong, but i spend some time to ensure how to reproduce the bug using fewest steps.
      i think it only happens when you join a new peer (like peer1) of an existing org (peer0 has joined) of the channel.

      Condition

      Fabric-network: 1 consortium with 3 orgs, each org has two peers, named after peer0 and peer1. (maybe not necessary,but mention it in case)
      configuration:

      • CORE_PEER_GOSSIP_USELEADERELECTION=true
      • CORE_PEER_GOSSIP_ORGLEADER=false

      Workaround

      i found a workaround to solve this problem.
      you can stop the peer0 docker,wait for a minute,then restart it.
      now you will see the peer1 start to fetch ledger and work well.
      i guess its because peer1 becomes the leader peer of this org when the peer0 down.
      but I cannot analyze it from the code level
      i also try to restart peer1 only, well, it just dosent work.

      Attachments

        Activity

          People

            denyeart David Enyeart
            sennri Yuqi Ni
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: