You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
count() behavior not consistent with query result involving secondary index, OR secondary indexes broken somehow #1796
@divad12 -- ok, thanks for chiming in. This looks like a pretty bad bug and we'll push a fix ASAP (but unfortunately like after the holidays, since many people are off).
I'd be interested to know if this is present in 1.10 and 1.09. The streaming code was recently rewritten which could be to blame for this. Also I'm not 100% certain how this query gets executed, I'm assuming it we're not smart enough to ignore the in memory part of the order_by but maybe I'm wrong.
So, this turns out to be something super dumb that I did. The class reader_t in datum_stream.cc has a member variable finished that we use to determine when to send SUCCESS_SEQUENCE instead of SUCCESS_PARTIAL in the protobuf Response. (It's also used for other logic internally in reader_t.) The problem is that this member variable doesn't mean "the stream is exhausted", it means "the shards are exhausted". Normally these are identical, because we try not to keep things hanging around in memory, but in the specific case of a an order_by on both an indexed and non-indexed field we do some clever shenanigans to get the sorting right and the two meanings diverge.
I think we can fix this by changing that one predicate (and renaming the variable to be less confusing).
I'm going to work on writing a unit test to reproduce this in our test system, which is arguably the more challenging part of this issue <.< .
@mlucy -- would you mind opening an issue for performance? (I could do it, but you have more info on what you observed). For example, is the performance bad just for unindexed orderBy or both?
Activity
coffeemug commentedon Dec 23, 2013
This might be a consequence of #1032, but at first glance I can't tell how that might be the case. It seems more likely that it's a bug.
divad12 commentedon Dec 23, 2013
@coffeemug The data set I sent to @neumino does not have any null or missing values for the
github_starsandvimorg_ratingfields.coffeemug commentedon Dec 23, 2013
@divad12 -- ok, thanks for chiming in. This looks like a pretty bad bug and we'll push a fix ASAP (but unfortunately like after the holidays, since many people are off).
coffeemug commentedon Dec 23, 2013
Also, sorry you ran into this!
divad12 commentedon Dec 23, 2013
@coffeemug Cool, thanks for acknowledging it. That's alright, just not using the secondary index works well enough for me for now.
Have a good holidays!
improve search perf vastly and fix issues by searching on in-memory l…
jdoliner commentedon Dec 24, 2013
I'd be interested to know if this is present in 1.10 and 1.09. The streaming code was recently rewritten which could be to blame for this. Also I'm not 100% certain how this query gets executed, I'm assuming it we're not smart enough to ignore the in memory part of the
order_bybut maybe I'm wrong.mlucy commentedon Jan 2, 2014
Assigning to myself because the #1 candidate for the problem is my recent streaming changes.
mlucy commentedon Jan 4, 2014
Working on this now.
mlucy commentedon Jan 4, 2014
So, this turns out to be something super dumb that I did. The class
reader_tindatum_stream.cchas a member variablefinishedthat we use to determine when to sendSUCCESS_SEQUENCEinstead ofSUCCESS_PARTIALin the protobufResponse. (It's also used for other logic internally inreader_t.) The problem is that this member variable doesn't mean "the stream is exhausted", it means "the shards are exhausted". Normally these are identical, because we try not to keep things hanging around in memory, but in the specific case of a anorder_byon both an indexed and non-indexed field we do some clever shenanigans to get the sorting right and the two meanings diverge.I think we can fix this by changing that one predicate (and renaming the variable to be less confusing).
I'm going to work on writing a unit test to reproduce this in our test system, which is arguably the more challenging part of this issue <.< .
mlucy commentedon Jan 4, 2014
Also, our performance on this workload is atrocious; our throughput is something like 1000 rows/sec in debug mode.
mlucy commentedon Jan 4, 2014
This is in review 1102 by @jdoliner .
coffeemug commentedon Jan 4, 2014
@mlucy -- would you mind opening an issue for performance? (I could do it, but you have more info on what you observed). For example, is the performance bad just for unindexed
orderByor both?mlucy commentedon Jan 8, 2014
@coffeemug -- opened in #1828 .
mlucy commentedon Jan 8, 2014
This is in next and cherry-picked into v1.11.x. @AtnNn -- could we do a point release for this when you get back?
AtnNn commentedon Jan 8, 2014
Yes, we can do a point-release tomorrow or Friday. I will confer with my coffee mug.