Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-1188

assertion 'fColumn.get() && fSub && fFunc' failed , caused lost connection to MySQL server during query and crash of mysql

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.2
    • 1.1.7
    • MDB Plugin
    • None
    • MCS run on VMs, Multi Server ColumnStore System UM1-PM1 ;guest OS RHEL 7.4
    • 2018-17, 2018-18, 2018-19, 2018-20, 2018-21

    Description

      assertion 'fColumn.get() && fSub && fFunc' failed , caused lost connection to MySQL server during query and crash of mysql

      crash occurred during the execution of query41 done with small modification –
      attached original query and modified query
      attached also the stack trace in the um1.xentio.lan.err file

      how to repeat :
      loaded tpc-ds shema and 1TB tpc-ds data

      MariaDB [tpcds_1000]> select  distinct(i_product_name)
          ->  from item
          ->  where i_manufact_id between 742 and 742+40
          ->    and
          -> (select count(*) as item_cnt
          ->         from item
          ->         where (i_manufact = i_manufact and
          ->         ((i_category = 'Women' and
          ->         (i_color = 'orchid' or i_color = 'papaya') and
          ->         (i_units = 'Pound' or i_units = 'Lb') and
          ->         (i_size = 'petite' or i_size = 'medium')
          ->         ) or
          ->         (i_category = 'Women' and
          ->         (i_color = 'burlywood' or i_color = 'navy') and
          ->         (i_units = 'Bundle' or i_units = 'Each') and
          ->         (i_size = 'N/A' or i_size = 'extra large')
          ->         ) or
          ->         (i_category = 'Men' and
          ->         (i_color = 'bisque' or i_color = 'azure') and
          ->         (i_units = 'N/A' or i_units = 'Tsp') and
          ->         (i_size = 'small' or i_size = 'large')
          ->         ) or
          ->         (i_category = 'Men' and
          ->         (i_color = 'chocolate' or i_color = 'cornflower') and
          ->         (i_units = 'Bunch' or i_units = 'Gross') and
          ->         (i_size = 'petite' or i_size = 'medium')
          ->         ))) or
          ->        (i_manufact = i_manufact and
          ->         ((i_category = 'Women' and
          ->         (i_color = 'salmon' or i_color = 'midnight') and
          ->         (i_units = 'Oz' or i_units = 'Box') and
          ->         (i_size = 'petite' or i_size = 'medium')
          ->         ) or
          ->         (i_category = 'Women' and
          ->         (i_color = 'snow' or i_color = 'steel') and
          ->         (i_units = 'Carton' or i_units = 'Tbl') and
          ->         (i_size = 'N/A' or i_size = 'extra large')
          ->         ) or
          ->         (i_category = 'Men' and
          ->         (i_color = 'purple' or i_color = 'gainsboro') and
          ->         (i_units = 'Dram' or i_units = 'Unknown') and
          ->         (i_size = 'small' or i_size = 'large')
          ->         ) or
          ->         (i_category = 'Men' and
          ->         (i_color = 'metallic' or i_color = 'forest') and
          ->         (i_units = 'Gram' or i_units = 'Ounce') and
          ->         (i_size = 'petite' or i_size = 'medium')
          ->         )))) > 0
          ->  order by i_product_name
          ->  limit 100;
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      
      

      mariadb columnstore err.log :

      Feb  1 13:21:33 um1 Calpont[1289]: 33.974480 |0|0|0| E 00 CAL0000: /home/builder/mariadb-columnstore-server/mariadb-columnstore-engine/dbcon/mysql/ha_scalar_sub.cpp@203: assertion 'fColumn.get() && fSub && fFunc' failed
      

      Attachments

        1. item_table.txt
          5 kB
        2. modified_query.txt
          2 kB
        3. query41_original.txt
          2 kB
        4. um1.xentio.lan.err
          11 kB

        Issue Links

          Activity

            Hi,

            Can you please send us the schema for the item table?

            LinuxJedi Andrew Hutchings (Inactive) added a comment - Hi, Can you please send us the schema for the item table?

            Issue confirmed. Many thanks.

            LinuxJedi Andrew Hutchings (Inactive) added a comment - Issue confirmed. Many thanks.

            The following simple query will also crash the columnstore server:
            select i_product_name
            from item
            where i_manufact_id > 742 and
            (select count as item_cnt from item where ((i_category = 'Women' ))) > 0
            ;

            rprakash Ravi Prakash (Inactive) added a comment - The following simple query will also crash the columnstore server: select i_product_name from item where i_manufact_id > 742 and (select count as item_cnt from item where ((i_category = 'Women' ))) > 0 ;

            Comment for QA:
            This problem is caused by handling a sub-query marked as an CACHED_ITEM by MariaDB server. The columnstore cannot assume that this is cached and it needed to parse the subquery any way. Note that a single subquery in the WHERE clause is not marked as a cached item. The code change also touched handling of constant expressions "(TRUE or FALSE)", "1=0" or "1=1". I tested the fix using the original supplied query as well as the following:
            CREATE TABLE cs_item (
            `i_product_name` char(50) DEFAULT NULL,
            `i_category` char(50) DEFAULT NULL,
            `i_manufact_id` int(11) DEFAULT NULL
            ) ENGINE=Columnstore DEFAULT CHARSET=latin1 ;

            select i_product_name from cs_item
            where i_manufact_id > 742 and (select count as item_cnt from cs_item where ((i_category = 'Women' ))) > 0 ;

            select i_product_name from cs_item
            where i_manufact_id > 742 and (select count as item_cnt from cs_item where ((i_category = 'Women' ))) > 0 and (1=0);

            select i_product_name from cs_item
            where i_manufact_id > 742 and (select count as item_cnt from cs_item where ((i_category = 'Women' ))) > 0 and (1=1);

            select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' ;
            select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND (TRUE OR FALSE);
            select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND ( 1 = 0);
            select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND ( 1 = 1);
            select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND ( 1 > 5/7);
            select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND ( 1 > 7/5);
            select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND ( i_manufact_id > 300 OR i_manufact_id <= 300);
            select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND (TRUE);
            select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND (FALSE);

            rprakash Ravi Prakash (Inactive) added a comment - Comment for QA: This problem is caused by handling a sub-query marked as an CACHED_ITEM by MariaDB server. The columnstore cannot assume that this is cached and it needed to parse the subquery any way. Note that a single subquery in the WHERE clause is not marked as a cached item. The code change also touched handling of constant expressions "(TRUE or FALSE)", "1=0" or "1=1". I tested the fix using the original supplied query as well as the following: CREATE TABLE cs_item ( `i_product_name` char(50) DEFAULT NULL, `i_category` char(50) DEFAULT NULL, `i_manufact_id` int(11) DEFAULT NULL ) ENGINE=Columnstore DEFAULT CHARSET=latin1 ; select i_product_name from cs_item where i_manufact_id > 742 and (select count as item_cnt from cs_item where ((i_category = 'Women' ))) > 0 ; select i_product_name from cs_item where i_manufact_id > 742 and (select count as item_cnt from cs_item where ((i_category = 'Women' ))) > 0 and (1=0); select i_product_name from cs_item where i_manufact_id > 742 and (select count as item_cnt from cs_item where ((i_category = 'Women' ))) > 0 and (1=1); select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' ; select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND (TRUE OR FALSE); select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND ( 1 = 0); select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND ( 1 = 1); select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND ( 1 > 5/7); select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND ( 1 > 7/5); select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND ( i_manufact_id > 300 OR i_manufact_id <= 300); select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND (TRUE); select i_product_name from cs_item where i_manufact_id > 742 and i_category = 'Women' AND (FALSE);

            The fix is to to not skip the walking of an item marked as CACHED_ITEM. A subquery is not really cached and needed to be traversed before it can be converted into column store tree.

            rprakash Ravi Prakash (Inactive) added a comment - The fix is to to not skip the walking of an item marked as CACHED_ITEM. A subquery is not really cached and needed to be traversed before it can be converted into column store tree.

            Build verified: 1.1.7-1

            Verified test cases in the ticket.

            dleeyh Daniel Lee (Inactive) added a comment - Build verified: 1.1.7-1 Verified test cases in the ticket.

            People

              dleeyh Daniel Lee (Inactive)
              winstone Zdravelina Sokolovska (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.