<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer">26790</assigned-user-id>
  <attachments-count type="integer">0</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2008-12-05T13:46:36+13:00</created-at>
  <creator-id type="integer">26789</creator-id>
  <milestone-due-on type="datetime">2009-05-20T00:00:00+12:00</milestone-due-on>
  <milestone-id type="integer">18592</milestone-id>
  <number type="integer">126</number>
  <permalink>duplicate-searchbrowse-topic-results-after-multiple-edits</permalink>
  <priority type="integer">1</priority>
  <project-id type="integer">14288</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>resolved</state>
  <tag>browse bug correctness duplicates oai-record search xml zebra zoom</tag>
  <title>Duplicate search/browse topic results after multiple edits</title>
  <updated-at type="datetime">2009-03-09T12:26:34+13:00</updated-at>
  <user-id type="integer">26790</user-id>
  <user-name>Kieran P</user-name>
  <creator-name>James</creator-name>
  <assigned-user-name>Kieran P</assigned-user-name>
  <url>http://kete.lighthouseapp.com/projects/14288/tickets/126</url>
  <milestone-title>1.2</milestone-title>
  <original-body>## Summary ##

After a number of edits, a topic can end up appearing multiple times in search results.

An example of this happening can be seen at http://kete.net.nz/site/all/topics/ right now. (You may need to view 10 or 20 results on a page to see the problem.)

## Possible causes ##

Possible causes could be:

* Invalid XML OAI record being generated and therefore not being being locate an existing zoom record for the item
* A non-matching XML OAI recording being generated, leading to the same problem as mentioned above

Possible indirect causes of these could be:
* Race conditions in zoom related code in Kete
* A bug in XML OAI generating code that leads to invalid/inconsistent XML generation
* Another known code issue

## Possible Solutions ##

* Locate and fix bugs in OAI XML generation or zoom interface code
* Update Zebra to a version which allows exact matching of individual records by OAI Identifier, rather than entire record</original-body>
  <latest-body>## Summary ##

After a number of edits, a topic can end up appearing multiple times in search results.

An example of this happening can be seen at http://kete.net.nz/site/all/topics/ right now. (You may need to view 10 or 20 results on a page to see the problem.)

## Possible causes ##

Possible causes could be:

* Invalid XML OAI record being generated and therefore not being being locate an existing zoom record for the item
* A non-matching XML OAI recording being generated, leading to the same problem as mentioned above

Possible indirect causes of these could be:
* Race conditions in zoom related code in Kete
* A bug in XML OAI generating code that leads to invalid/inconsistent XML generation
* Another known code issue

## Possible Solutions ##

* Locate and fix bugs in OAI XML generation or zoom interface code
* Update Zebra to a version which allows exact matching of individual records by OAI Identifier, rather than entire record</latest-body>
  <original-body-html>&lt;div&gt;&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;After a number of edits, a topic can end up appearing multiple
times in search results.&lt;/p&gt;
&lt;p&gt;An example of this happening can be seen at &lt;a href=&quot;http://kete.net.nz/site/all/topics/&quot;&gt;http://kete.net.nz/site/all/topics/&lt;/a&gt;
right now. (You may need to view 10 or 20 results on a page to see
the problem.)&lt;/p&gt;
&lt;h2&gt;Possible causes&lt;/h2&gt;
&lt;p&gt;Possible causes could be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Invalid XML OAI record being generated and therefore not being
being locate an existing zoom record for the item&lt;/li&gt;
&lt;li&gt;A non-matching XML OAI recording being generated, leading to
the same problem as mentioned above&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Possible indirect causes of these could be: * Race conditions in
zoom related code in Kete * A bug in XML OAI generating code that
leads to invalid/inconsistent XML generation * Another known code
issue&lt;/p&gt;
&lt;h2&gt;Possible Solutions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Locate and fix bugs in OAI XML generation or zoom interface
code&lt;/li&gt;
&lt;li&gt;Update Zebra to a version which allows exact matching of
individual records by OAI Identifier, rather than entire
record&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer">26298</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>## Summary ##

After a number of edits, a topic can end up appearing multiple times in search results.

An example of this happening can be seen at http://kete.net.nz/site/all/topics/ right now. (You may need to view 10 or 20 results on a page to see the problem.)

## Possible causes ##

Possible causes could be:

* Invalid XML OAI record being generated and therefore not being being locate an existing zoom record for the item
* A non-matching XML OAI recording being generated, leading to the same problem as mentioned above

Possible indirect causes of these could be:

* Race conditions in zoom related code in Kete
* A bug in XML OAI generating code that leads to invalid/inconsistent XML generation
* Another known code issue

## Possible Solutions ##

