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

OAK-11238 - indexing-job: de-duplicate entries when writing to disk the intermediate sorted files with FFS contents. #1835

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

nfsantos
Copy link
Contributor

@nfsantos nfsantos commented Oct 30, 2024

The pipelined strategy writes several batches with sorted node state entries as intermediate files, before the final merge phase.
In some cases, these batches may contain duplicate entries (when there was a disconnection to Mongo or with parallel download when the streams cross). As the batches are sorted before being written to disk, it is very cheap to de-duplicate entries (before writing an entry, compare with the previous one).
This only avoids duplicates in a single batch, duplicates may still exist across intermediate sorted files. But this may reduce the size of the intermediate files, and therefore speed-up the merge sort. One case where there may be duplicates in a single batch is when the indexing job disconnects from Mongo and has to retry the download, as in this case it may re-download some entries that were previously downloaded. The gains in the common case should be very minor, but as it is simple and cheap, I believe is worth implementing.

@nfsantos nfsantos merged commit c3e7c20 into apache:trunk Oct 30, 2024
1 of 2 checks passed
@nfsantos nfsantos deleted the OAK-11238 branch October 30, 2024 16:22
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