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

Compaction for C++ FASTER #250

Merged
merged 10 commits into from
Mar 25, 2020
Merged

Compaction for C++ FASTER #250

merged 10 commits into from
Mar 25, 2020

Conversation

chinkulkarni
Copy link
Contributor

Implements a 3 phased approach similar to the C# version.

Phase 1: Collects records from the region to be compacted into a mini-FASTER instance.

Phase 2: Scans records in FASTER's log upto the safe read-only offset, deleting them from the mini-FASTER instance.

Phase 3: Inserts records from the mini-FASTER into the hybrid log as long as they don't exist in it's mutable region.

Also includes a scan iterator that scans records between a provided address range. Like the C# version, this iterator is capable of buffering pages that are on disk.

This iterator takes in a begin and end address. Calling getNext()
returns a pointer to the next record in the range. If the end has
been reached, then nullptr is returned.

If we need to scan over disk, then the iterator can optionally
scan extra pages and buffer them internally.
The Log Compaction algorithm requires that we
 a) Collect records into a temporary faster instance
 b) Delete dead records from this instance
 c) Upsert live records at the tail of the log

To perform the above three we need an Upsert and Delete context.
Implements a 3 phased approach similar to the C# version.
 Phase 1: Collects records from the region to be compacted into
          a mini-FASTER instance.
 Phase 2: Scans records in FASTER's log upto the safe read-only offset, deleting
          them from the mini-FASTER instance.
 Phase 3: Inserts records from the mini-FASTER into the hybrid log as long as
          they don't exist in it's mutable region.
@chinkulkarni chinkulkarni self-assigned this Mar 1, 2020
@msftclas
Copy link

msftclas commented Mar 1, 2020

CLA assistant check
All CLA requirements met.

@badrishc badrishc merged commit c98de54 into master Mar 25, 2020
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.

[C++] Support for log compaction (port from C#) [C++] Support for log scan (port from C#)
3 participants