* Locate and fix bugs in OAI XML generation or zoom interface code
* Update Zebra to a version which allows exact matching of individual records by OAI Identifier, rather than entire record</body>
      <body-html>&lt;div&gt;&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;After a number of edits, a topic can end up appearing multiple
times in search results.&lt;/p&gt;
&lt;p&gt;An example of this happening can be seen at &lt;a href=&quot;http://kete.net.nz/site/all/topics/&quot;&gt;http://kete.net.nz/site/all/topics/&lt;/a&gt;
right now. (You may need to view 10 or 20 results on a page to see
the problem.)&lt;/p&gt;
&lt;h2&gt;Possible causes&lt;/h2&gt;
&lt;p&gt;Possible causes could be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Invalid XML OAI record being generated and therefore not being
being locate an existing zoom record for the item&lt;/li&gt;
&lt;li&gt;A non-matching XML OAI recording being generated, leading to
the same problem as mentioned above&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Possible indirect causes of these could be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Race conditions in zoom related code in Kete&lt;/li&gt;
&lt;li&gt;A bug in XML OAI generating code that leads to
invalid/inconsistent XML generation&lt;/li&gt;
&lt;li&gt;Another known code issue&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Possible Solutions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Locate and fix bugs in OAI XML generation or zoom interface
code&lt;/li&gt;
&lt;li&gt;Update Zebra to a version which allows exact matching of
individual records by OAI Identifier, rather than entire
record&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-12-05T13:46:36+13:00</created-at>
      <creator-id type="integer">26789</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">18592</milestone-id>
      <number type="integer">126</number>
      <permalink>duplicate-searchbrowse-topic-results-after-multiple-edits</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14288</project-id>
      <state>new</state>
      <tag>browse bug correctness oai-record search xml zebra zoom</tag>
      <title>Duplicate search/browse topic results after multiple edits</title>
      <updated-at type="datetime">2008-12-05T13:46:48+13:00</updated-at>
      <user-id type="integer">26789</user-id>
      <user-name>James</user-name>
      <creator-name>James</creator-name>
      <assigned-user-name>Kete</assigned-user-name>
      <url>http://kete.lighthouseapp.com/projects/14288/tickets/126</url>
      <milestone-title>1.2</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">26298</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>I noticed that a topic on Kete net (enhancement topic) had duplicate records  after

* related topic was added

* and then that related topic had comment added</body>
      <body-html>&lt;div&gt;&lt;p&gt;I noticed that a topic on Kete net (enhancement topic) had
duplicate records after&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;related topic was added&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;and then that related topic had comment added&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-12-17T15:07:14+13:00</created-at>
      <creator-id type="integer">26789</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">18592</milestone-id>
      <number type="integer">126</number>
      <permalink>duplicate-searchbrowse-topic-results-after-multiple-edits</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14288</project-id>
      <state>new</state>
      <tag>browse bug correctness oai-record search xml zebra zoom</tag>
      <title>Duplicate search/browse topic results after multiple edits</title>
      <updated-at type="datetime">2008-12-17T15:07:24+13:00</updated-at>
      <user-id type="integer">26790</user-id>
      <user-name>Kieran P</user-name>
      <creator-name>James</creator-name>
      <assigned-user-name>Kete</assigned-user-name>
      <url>http://kete.lighthouseapp.com/projects/14288/tickets/126</url>
      <milestone-title>1.2</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">26789</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-12-17T15:16:24+13:00</created-at>
      <creator-id type="integer">26789</creator-id>
      <diffable-attributes type="yaml">--- 
:assigned_user: 26298
</diffable-attributes>
      <milestone-id type="integer">18592</milestone-id>
      <number type="integer">126</number>
      <permalink>duplicate-searchbrowse-topic-results-after-multiple-edits</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14288</project-id>
      <state>new</state>
      <tag>browse bug correctness oai-record search xml zebra zoom</tag>
      <title>Duplicate search/browse topic results after multiple edits</title>
      <updated-at type="datetime">2008-12-17T15:16:28+13:00</updated-at>
      <user-id type="integer">26789</user-id>
      <user-name>James</user-name>
      <creator-name>James</creator-name>
      <assigned-user-name>James</assigned-user-name>
      <url>http://kete.lighthouseapp.com/projects/14288/tickets/126</url>
      <milestone-title>1.2</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">26789</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Re. Kieran's comment (see above):

&gt; I noticed that a topic on Kete net (enhancement topic) had duplicate records after
&gt; * related topic was added
&gt; * and then that related topic had comment added

I have investigated this specifically and unfortunately could not find any correlation between this taking place and search result duplication.

---

During testing I did find an issue with moderation which has subsequently been fixed which would have contributed to search result duplication when full moderation was turned on or possibly if moderation was actively in use. See http://github.com/kete/kete/commit/6eaf5d1661f70f7f3039ed5a97d85a5da93420e8 for more details.

