Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-20226

Transaction Error: duplicate entry in ezsearch_search_phrase

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Customer request, 5.1
    • None
    • Search
    • None
    • eZ Publish 4.6

    Description

      We can get the following errors when we have two users searching for the same phrase at the same time:

      [ Dec 13 2012 15:25:46 ] [127.0.0.1] eZMySQLiDB:
      Query error (1062): Duplicate entry 'ez' for key 'ezsearch_search_phrase_phrase'. Query: INSERT INTO
                                    ezsearch_search_phrase ( phrase, phrase_count, result_count )
                               VALUES ( 'ez', 1, 32 )
      [ Dec 13 2012 15:25:46 ] [127.0.0.1] eZDBInterface::commit TRANSID-d38a19ea5c412d395dec65ca1c95b84b:
      Transaction in progress failed due to DB error, transaction was rollbacked. Transaction ID is TRANSID-d38a19ea5c412d395dec65ca1c95b84b.
      

      This can happen when the phrase is searched for the first time, and if another user searches for the same phrase the transaction fails.


      Steps to reproduce:

      1. Use Apache Bench to generate some load to your site, searching for the same keyword.
      You can use for example: ab -n 2000 -c 5 http://localhost/site/index.php/content/search?SearchText=SOMETHING&SearchButton=Search
      2. Log into your database and delete the entry generated for the search phrase.
      For example you can use this query: DELETE FROM `your_database`.`ezsearch_search_phrase` WHERE `ezsearch_search_phrase`.`phrase` = "SOMETHING";
      3. Continue on deleting the entry until you see the errors in error log.

      Deleting the entry is optional, but please take in mind that this issue happens randomly, so it may occur on a random basis. Consider this only a trick to help on reproducing this bug more easily.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ricardo.correia-obsolete@ez.no Ricardo Correia (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 5 hours, 5 minutes
                2d 5h 5m