Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INDY-2025: Improve tests #1156

Merged
merged 10 commits into from
Apr 15, 2019
Merged

Conversation

skhoroshavin
Copy link
Member

No description provided.

Sergey Khoroshavin added 3 commits April 4, 2019 18:39
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
@skhoroshavin skhoroshavin changed the title [WIP] INDY-2025: Improve tests INDY-2025: Improve tests Apr 11, 2019
# Delay some commits on lagging node
some_commits = start_delaying(lagging_stasher, delay_some_commits(0, [2, 3]))
# Setup delayers
lagging_mid_commits = start_delaying(lagging_stasher, delay_3pc(after=3, before=6, msgs=Commit))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • delay Commits for ppSeqNo=4 on NodeX
  • increase the timeout for out of order commits on NodeX to 10000 secs
  • send 5 batches
  • make sure that NodeX ordered 3 of them
  • make sure that others ordered all 5
  • make sure that NodeX has out of order commits for ppSeqNo=5
  • process delayed commits for view4 on NodeX
  • make sure that NodeX ordered till batch ppSeqNo=4
  • delay POOL catchup on NodeX
  • start catchup on Node X
  • make sure that audit catchup is done, and pool one is started
  • call processOutOfOrderCommits by hand (emulating call by timeout)
    • it should not do anything on the latest master
    • it will order ppSeqNo=5 before starting Domain catchup on old code
  • finish catchup (process delayed catchup msgs)
  • call processOutOfOrderCommits by hand again (emulating call by timeout)

=> ppSeqNo=5 is caught up, all nodes have equal data, and NodeX can participate in more ordering
- on old code, NodeX will have duplicate txns for ppSeqNo=5: one from catchup, and one from outOfOrderCommits

Sergey Khoroshavin added 5 commits April 12, 2019 13:06
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
…tchup

Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
# Make sure pool is in expected state
for node in other_nodes:
assert node.master_replica.last_ordered_3pc == (0, init_pp_seq_no + 4)
assert lagging_node.master_replica.last_ordered_3pc == (0, init_pp_seq_no)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why last ordered is not (0, init_pp_seq_no + 2) right after we unstashed and processed delayed commits?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point lagging commits are just put into node inbox, but not processed. See next line where we actually wait until they are processed.

with delay_rules(lagging_stasher, delay_catchup(ledger_id)):
# Start catchup
lagging_node.start_catchup()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check that we call looper.runFor only when we are catching up the given ledger, not earlier?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I think additional check is not needed. Logic is as follows:

  • process_stashed_out_of_order_commits is already scheduled to run in future
  • catchup is triggered
  • during runFor catch-up progresses as far as it can and stops
  • runFor runs long enough so that scheduled action fires

It is possible to implement this in a more robust way (but at the cost of being more tied to node internals) by doing following things:

  • set process_stashed_out_of_order_commits timeout to "infinity"
  • start catchup
  • wait until catchup enters expected stage
  • manually fire process_stashed_out_of_order_commits
  • remove catchup delayer and let it progress further

Sergey Khoroshavin added 2 commits April 12, 2019 16:34
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
@ashcherbakov ashcherbakov merged commit 06dac29 into hyperledger:master Apr 15, 2019
@skhoroshavin skhoroshavin deleted the indy-2025 branch April 15, 2019 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants