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-1946: Restore current 3PC state from audit ledger [skip ci] #1096

Merged
merged 140 commits into from
Apr 1, 2019

Conversation

ArtObr
Copy link
Contributor

@ArtObr ArtObr commented Feb 22, 2019

No description provided.

Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
plenum/server/node.py Show resolved Hide resolved
plenum/server/node.py Show resolved Hide resolved
plenum/server/node.py Show resolved Hide resolved
plenum/server/node.py Outdated Show resolved Hide resolved
plenum/server/node.py Show resolved Hide resolved
plenum/server/node.py Outdated Show resolved Hide resolved
plenum/server/node.py Outdated Show resolved Hide resolved
plenum/server/node.py Outdated Show resolved Hide resolved
plenum/server/node.py Outdated Show resolved Hide resolved
plenum/server/view_change/view_changer.py Show resolved Hide resolved
plenum/server/node.py Outdated Show resolved Hide resolved
ArtObr and others added 16 commits February 26, 2019 12:20
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: ashcherbakov <alexander.sherbakov@dsr-corporation.com>
Signed-off-by: ashcherbakov <alexander.sherbakov@dsr-corporation.com>
Signed-off-by: ashcherbakov <alexander.sherbakov@dsr-corporation.com>
Signed-off-by: ashcherbakov <alexander.sherbakov@dsr-corporation.com>
Signed-off-by: ashcherbakov <alexander.sherbakov@dsr-corporation.com>
Signed-off-by: ashcherbakov <alexander.sherbakov@dsr-corporation.com>
Signed-off-by: ashcherbakov <alexander.sherbakov@dsr-corporation.com>
Signed-off-by: ashcherbakov <alexander.sherbakov@dsr-corporation.com>
ArtObr and others added 10 commits March 18, 2019 09:44
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
[INDY-1946] fix more checkoints tests
Signed-off-by: Andrew Nikitin <andrew.nikitin@dsr-corporation.com>
[INDY-1946] fix parametrized test into checkpoint
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
@ArtObr
Copy link
Contributor Author

ArtObr commented Mar 20, 2019

Need additional future_primaries integration test, to check correct primaries revert.

Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
@ArtObr
Copy link
Contributor Author

ArtObr commented Mar 28, 2019

test this please

Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
This reverts commit f9c2e33.

Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
This reverts commit 67ea67c.

Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
This reverts commit cb2d4a2.

Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>

def get_by_seq_no_uncommitted(self, seq_no):
if seq_no > self.uncommitted_size:
raise KeyError
Copy link
Member

Choose a reason for hiding this comment

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

If we are okay with having IndexError insteead of KeyError in case seq_no > self.uncommited_size then this additional check is not needed.

txn[AUDIT_TXN_PRIMARIES] = current_primaries

# 2. Previous primaries field contains primary list
# If primaries did not changed, we will store seq_no delta
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# If primaries did not changed, we will store seq_no delta
# If primaries did not change, we will store seq_no delta

Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
if len(self.node_states) == 0:
last_state = self.create_node_state_from_current_node()
else:
last_state = copy.deepcopy(self.node_states[-1])
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this could be imlemented in a much more safe (and probably efficient) way if NodeState was immutable NamedTuple instead of mutable class with fields.


if replica.isPrimary is not True:
if replica.isPrimary is None:
logger.info("{} ignoring stored {} because it is not primary in instance {}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like error message is incorrect here.

# As we've selected new primaries, we need to send 3pc batch,
# so this primaries can be saved in audit ledger
if not sent_batches and self.node.primaries_batch_needed:
self.logger.debug("Sending a 3PC batch to propagate newly selected primaries")
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to log it as an INFO.

node.allLedgersCaughtUp()

assert len(replica.checkpoints) == 0
assert len(replica.stashedRecvdCheckpoints) == 0


def test_checkpoints_not_removed_on_backup_primary_replica_after_catchup(
def test_checkpoints_removed_on_backup_primary_replica_after_catchup(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it removed now?

@@ -38,7 +39,7 @@ def chk_ledger_and_state(first_node, second_node, ledger_id):
else:
logger.debug("Excluding check_last_ordered_3pc check")

if not exclude_from_check or 'check_last_ordered_3pc_backup' not in exclude_from_check:
if include_in_check and 'check_last_ordered_3pc_backup' in include_in_check:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any tests where we test/expect equal 3PC on backups?

@ashcherbakov ashcherbakov merged commit 35bc655 into hyperledger:master Apr 1, 2019
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

4 participants