• It looks like the delete_expired_transients() function was added in WordPress 4.9, and I think the SharDB get_table_from_query() function fails to pull the correct sharded database for the table. Instead, delete_expired_transients() checks the global table for every blog, and the transient tables don’t exist in the global table.

    Error logs show errors like:
    WordPress database error Table ‘wp_global.wp_517_options’ doesn’t exist for query DELETE a, b FROM wp_517_options a, wp_517_options b\n\t\t\tWHERE a.option_name LIKE ‘\\\\_transient\\\\_%’\n\t\t\tAND a.option_name NOT LIKE ‘\\\\_transient\\\\_timeout\\\\_%’\n\t\t\tAND b.option_name = CONCAT( ‘_transient_timeout_’, SUBSTRING( a.option_name, 12 ) )\n\t\t\tAND b.option_value < 1516748497 made by do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, delete_expired_transients, SharDB->query

    This isn’t a breaking feature (as you can turn off most of the automatic delete_expired_transients checks), but I thought maybe the preg_matches in db.php need to be updated for the way delete_expired_transients calls tables. I don’t know regex well enough to test this, though.

    Could this be the cause of the errors?

  • The topic ‘delete_expired_transients and SharDB’ is closed to new replies.