Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2819] [PAN-2820] Mark Sweep #1638

Merged
merged 56 commits into from
Aug 7, 2019
Merged

[PAN-2819] [PAN-2820] Mark Sweep #1638

merged 56 commits into from
Aug 7, 2019

Conversation

RatanRSur
Copy link
Contributor

@RatanRSur RatanRSur commented Jul 3, 2019

PR description

Brings in Mark Sweep Pruner and test associated with it.

Key differences from PoC:

  • PrunerTest.java
  • Waiting for a constant number of blocks before starting to mark to prevent wasted effort caused by reorgs

Fixed Issue(s)

https://pegasys1.atlassian.net/secure/RapidBoard.jspa?rapidView=28&modal=detail&selectedIssue=PAN-2820
https://pegasys1.atlassian.net/secure/RapidBoard.jspa?rapidView=28&modal=detail&selectedIssue=PAN-2819

@RatanRSur RatanRSur marked this pull request as ready for review July 5, 2019 19:30
@RatanRSur RatanRSur requested a review from ajsutton July 10, 2019 14:31
@RatanRSur RatanRSur changed the title Mark Sweep [PAN-2819] [PAN-2880] Mark Sweep Jul 10, 2019
@RatanRSur RatanRSur changed the title [PAN-2819] [PAN-2880] Mark Sweep [PAN-2819] [PAN-2820] Mark Sweep Jul 10, 2019
Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

Looking good to me. I've noted a few things but nothing too major. Since this is based on code I wrote will leave actual approval to someone else.

Copy link
Contributor

@shemnon shemnon left a comment

Choose a reason for hiding this comment

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

Just a couple nits, both optional. LGTM

@Test
public void shouldRejectInvalidArguments() {
final Blockchain mockchain = mock(Blockchain.class);
assertThatThrownBy(() -> new Pruner(markSweepPruner, mockchain, mockExecutorService, -1, -2))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: in a previous commit you covered multiple cases where only one arg was illegal (i.e. 0, -1 and what should have been -1, 0). I felt that test had more coverage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, meredith and I realized that the case that I thought was illegal is actually possible, so we relaxed the cases where the arguments were illegal.

@RatanRSur RatanRSur merged commit cb769a3 into PegaSysEng:master Aug 7, 2019
@RatanRSur RatanRSur deleted the mark-sweep branch August 7, 2019 16:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants