Skip to content
  • Debarun Banerjee's avatar
    65c0af9a
    BUG#20510811 - RQG_ALTER_ONLINE_PART RUN INTO ASSERTION: NODE->ENTRY · 65c0af9a
    Debarun Banerjee authored
    
    
    Problem :
    ---------
    If "ALTER TABLE ADD UNIQUE index" operation fails, the command adds
    the new index in dict_table_t in "Prepare" stage and attempts to
    remove the index in "Rollback" stage. We prevent the removal if any
    concurrent operation is going on the table. This is done by checking
    if dict_table_t is referenced by other objects (n_ref_count > 1).
    
    In 5.7 partitioned table, we keep the dict_table_t objects for the
    partitions in shared place and for multiple TABLE objects, referred by
    concurrent operations, we keep only one reference for dict_table_t
    object (n_ref_count = 1).
    
    It causes the ALTER TABLE to remove the index entry and concurrent
    INSERT hits the ASSERT as ins_node_t::entry_list count doesn't match
    the number of indexes in dict_table_t.
    
    Solution :
    ----------
    Increment already cached dict_table_t reference count for all the
    partitions during ha_innopart handler initialization.
    
    a. New dictionary interface to increase and decrease reference count
       for already cached dict_cache_t element.
          dict_table_t::acquire
          dict_table_t::release
    b. Acquire [dict_sys->mutex] during ope/close ha_innopart handler and
       increase/decrease dict_table_t reference count for all partitions.
          Ha_innopart_share::open_table_parts
          Ha_innopart_share::close_table_part
    
    Reviewed-by: default avatarMarko Makela <marko.makela@oracle.com>
    Reviewed-by: default avatarMattias Jonsson <mattias.jonsson@oracle.com>
    
    RB: 8463
    65c0af9a
    BUG#20510811 - RQG_ALTER_ONLINE_PART RUN INTO ASSERTION: NODE->ENTRY
    Debarun Banerjee authored
    
    
    Problem :
    ---------
    If "ALTER TABLE ADD UNIQUE index" operation fails, the command adds
    the new index in dict_table_t in "Prepare" stage and attempts to
    remove the index in "Rollback" stage. We prevent the removal if any
    concurrent operation is going on the table. This is done by checking
    if dict_table_t is referenced by other objects (n_ref_count > 1).
    
    In 5.7 partitioned table, we keep the dict_table_t objects for the
    partitions in shared place and for multiple TABLE objects, referred by
    concurrent operations, we keep only one reference for dict_table_t
    object (n_ref_count = 1).
    
    It causes the ALTER TABLE to remove the index entry and concurrent
    INSERT hits the ASSERT as ins_node_t::entry_list count doesn't match
    the number of indexes in dict_table_t.
    
    Solution :
    ----------
    Increment already cached dict_table_t reference count for all the
    partitions during ha_innopart handler initialization.
    
    a. New dictionary interface to increase and decrease reference count
       for already cached dict_cache_t element.
          dict_table_t::acquire
          dict_table_t::release
    b. Acquire [dict_sys->mutex] during ope/close ha_innopart handler and
       increase/decrease dict_table_t reference count for all partitions.
          Ha_innopart_share::open_table_parts
          Ha_innopart_share::close_table_part
    
    Reviewed-by: default avatarMarko Makela <marko.makela@oracle.com>
    Reviewed-by: default avatarMattias Jonsson <mattias.jonsson@oracle.com>
    
    RB: 8463
Loading