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

Cannot page queries with both ORDER BY and a IN restriction #1752

Open
jvans1 opened this issue Aug 21, 2019 · 3 comments
Open

Cannot page queries with both ORDER BY and a IN restriction #1752

jvans1 opened this issue Aug 21, 2019 · 3 comments

Comments

@jvans1
Copy link

jvans1 commented Aug 21, 2019

Requirement - what kind of business use case are you trying to solve?

Connecting Jaeger to CosmosDB backend with the Cassandra API

Problem - what in Jaeger blocks you from solving the requirement?

I built binaries from the latest master and have a jaeger collector successfully writing to the cosmosdb cassandra API backend. When I run jaeger-query for a specific operation it works:

Screen Shot 2019-08-21 at 10 40 04 AM

but when I have "all" operations selected it 500s:

Screen Shot 2019-08-21 at 10 39 47 AM

It looks like a cassandra error. I'm not sure if this is some incompatibility of Azure CosmosDB cassandra API wrapper or if I've misconfigured something. I generated the schema with:

MODE=test DATACENTER=teamlabs  ./create.sh > create_schema.cql

 SSL_VERSION=TLSv1_2 SSL_VALIDATE=false cqlsh <instance> 10350 -u <username> -p <password> --ssl  --cqlversion=3.4.4 -f create_schema.cql

Stackoverflow suggests disabling paging, which I don't think we want here. The actual generation of the query is internal to jaeger and I don't see flags I could modify it with so I assume my setup is wrong somehow. Any ideas what I did wrong?

@yurishkuro
Copy link
Member

This sounds more like an incompatibility of CosmosDB features with what Cassandra supports.

@Starblade42
Copy link

Starblade42 commented Aug 28, 2019

The Datastax documentation says that this is not a valid way to query Cassandra with both IN and ORDER BY: https://docs.datastax.com/en/archived/cql/3.3/cql/cql_using/useQueryIN.html

Note that using both IN and ORDER BY will require turning off paging with the PAGING OFF command in cqlsh.

(from https://stackoverflow.com/questions/51758089/how-to-use-in-and-order-by-at-the-same-time-in-cassandra/51765097#51765097)

so this is a CASSANDRA thing, and not just a CosmosDB restriction

@forestsword
Copy link

For others... I attempted to try and see if I could fix this. I discovered paging is already disabled for this query:

func (s *SpanReader) queryByService(ctx context.Context, tq *spanstore.TraceQueryParameters) (dbmodel.UniqueTraceIDs, error) {
//lint:ignore SA4006 failing to re-assign context is worse than unused variable
span, ctx := startSpanForQuery(ctx, "queryByService", queryByServiceName)
defer span.Finish()
query := s.session.Query(
queryByServiceName,
tq.ServiceName,
model.TimeAsEpochMicroseconds(tq.StartTimeMin),
model.TimeAsEpochMicroseconds(tq.StartTimeMax),
tq.NumTraces*limitMultiple,
).PageSize(0)
return s.executeQuery(span, query, s.metrics.queryServiceNameIndex)
}

I've tried a few other things like disabling paging on the session itself and changing the query but with no luck. It looks as though CosmosDB is just ignoring any requests to disable paging and always pages. So like @yurishkuro said, this is a cosmos issue. We'll try raising it with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants