0

I have a 3 org 6 peer system with node SDK and 5 raft orderers. The raft is working fine, tried killing leaders and election takes place. The SDK also working well can invoke transactions. But the problem bothering me is while starting the network the ordering system is defaulting to the first orderer say for example, orderer1.example.com and now if I kill this first orderer the network fails, invocation of transaction fails while raft selects a new leader. When I try to invoke a transaction it shows connection failed, cannot connect to all addresses and service unavailable.

I see in the typescript section of the SDk a way of passing the orderers and there I wrote a loop to pass in all orderers and the above problem is solved.

Is there any way to resolve this in the js implementation ?

1 Answers1

0

Hey @Anantha Padmanabhan

This is nothing to do with the ordering system and raft is a perfect distributed consensus algorithm

In your case when 5 orderers are present you tried to kill one and the remaining 4 will start leader election if 5th one is leader and your network is stable no worries.

The problem is in your SDK side in the connection profile For Example:

  "channels": {
    "samchannel": {
      "orderers": [
        "sam-orderer1",
        "sam-orderer2",
        "sam-orderer3",
        "sam-orderer4",
        "sam-orderer5"
      ],
    ...

If you try to remove sam-orderer1 orderer then your SDK try to send the transaction to the sam-orderer1 since it is in the 0th index of the array

Test: try to remove other than sam-orderer1 for example sam-orderer3 and now try to invoke the transaction and it will still work

Do this test and update me the status of the test

this is coming from the SDK side, as soon as it detects any orderer is down then it is stoping the execution instead it should redirect to another available orderer. I think the only way is instead of SDK resolves the orderers automatically using connection profile, u can take this step and send only the available orderer and available orderers can be provided using discovery service

Narendranath Reddy
  • 3,833
  • 3
  • 13
  • 32
  • the raft network is actually fine , if I kill orderer3 it will still work but killing orderer1 causes the invocation to fail as SDK is trying 0th index . This is the problem I am looking to fix even if we kill orderer 1 the SDK should be able to send the invoke request to any other orderer and invocation should happen thus making it truly fault tolerant. But now even if we have 5 orderers killing orderer 1 stops invocations. I am attaching my network-config.yaml please do take a look. – Anantha Padmanabhan May 05 '20 at 07:38
  • then replace the order in the orderers array [ "sam-orderer2", "sam-orderer1", "sam-orderer3", "sam-orderer4", "sam-orderer5" ] – Narendranath Reddy May 05 '20 at 07:44
  • yeah, this is coming from the SDK side, as soon as it detects any orderer is down then it is stoping the execution instead it should redirect to another available orderer. I think the only way is instead of SDK resolves the orderers automatically u can take this step and send only the available orderer and available orderers can be provided using discovery service – Narendranath Reddy May 05 '20 at 07:47
  • If I reorder too then as per the current order if orderer2 fails invocation fails I need it in such a way that if the default orderer fails invocation should work – Anantha Padmanabhan May 05 '20 at 07:49
  • I have seen the discovery service in ts implementation but not here in the js implementation – Anantha Padmanabhan May 05 '20 at 07:51