From time to time, we find duplicates in db_votingapi_cache - several records with equal values in fields: content_type, content_id, tag and function. It's seems as module do not update old record, but insert a new one instead.

It causes big troubles when we use a few (4) votings on the same page with view module to show them - view engine joins all 4 selects and in case of duplicates it results to too many records and slows down our server.

Comments

mauritsl’s picture

Project: Rate » Voting API
Version: 6.x-1.2 » 6.x-2.x-dev
Status: Active » Postponed (maintainer needs more info)

These tables are filled by the votingapi module. Rate does only do a call to votingapi_set_votes().

But I have seen such problems as well. It's often the case that you will not have the problem on another server as it might have to do with delays in MySQL's INSERT / UPDATE execution.

You may try to set the tallying settings of votingapi to tally the results in cron instead of directly. But that affects the rate widgets; they will not show the new ratings directly after voting.

This issue needs to be fixed in votingapi, probably using table locking.

What version of votingapi are you using?
Do you use other modules which affects rating or uses votingapi in some way?

Dandily’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thank you! It seems that you're right completely. Afther vote updates switched to cron we see no duplicates. Also site load is lower now.

mauritsl’s picture

Status: Fixed » Active

still an issue

legolasbo’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Drupal 6 is no longer supported. Closing old issues to clean up the issue queue.

Please reopen and update this issue if this is still an issue in the D7 or D8 version.