-
Notifications
You must be signed in to change notification settings - Fork 366
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
Conversation
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: 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>
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>
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>
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# If primaries did not changed, we will store seq_no delta | |
# If primaries did not change, we will store seq_no delta |
if len(self.node_states) == 0: | ||
last_state = self.create_node_state_from_current_node() | ||
else: | ||
last_state = copy.deepcopy(self.node_states[-1]) |
There was a problem hiding this comment.
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 {}" |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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?
No description provided.