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

refactor: Improve rollback on peer P2P collection error #1461

Merged

Conversation

fredcarle
Copy link
Collaborator

Relevant issue(s)

Resolves #1389

Description

This PR improves the rollback of P2P collection manipulation errors. It ensures that a rollback is applied if the transaction commit fails.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

Unit test coming with net package code coverage improvements.

@fredcarle fredcarle added refactor This issue specific to or requires *notable* refactoring of existing codebases and components area/p2p Related to the p2p networking system labels May 6, 2023
@fredcarle fredcarle added this to the DefraDB v0.5.1 milestone May 6, 2023
@fredcarle fredcarle requested a review from a team May 6, 2023 03:28
@fredcarle fredcarle self-assigned this May 6, 2023
@codecov
Copy link

codecov bot commented May 6, 2023

Codecov Report

Merging #1461 (ca18f6e) into develop (b6bd97a) will increase coverage by 0.22%.
The diff coverage is 40.47%.

❗ Current head ca18f6e differs from pull request most recent head 4ae9d3e. Consider uploading reports for the commit 4ae9d3e to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1461      +/-   ##
===========================================
+ Coverage    72.03%   72.25%   +0.22%     
===========================================
  Files          185      185              
  Lines        18224    18226       +2     
===========================================
+ Hits         13127    13169      +42     
+ Misses        4052     4021      -31     
+ Partials      1045     1036       -9     
Impacted Files Coverage Δ
net/peer.go 50.32% <40.47%> (+2.46%) ⬆️

... and 9 files with indirect coverage changes

Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

Looks better - cheer Fred, I think there are still a couple of holes here, but they are harder to plug and can perhaps be done later :)

net/peer.go Show resolved Hide resolved
@fredcarle fredcarle force-pushed the fredcarle/refactor/p2p-collections branch from 19e840b to ca18f6e Compare May 9, 2023 02:03
@fredcarle fredcarle force-pushed the fredcarle/refactor/p2p-collections branch from ca18f6e to 4ae9d3e Compare May 9, 2023 23:07
@fredcarle fredcarle merged commit 5df70af into sourcenetwork:develop May 9, 2023
8 checks passed
@fredcarle fredcarle deleted the fredcarle/refactor/p2p-collections branch May 9, 2023 23:16
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
…k#1461)

## Relevant issue(s)

Resolves sourcenetwork#1389 

## Description

This PR improves the rollback of P2P collection manipulation errors. It
ensures that a rollback is applied if the transaction commit fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/p2p Related to the p2p networking system refactor This issue specific to or requires *notable* refactoring of existing codebases and components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve rollback of AddP2PCollection and RemoveP2PCollection
2 participants