Skip to content

Commit

Permalink
[FAB-1382] Remove window from Deliver API
Browse files Browse the repository at this point in the history
https://jira.hyperledger.org/browse/FAB-1382

The deliver API currently works on a windowing concept.  Because of the
HTTP2/gRPC internal windowing, this additional layer of windowing is
unnecessary.

This changeset removes the notion of a Window from Deliver and instead
replaces it with a start and stop position specification.  To receive
blocks indefinitely (replicating the old behavior with ACKs) the end
position may be specified as MAX_UINT64.

This changeset has an unfortunately high amount of ripple, and required
extensive rework in the bdd tests, but the overall changeset is a
simplification.

Change-Id: I5095da82ab1f6d892b0112cdb9848842529936d9
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
  • Loading branch information
Jason Yellick committed Dec 19, 2016
1 parent 06c336d commit 785eaf0
Show file tree
Hide file tree
Showing 24 changed files with 805 additions and 746 deletions.
90 changes: 46 additions & 44 deletions bddtests/features/orderer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,29 @@ Feature: Orderer
And I wait "<BootTime>" seconds
And user "binhn" is an authorized user of the ordering service
When user "binhn" broadcasts "<NumMsgsToBroadcast>" unique messages on "orderer0"
And user "binhn" connects to deliver function on "orderer0" with Ack of "<SendAck>" and properties:
| Start | SpecifiedNumber | WindowSize |
| SPECIFIED | 1 | 10 |
And user "binhn" connects to deliver function on "orderer0"
And user "binhn" sends deliver a seek request on "orderer0" with properties:
| Start | End |
| 1 | Newest |
Then user "binhn" should get a delivery from "orderer0" of "<ExpectedBlocks>" blocks with "<NumMsgsToBroadcast>" messages within "<BatchTimeout>" seconds

Examples: Solo Orderer
| ComposeFile | SendAck | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| docker-compose-orderer-solo.yml | true | 20 | 2 | 10 | .5 |
| docker-compose-orderer-solo.yml | true | 40 | 4 | 10 | .5 |
| docker-compose-orderer-solo.yml | true | 60 | 6 | 10 | .5 |
| ComposeFile | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| docker-compose-orderer-solo.yml | 20 | 2 | 10 | .5 |
| docker-compose-orderer-solo.yml | 40 | 4 | 10 | .5 |
| docker-compose-orderer-solo.yml | 60 | 6 | 10 | .5 |

Examples: 1 Kafka Orderer and 1 Kafka Broker
| ComposeFile | SendAck | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-1 | true | 20 | 2 | 10 | 5 |
| environments/orderer-1-kafka-1 | true | 40 | 4 | 10 | 5 |
| environments/orderer-1-kafka-1 | true | 60 | 6 | 10 | 5 |
| ComposeFile | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-1 | 20 | 2 | 10 | 5 |
| environments/orderer-1-kafka-1 | 40 | 4 | 10 | 5 |
| environments/orderer-1-kafka-1 | 60 | 6 | 10 | 5 |

Examples: 1 Kafka Orderer and 3 Kafka Brokers
| ComposeFile | SendAck | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-3 | true | 20 | 2 | 10 | 5 |
| environments/orderer-1-kafka-3 | true | 40 | 4 | 10 | 5 |
| environments/orderer-1-kafka-3 | true | 60 | 6 | 10 | 5 |
| ComposeFile | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-3 | 20 | 2 | 10 | 5 |
| environments/orderer-1-kafka-3 | 40 | 4 | 10 | 5 |
| environments/orderer-1-kafka-3 | 60 | 6 | 10 | 5 |

# @doNotDecompose
Scenario Outline: Basic seek orderer function (Utilizing properties for atomic broadcast)
Expand All @@ -45,55 +46,56 @@ Feature: Orderer
And I wait "<BootTime>" seconds
And user "binhn" is an authorized user of the ordering service
When user "binhn" broadcasts "<NumMsgsToBroadcast>" unique messages on "orderer0"
And user "binhn" connects to deliver function on "orderer0" with Ack of "<SendAck>" and properties:
| Start | SpecifiedNumber | WindowSize |
| SPECIFIED | 1 | 10 |
And user "binhn" connects to deliver function on "orderer0"
And user "binhn" sends deliver a seek request on "orderer0" with properties:
| Start | End |
| 1 | Newest |
Then user "binhn" should get a delivery from "orderer0" of "<ExpectedBlocks>" blocks with "<NumMsgsToBroadcast>" messages within "<BatchTimeout>" seconds
When user "binhn" seeks to block "1" on deliver function on "orderer0"
When user "binhn" sends deliver a seek request on "orderer0" with properties:
| Start | End |
| 1 | Newest |
Then user "binhn" should get a delivery from "orderer0" of "<ExpectedBlocks>" blocks with "<NumMsgsToBroadcast>" messages within "1" seconds

