Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cached_likes don't stay in sync with the true state of the likes #98

Closed
btbonval opened this issue Jun 10, 2014 · 3 comments
Closed

cached_likes don't stay in sync with the true state of the likes #98

btbonval opened this issue Jun 10, 2014 · 3 comments
Assignees
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed

Comments

@btbonval
Copy link
Member

How to check for and fix synchronization issues directly in the database:
jywarren#129 (comment)

CREATE VIEW view_node_like_count AS SELECT node_selections.nid, sum(liking)
AS num_likes, cached_likes, title FROM node_selections, node WHERE node.nid
= node_selections.nid GROUP BY node_selections.nid;

SELECT * FROM view_node_like_count WHERE cached_likes <> num_likes;

UPDATE node,view_node_like_count
SET node.cached_likes = view_node_like_count.num_likes
WHERE
node.nid = view_node_like_count.nid AND
node.cached_likes <> view_node_like_count.num_likes;

There are still problems with synchronization. I resynchronized cached_likes earlier today.

Snippet from a relevant comment (jywarren#129 (comment)):
A particular user was associated with 25 like mismatches (in the top 5 mismatches), but that user has almost no association with the site in 2 years and the profile indicates no likes at all. The database suggests the user hasn't logged in since August 2013, but the last synchronization happened after that.

I just checked, the id is the same in users and rusers (checking in case the wrong id was being used to update likes)

@btbonval
Copy link
Member Author

Also of note, cached_likes is always less than the true value. Never more.

@btbonval btbonval self-assigned this Dec 2, 2014
@jywarren jywarren added the bug the issue is regarding one of our programs which faces problems when a certain task is executed label Apr 1, 2015
@ananyo2012
Copy link
Member

@jywarren Can you verify that this isn't happening now?

@jywarren
Copy link
Member

We need a more comprehensive overhaul of comment tallying, and I've written this up here:

#607 (comment)

I'll close this here and elaborate there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed
Projects
None yet
Development

No branches or pull requests

3 participants