Optional support for queued writes for CosmosDB#4513
Closed
chetanmeh wants to merge 10 commits intoapache:masterfrom
Closed
Optional support for queued writes for CosmosDB#4513chetanmeh wants to merge 10 commits intoapache:masterfrom
chetanmeh wants to merge 10 commits intoapache:masterfrom
Conversation
0f61278 to
da594a6
Compare
Member
Author
|
@markusthoemmes @cbickel Would be helpful if you can review the |
Member
Author
Good catch. That confirms why queue size was coming as zero in the tests. Thats the drawback of using parameters with default values. Fix that now. |
Member
Author
|
Closing it for now as we are now pursuing the Activation Persister Service approach #4632 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For activations in case of high volume we are seeing connection pool related error. This PR adds an optional support for having queued writes
Description
In case of high volume of writes on Invoker we are seeing errors like
This was observed with a pool size of 1000. To prevent such cases it would be better to have a more controlled way of writing documents to db. Earlier for CouchDB similar thing was done via #2812 where batched writes were used. Currently CosmosDB does not provide an easy way to perform batched writes (Azure/azure-cosmosdb-java#182).
Design
To enable controlled writes this PR introduces a
QueuedExecutor(similar in spirit to existingBatcherimplementation) which ensures that writes are queued and then prcessed in a controlled way. Key pointsUsage
Future Enhancement
We can possibly optimize the write throughput by implementing the bulk write logic as used in CosmosDB Bulk Importer. This would require us to batch the inserts and then sort by partition and send the calls to respective partition.
Another possible option to reduce heap pressure would be to store the object in byte array form in queue and deserialize before passing to
ArtifactStoreRelated issue and scope
My changes affect the following components
Types of changes
Checklist: