Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.3k stars 1.96k forks source link

[BUG] #41215

Open gawlikt opened 1 month ago

gawlikt commented 1 month ago

Describe the bug A clear and concise description of what the bug is.

I have ca 7050 records in my test cosmosdb collection when I execute

    var cosmosQueryOptions = new CosmosQueryRequestOptions();
    cosmosQueryOptions.setPartitionKey(new PartitionKey("specific pk"));
    cosmosQueryOptions.setMaxDegreeOfParallelism(1);
    cosmosQueryOptions.setMaxBufferedItemCount(1);
    cosmosQueryOptions.setResponseContinuationTokenLimitInKb(4);

    container.queryItems(query, cosmosQueryOptions, MyEntity.class).iterableByPage(token, 100).iterator().next()

my expectation is that only one query will be executed against cosmosdb

but when I check

what I assume means that all records are cached (71*100=7100)

in our production env for ca 500 calls to similar function cosmosdb metrics show over 100 000 queries obviously this impact RU and also amount of data transferred to our pods

In our current setup when user requests next page of data we call above function so I'd prefer to have limited bufferedItemCount but this doesn't seem to work

Can I ask for suggestion how can I solve this?

Setup (please complete the following information):

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

github-actions[bot] commented 1 month ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @kushagraThapar @pjohari-ms @TheovanKraay.