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

[FasterLog] Concurrent iteration #198

Merged
merged 9 commits into from
Nov 16, 2019
Merged

[FasterLog] Concurrent iteration #198

merged 9 commits into from
Nov 16, 2019

Conversation

badrishc
Copy link
Contributor

@badrishc badrishc commented Nov 9, 2019

This PR adds support for concurrent iteration. We invoke Scan on FasterLog, and the resulting iterator may be shared by multiple threads iterating concurrently.

We also add an explicit notion of CompletedUntilAddress for a persisted iterators, and introduce a gesture CompleteUntil on the iterator in order to signify the completion of iteration work until the specified address in the scan. To persist iterator until a given address, use the following pattern:

iter.GetNext(...); // iterate
// do work on retrieved entry
iter.CompleteUntil(iter.NextAddress); // set completed-until address
await log.CommitAsync(); // commit to ensure persistence of completed-until

With concurrent iteration, the consumer is responsible for invoking CompleteUntil with an address such that all addresses before it have been completed by the concurrent threads.

@badrishc
Copy link
Contributor Author

PR is ready to review and merge.

We get higher scan performance than before, on one thread, with this implementation. We are able to hit 2GB/sec (close to SSD read bandwidth) with scan on one thread in the FasterLogSample project. The bottleneck is the code to check the entry byte array correctness. We bottleneck SSD bulk read bandwidth (around 2.5GB/sec) on adding the second thread.

Further, when user work on scan results is expensive, we get close to linear scalability as we increase the number of iterator threads (on the same scan iterator).

@badrishc badrishc merged commit 98889ae into master Nov 16, 2019
@badrishc badrishc deleted the fasterlog-concurrentscan branch September 7, 2020 02:45
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.

None yet

1 participant