We came accross a recurring problem querying our cosmosDB during the day of the 6th of august.
We had queries with missing results, but we were still receiving a "valid" response. Batches of results were not returned in some very critic queries for our application. For instance, a request that should be returning 250 docs was returning 240. Multiple queries accross a 5-6 hours frame had those incomplete results. The data queried was undeniably present in the database.
We were querying using a snippet similar to this, using a paging of 200 docs:
public static List<T> ToList<T>(this IDocumentQuery<T> documentQuery)
{
List<T> documents = new List<T>();
while (documentQuery.HasMoreResults)
{
documents.AddRange(documentQuery.ExecuteNextAsync<T>().Result);
}
return documents;
}
the IDocumentQuery is initialized by casting a IQueryable, a bit like this:
queryable.AsDocumentQuery()
The solution used is similar to something found in the microsoft doc: https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.linq.documentqueryable.asdocumentquery?view=azure-dotnet
We are currently moving our data solution towards cosmosDB and this is how we noticed the problem. Do you have any ideas what could've cause this? Should we expect more problems of the same type? Do you know how we can identify that we are receiving incomplete results?