Opened 9 years ago

Closed 9 years ago

#674 closed defect (fixed)

Remote Database Sorting Incorrectly

Reported by: Dylan G Owned by: Olly Betts
Priority: normal Milestone: 1.2.21
Component: Backend-Remote Version:
Severity: normal Keywords: remote
Cc: Blocked By:
Blocking: Operating System: All

Description

When querying databases through "xapian-progsrv" and sorting by value there appears to be circumstances under which the results returned are not correctly sorted by that value. A comparison has been done to accessing the same databases directly and there is no problem, but when using xapian-progsrv it fails.

I've created a small failing example with 2 databases and a couple of ruby scripts to demonstrate my point at https://github.com/DylanGriffith/xapian-remote-test . The databases only contain value 0, there are no terms or data. Those values are integers that have gone through Xapian sort_serialise . Doing a query using local databases it works. When using xapian-progsrv through ssh it fails (ie. the results returned are not sorted in the way they should be).

Attachments (1)

remote-sort-key.patch (4.9 KB ) - added by Olly Betts 9 years ago.
seems to fix it, but changes mset serialisation

Download all attachments as: .zip

Change History (4)

by Olly Betts, 9 years ago

Attachment: remote-sort-key.patch added

seems to fix it, but changes mset serialisation

comment:1 by Olly Betts, 9 years ago

Component: OtherBackend-Remote
Milestone: 1.3.3
Status: newassigned

There's a bug in the patch (bogus addition of the line result += i.get_collapse_key();). The reporter confirmed on IRC that with that fixed and minor tweaks to apply to 1.2.x, the patch fixes the problem.

Marking to get applied for 1.3.3 as a first step.

comment:2 by Olly Betts, 9 years ago

Milestone: 1.3.31.2.21

Fixed in master by [1d5304340bbd86e6a55d12bab4240d618ed644a6].

For 1.2.x, I think the answer is to bump the minor protocol version, and add a variant of MSG_QUERY (e.g. MSG_QUERYSORTVALUE) which will get a new variant of REPLY_RESULTS (e.g. REPLY_RESULTSSORTVALUE) which includes the sort key. A 1.2.20 (or older) client will sent MSG_QUERY and still get REPLY_RESULTS back. A 1.2.21 client won't work with a 1.2.20 server, but that isn't something we promise will work.

comment:3 by Olly Betts, 9 years ago

Resolution: fixed
Status: assignedclosed

Backported for 1.2.21 in [1f95e44ffc369500655e9b2aeeeb74e2ecab15e9].

Note: See TracTickets for help on using tickets.