Skip to content

Elections crash recovery#2566

Merged
kansi merged 1 commit intobigchaindb:masterfrom
ldmberman:elections-crash-recovery
Sep 28, 2018
Merged

Elections crash recovery#2566
kansi merged 1 commit intobigchaindb:masterfrom
ldmberman:elections-crash-recovery

Conversation

@ldmberman
Copy link
Copy Markdown
Contributor

No description provided.

@ldmberman ldmberman requested a review from kansi September 20, 2018 16:59
@ldmberman
Copy link
Copy Markdown
Contributor Author

Currently based on coclude-multiple-elections-adjustments-2.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Sep 20, 2018

Codecov Report

Merging #2566 into master will decrease coverage by 0.15%.
The diff coverage is 90.66%.

@@            Coverage Diff             @@
##           master    #2566      +/-   ##
==========================================
- Coverage   93.74%   93.59%   -0.16%     
==========================================
  Files          45       45              
  Lines        2638     2684      +46     
==========================================
+ Hits         2473     2512      +39     
- Misses        165      172       +7

@ldmberman ldmberman force-pushed the elections-crash-recovery branch from 90b9568 to eaaf816 Compare September 21, 2018 09:00
bigchain.delete_elections(new_height)

txns = [BaseTransaction.from_dict(tx)
for tx in bigchain.get_transactions(txn_ids)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

get_transactions doesn't return the whole transaction. I would recommend using get_transaction instead

@ldmberman ldmberman force-pushed the elections-crash-recovery branch from eaaf816 to f0f7c90 Compare September 26, 2018 08:15
@ldmberman ldmberman force-pushed the elections-crash-recovery branch 3 times, most recently from 15380f4 to ca5cdea Compare September 26, 2018 14:33
return encode_validator(self.asset['data'])

def on_rollback(self, bigchaindb, new_height):
bigchaindb.delete_validator_set(new_height)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

new_height is the pre-commit height, so if an election is concluded at new_height the validator set will be stored at new_height + 1

1. Save pre-commit state in the beginning of end block. 2. Provide an interface for custom elections to rollback on crash recovery. 3. Simplify pre-commit management. 4. Add crash recovery for updert-validator and chain migration elecitons.
@ldmberman ldmberman force-pushed the elections-crash-recovery branch from ca5cdea to 5624f9d Compare September 27, 2018 08:19
@kansi kansi merged commit 0c4d6ec into bigchaindb:master Sep 28, 2018
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.

3 participants