• Hi,

    we run a wordpress site with your plugin and noticed that it causes inconsistencies in our mysql replication from time to time.
    The table yarpp_related_cache is filled by using a query which uses (in our case) “…having score >= 4.00 and ID != 0 and bit_or(terms.term_taxonomy_id in (0)) = 0 order by score desc limit 4)…”

    This causes problems if the query returns multiple IDs for the same score. As the order in which these are returned is not guaranteed for statement based replication we get different IDs for some reference_ID on slave and master.
    To fix this i would suggest to change classes/YARPP_Cache.php:247
    $newsql .= ” order by score desc limit $limit”;
    to
    $newsql .= ” order by score desc, ID desc limit $limit”;

    This will make sure that the same IDs get inserted.

    Regards,
    Sebastian

    https://wordpress.org/plugins/yet-another-related-posts-plugin/

Viewing 1 replies (of 1 total)
  • Plugin Author YARPP

    (@jeffparker)

    That’s a good suggestion. We’ll work to get that in a future release. Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘YARRP Queries result in inconsistencies on mysql slaves’ is closed to new replies.