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

For Cassandra storage minimise the number of tombstones (NULL entries) in the repair_run table #244

Merged

Conversation

michaelsembwever
Copy link
Member

@michaelsembwever michaelsembwever commented Oct 19, 2017

Remove RepairSegment.repairCommandId as no one was using/storing it.

Make explicit which fields in RepairSegment can be null and be nulled.
Hide the RepairSegment.Builder constructor.

Add Preconditions and asserts in ensuring lifecycle state is correct and null fields only exist as/when appropriate.
Preconditions are used when checks are fast and for providing fail-fast design. Asserts are used where checks are expensive and/or are secondary checks.

ref: #240

@michaelsembwever
Copy link
Member Author

@mrwulf

@michaelsembwever
Copy link
Member Author

The changes in CassandraStorage form the crux of the patch.

@michaelsembwever michaelsembwever force-pushed the mck/cassandra-minimise-repair-run-tombstones branch from b793304 to f58665a Compare October 19, 2017 05:16
michaelsembwever added a commit that referenced this pull request Oct 19, 2017
…) in the repair_run table.

Remove RepairSegment.repairCommandId as no one was using/storing it.

Make explicit which fields in RepairSegment can be null and be nulled.
Hide the RepairSegment.Builder constructor.

Add Preconditions and asserts in ensuring lifecycle state is correct and null fields only exist as/when appropriate.
Preconditions are used when fast and providing fail-fast design. Asserts are used where expensive and/or are secondary checks.

ref:
 - #240
 - #244
@michaelsembwever michaelsembwever added this to the 0.8.0 milestone Oct 19, 2017
@michaelsembwever michaelsembwever force-pushed the mck/cassandra-minimise-repair-run-tombstones branch from f58665a to 6322293 Compare October 19, 2017 05:48
michaelsembwever added a commit that referenced this pull request Oct 19, 2017
…) in the repair_run table.

Remove RepairSegment.repairCommandId as no one was using/storing it.

Make explicit which fields in RepairSegment can be null and be nulled.
Hide the RepairSegment.Builder constructor.

Add Preconditions and asserts in ensuring lifecycle state is correct and null fields only exist as/when appropriate.
Preconditions are used when fast and providing fail-fast design. Asserts are used where expensive and/or are secondary checks.

ref:
 - #240
 - #244
@michaelsembwever
Copy link
Member Author

the joy of codebases that don't treat nulls explicitly… :-/
at least this is one step in the right direction…

@michaelsembwever michaelsembwever force-pushed the mck/cassandra-minimise-repair-run-tombstones branch from 6322293 to 091403b Compare October 19, 2017 08:08
michaelsembwever added a commit that referenced this pull request Oct 19, 2017
…) in the repair_run table.

Remove RepairSegment.repairCommandId as no one was using/storing it.

Make explicit which fields in RepairSegment can be null and be nulled.
Hide the RepairSegment.Builder constructor.

Add Preconditions and asserts in ensuring lifecycle state is correct and null fields only exist as/when appropriate.
Preconditions are used when fast and providing fail-fast design. Asserts are used where expensive and/or are secondary checks.

ref:
 - #240
 - #244
Copy link
Contributor

@adejanovski adejanovski left a comment

Choose a reason for hiding this comment

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

Tested and approved.
We're not generating tombstones anymore here (or at least very few when nulling the coordinator for example).

@michaelsembwever michaelsembwever force-pushed the mck/cassandra-minimise-repair-run-tombstones branch from 091403b to dec813f Compare October 19, 2017 09:18
michaelsembwever added a commit that referenced this pull request Oct 19, 2017
…) in the repair_run table.

Remove RepairSegment.repairCommandId as no one was using/storing it.

Make explicit which fields in RepairSegment can be null and be nulled.
Hide the RepairSegment.Builder constructor.

Add Preconditions and asserts in ensuring lifecycle state is correct and null fields only exist as/when appropriate.
Preconditions are used when fast and providing fail-fast design. Asserts are used where expensive and/or are secondary checks.

ref:
 - #240
 - #244
@adejanovski
Copy link
Contributor

Last change most probably fixed the issue with the race condition between the JMX success notification and the abort of leaderless segments.
At least I'm unable to reproduce it.

Let's go ahead and merge.

…) in the repair_run table.

Remove RepairSegment.repairCommandId as no one was using/storing it.

Make explicit which fields in RepairSegment can be null and be nulled.
Hide the RepairSegment.Builder constructor.

Re-read segments once leader-election is done, ensuring we're not writing back stale data

Add Preconditions and asserts in ensuring lifecycle state is correct and null fields only exist as/when appropriate.
Preconditions are used when fast and providing fail-fast design. Asserts are used where expensive and/or are secondary checks.

ref:
 - #240
 - #244
@michaelsembwever michaelsembwever force-pushed the mck/cassandra-minimise-repair-run-tombstones branch from dec813f to 03b6663 Compare October 19, 2017 20:02
@michaelsembwever michaelsembwever merged commit e717ad8 into master Oct 19, 2017
@michaelsembwever michaelsembwever deleted the mck/cassandra-minimise-repair-run-tombstones branch October 27, 2017 21:07
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.

2 participants