Support » Plugin: WordPress Gallery Plugin - NextGEN Gallery » Album short tag fails with MariaDB MaxScale

  • We’re using MariaDB’s MaxScale to load balance queries to MariaDB Galera Cluster. Since we’ve moved there, albums in NextGEN Gallery don’t display; they simply return “no images found”. We’ve traced this to a SQL query used to display the album; this is what we’ve got in the logs:

    [Tue May 23 12:09:22 2017] [error] [client XXX.XXX.XXX.XXX] WordPress database error Routing query to backend failed. See the error log for further details. for query SELECT DISTINCT wp_8_ngg_gallery.*, 1 AS is_gallery, 0 AS is_album, @ordered_by := FIND_IN_SET(gid, ‘11,10,9,8,7,6’) AS ordered_by , GROUP_CONCAT(CONCAT_WS(‘@@’, meta_key, meta_value)) AS ‘extras’ FROM wp_8_ngg_gallery LEFT OUTER JOIN wp_8_postmeta ON wp_8_postmeta.post_id = extras_post_id WHERE (gid IN (6, 7, 8, 9, 10, 11)) GROUP BY wp_8_ngg_gallery.gid ORDER BY ordered_by DESC made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/twentyeleven/single.php’), get_template_part, locate_template, load_template, require(‘/themes/twentyeleven/content-single.php’), the_content, apply_filters(‘the_content’), WP_Hook->apply_filters, call_user_func_array, C_NextGen_Shortcode_Manager->parse_content, C_NextGen_Shortcode_Manager->execute_found_shortcode, call_user_func, M_NextGen_Basic_Album->ngglegacy_shortcode, C_Displayed_Gallery_Renderer->display_images, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, Mixin_Displayed_Gallery_Renderer->display_images, C_Displayed_Gallery_Renderer->render, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, A_NextGen_Basic_Album_Routes->render, Mixin->call_parent, ExtensibleObject->call_method, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, Mixin_Displayed_Gallery_Renderer->render, C_Display_Type_Controller->index_action, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, A_NextGen_Basic_Album_Controller->index_action, C_Displayed_Gallery->get_included_entities, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, Mixin_Displayed_Gallery_Queries->get_included_entities, C_Displayed_Gallery->get_entities, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, Mixin_Displayed_Gallery_Queries->get_entities, C_Displayed_Gallery->_get_album_and_gallery_entities, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, Mixin_Displayed_Gallery_Queries->_get_album_and_gallery_entities, C_Displayed_Gallery->_entities_to_galleries_and_albums, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, Mixin_Displayed_Gallery_Queries->_entities_to_galleries_and_albums, C_Gallery_Mapper->run_query, ExtensibleObject->__call, ExtensibleObject->_exec_cached_method, ReflectionMethod->invokeArgs, C_CustomTable_DataMapper_Driver_Mixin->run_query, referer: <omitted>

    The use of sql variables is a known limitation with MaxScale, and I’ve verified that changing MaxScale’s configuration to route these types of queries to master only resolves the issue. I’m hesitant to make such a change, which would impact many systems, because of a single plugin. Is there a way to rewrite this part of the code without sql variables? It appears to be the only part of NextGEN Gallery written that way.

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

    (@photocrati)

    @mackensen – Thanks for bringing this to our attention, we are not aware of this particular problem and have not seen any other reports of this issue.

    I’ll write it up for our developers to review further although your “work-around” may be the most suitable solution for the time being.

    Thanks!

    – Cais.

Viewing 1 replies (of 1 total)
  • The topic ‘Album short tag fails with MariaDB MaxScale’ is closed to new replies.