Examples: Solo Orderer
| ComposeFile | SendAck | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| docker-compose-orderer-solo.yml | true | 20 | 2 | 10 | .5 |
| docker-compose-orderer-solo.yml | true | 40 | 4 | 10 | .5 |
| docker-compose-orderer-solo.yml | true | 60 | 6 | 10 | .5 |
| ComposeFile | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| docker-compose-orderer-solo.yml | 20 | 2 | 10 | .5 |
| docker-compose-orderer-solo.yml | 40 | 4 | 10 | .5 |
| docker-compose-orderer-solo.yml | 60 | 6 | 10 | .5 |

Examples: 1 Kafka Orderer and 1 Kafka Broker
| ComposeFile | SendAck | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-1 | true | 20 | 2 | 10 | 5 |
| environments/orderer-1-kafka-1 | true | 40 | 4 | 10 | 5 |
| environments/orderer-1-kafka-1 | true | 60 | 6 | 10 | 5 |
| ComposeFile | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-1 | 20 | 2 | 10 | 5 |
| environments/orderer-1-kafka-1 | 40 | 4 | 10 | 5 |
| environments/orderer-1-kafka-1 | 60 | 6 | 10 | 5 |

Examples: 1 Kafka Orderer and 3 Kafka Brokers
| ComposeFile | SendAck | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-3 | true | 20 | 2 | 10 | 5 |
| environments/orderer-1-kafka-3 | true | 40 | 4 | 10 | 5 |
| environments/orderer-1-kafka-3 | true | 60 | 6 | 10 | 5 |
| ComposeFile | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-3 | 20 | 2 | 10 | 5 |
| environments/orderer-1-kafka-3 | 40 | 4 | 10 | 5 |
| environments/orderer-1-kafka-3 | 60 | 6 | 10 | 5 |


# @doNotDecompose
Scenario Outline: Basic orderer function varying ACK
Scenario Outline: Basic orderer function using oldest seek target

Given we compose "<ComposeFile>"
And I wait "<BootTime>" seconds
And user "binhn" is an authorized user of the ordering service
When user "binhn" broadcasts "<NumMsgsToBroadcast>" unique messages on "orderer0"
And user "binhn" connects to deliver function on "orderer0" with Ack of "<SendAck>" and properties:
| Start | SpecifiedNumber | WindowSize |
| SPECIFIED | 1 | 1 |
And user "binhn" connects to deliver function on "orderer0"
And user "binhn" sends deliver a seek request on "orderer0" with properties:
| Start | End |
| Oldest | 2 |
Then user "binhn" should get a delivery from "orderer0" of "<ExpectedBlocks>" blocks with "<NumMsgsToBroadcast>" messages within "<BatchTimeout>" seconds

Examples: Solo Orderer
| ComposeFile | SendAck | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| docker-compose-orderer-solo.yml | false | 20 | 1 | 10 | .5 |
| docker-compose-orderer-solo.yml | true | 20 | 2 | 10 | .5 |
| ComposeFile | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| docker-compose-orderer-solo.yml | 20 | 3 | 10 | .5 |

Examples: 1 Kafka Orderer and 1 Kafka Broker
| ComposeFile | SendAck | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-1 | false | 20 | 1 | 10 | 5 |
| environments/orderer-1-kafka-1 | true | 20 | 2 | 10 | 5 |
| ComposeFile | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-1 | 20 | 3 | 10 | 5 |

Examples: 1 Kafka Orderer and 3 Kafka Brokers
| ComposeFile | SendAck | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-3 | false | 20 | 1 | 10 | 5 |
| environments/orderer-1-kafka-3 | true | 20 | 2 | 10 | 5 |
| ComposeFile | NumMsgsToBroadcast | ExpectedBlocks | BatchTimeout | BootTime |
| environments/orderer-1-kafka-3 | 20 | 3 | 10 | 5 |
Loading

0 comments on commit 785eaf0

Please sign in to comment.