One common pattern among topics that have duplicates is that they always have related topic(s) and it seems have a number of edits in both related topics by different parties in quick succession.

This seems to point to some kind of race condition in the zoom record deletion and replacement routines relating to related topics.

I think this should probably be next area of investigation.

Cheers,

James</body>
      <body-html>&lt;div&gt;&lt;p&gt;Re. Kieran's comment (see above):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I noticed that a topic on Kete net (enhancement topic) had
duplicate records after * related topic was added * and then that
related topic had comment added&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I have investigated this specifically and unfortunately could
not find any correlation between this taking place and search
result duplication.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;During testing I did find an issue with moderation which has
subsequently been fixed which would have contributed to search
result duplication when full moderation was turned on or possibly
if moderation was actively in use. See &lt;a href=&quot;http://github.com/kete/kete/commit/6eaf5d1661f70f7f3039ed5a97d85a5da93420e8&quot;&gt;
http://github.com/kete/kete/comm...&lt;/a&gt; for more details.&lt;/p&gt;
&lt;p&gt;One common pattern among topics that have duplicates is that
they always have related topic(s) and it seems have a number of
edits in both related topics by different parties in quick
succession.&lt;/p&gt;
&lt;p&gt;This seems to point to some kind of race condition in the zoom
record deletion and replacement routines relating to related
topics.&lt;/p&gt;
&lt;p&gt;I think this should probably be next area of investigation.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;James&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-12T15:25:13+13:00</created-at>
      <creator-id type="integer">26789</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
:tag: browse bug correctness oai-record search xml zebra zoom
</diffable-attributes>
      <milestone-id type="integer">18592</milestone-id>
      <number type="integer">126</number>
      <permalink>duplicate-searchbrowse-topic-results-after-multiple-edits</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14288</project-id>
      <state>open</state>
      <tag>browse bug correctness duplicates oai-record search xml zebra zoom</tag>
      <title>Duplicate search/browse topic results after multiple edits</title>
      <updated-at type="datetime">2009-01-12T15:25:16+13:00</updated-at>
      <user-id type="integer">26789</user-id>
      <user-name>James</user-name>
      <creator-name>James</creator-name>
      <assigned-user-name>James</assigned-user-name>
      <url>http://kete.lighthouseapp.com/projects/14288/tickets/126</url>
      <milestone-title>1.2</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">26790</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-10T13:11:32+13:00</created-at>
      <creator-id type="integer">26789</creator-id>
      <diffable-attributes type="yaml">--- 
:assigned_user: 26789
</diffable-attributes>
      <milestone-id type="integer">18592</milestone-id>
      <number type="integer">126</number>
      <permalink>duplicate-searchbrowse-topic-results-after-multiple-edits</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14288</project-id>
      <state>open</state>
      <tag>browse bug correctness duplicates oai-record search xml zebra zoom</tag>
      <title>Duplicate search/browse topic results after multiple edits</title>
      <updated-at type="datetime">2009-02-10T13:11:33+13:00</updated-at>
      <user-id type="integer">26790</user-id>
      <user-name>Kieran P</user-name>
      <creator-name>James</creator-name>
      <assigned-user-name>Kieran P</assigned-user-name>
      <url>http://kete.lighthouseapp.com/projects/14288/tickets/126</url>
      <milestone-title>1.2</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">26790</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>No further duplicate search results have shown up in a while. The integration tests can't find any issues with the most common use cases. If the problem happens again, we can open this ticket. For now, I'd call it resolved (and marking ticket as such).</body>
      <body-html>&lt;div&gt;&lt;p&gt;No further duplicate search results have shown up in a while.
The integration tests can't find any issues with the most common
use cases. If the problem happens again, we can open this ticket.
For now, I'd call it resolved (and marking ticket as such).&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2009-03-09T12:26:31+13:00</created-at>
      <creator-id type="integer">26789</creator-id>
      <diffable-attributes type="yaml">--- 
:state: open
</diffable-attributes>
      <milestone-id type="integer">18592</milestone-id>
      <number type="integer">126</number>
      <permalink>duplicate-searchbrowse-topic-results-after-multiple-edits</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14288</project-id>
      <state>resolved</state>
      <tag>browse bug correctness duplicates oai-record search xml zebra zoom</tag>
      <title>Duplicate search/browse topic results after multiple edits</title>
      <updated-at type="datetime">2009-03-09T12:26:34+13:00</updated-at>
      <user-id type="integer">26790</user-id>
      <user-name>Kieran P</user-name>
      <creator-name>James</creator-name>
      <assigned-user-name>Kieran P</assigned-user-name>
      <url>http://kete.lighthouseapp.com/projects/14288/tickets/126</url>
      <milestone-title>1.2</milestone-title>
    </version>
  </versions>
</ticket>
