Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

ClassCastException seen during query #89

Closed chetanmeh closed 5 years ago

chetanmeh commented 5 years ago

Describe the bug At times we are seeing following exception getting logged in our query flow. Unfortunately due to the way logging is done stack trace is not present

[2019-03-11T21:43:19.781Z] [ERROR] [#tid_33EsHVlP1DvswJiZO4asmuVXG9evto0g] [StoreUtils] [QUERY] 'activations' internal error, failure: 'com.microsoft.azure.cosmosdb.PartitionKeyRange cannot be cast to org.apache.commons.lang3.tuple.ImmutablePair' [ClassCastException] [marker:database_queryView_error:154:152]

To Reproduce Not know

Environment summary SDK Version: 2.3.0 Java JDK version: 1.8 OS Version (e.g. Windows, Linux, MacOSX)

chetanmeh commented 5 years ago

Looking at the code it appears to me that this is probably fixed with current master via this commit where earlier code was passing ranges of type List<PartitionKeyRange> to CollectionRoutingMap.tryCombine(List<ImmutablePair<PartitionKeyRange, IServerIdentity>> ranges) and post fix it now passes rangesTuples which is of expected type List<ImmutablePair<PartitionKeyRange, IServerIdentity>>.

We are switching to 2.4.2 version so would observe. But wanted to check if above reasoning makes sense and thus 2.4.2 should not show such issue!

moderakh commented 5 years ago

@chetanmeh this has been fixed in 2.4.0 onward.

BTW, the latest version in 2.4.x is 2.4.4

chetanmeh commented 5 years ago

Thanks for confirming.

BTW, the latest version in 2.4.x is 2.4.4

Yeah realized now. Its a moving target! Would get to that version soon