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

Improve the batching algorithm to optimize the size of batches #18634

Closed
Mohit-Chakraborty opened this issue Feb 10, 2021 · 3 comments
Closed
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Search
Milestone

Comments

@Mohit-Chakraborty
Copy link
Contributor

No description provided.

@Mohit-Chakraborty Mohit-Chakraborty added Client This issue points to a problem in the data-plane of the library. Search labels Feb 10, 2021
@Mohit-Chakraborty Mohit-Chakraborty added this to the Backlog milestone Feb 10, 2021
@Mohit-Chakraborty Mohit-Chakraborty self-assigned this Feb 10, 2021
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Mar 12, 2021
@ghost
Copy link

ghost commented Mar 12, 2021

Hi @Mohit-Chakraborty. There hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by removing the no-recent-activity label. Otherwise, we'll close this out in 7 days.

@ghost ghost removed the no-recent-activity There has been no recent activity on this issue. label Mar 13, 2021
@ghost
Copy link

ghost commented Mar 13, 2021

Hi @Mohit-Chakraborty. There was a mistake and this issue was unintentionally flagged as a stale pull request. The label has been removed and the issue will remain active; no action is needed on your part. Apologies for the inconvenience.

@Mohit-Chakraborty
Copy link
Contributor Author

When submitting documents for indexing, we split batches on unique key of the documents, so that any exception from the service side can be correctly mapped and our document submission retry mechanism is stable. When designing a solution, we should aim to -

Try to fill the entire batch
Maintain the order of document submission
For .NET, we modified the batching algorithm via #18469
This helps with 2 above (maintain the order of document submission), but we can do better regarding 1 (try to fill the batch to the maximum extent).

I tried another round of improvement with #18603, but there were concerns about semantic change to the operation.

The change is adding a “flush duplicate actions immediately after the batch, regardless of size” behavior that might result in us sending a lot of extra batches. Ideally we’d just update the existing pending/retry queues and keep the rest of the logic the same (since it’s already so much to wrap your head around). That’s probably a nontrivial ask with .NET’s Queue though. I think we might need to switch from Queue to something else.

The remaining work is to modify the batching algorithm further, so that the above concerns are alleviated.

@ShivangiReja ShivangiReja closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Search
Projects
Archived in project
Development

No branches or pull requests

2 participants