• Yuchen Pei's avatar
    MDEV-28739 MDEV-29421 Remove spider persistent table stats · bdfd93d3
    Yuchen Pei authored
    We remove the call to update spider persistent table stats (sts/crd)
    in spider_free_share(). This prevents spider from opening and closing
    further tables during close(), which fixes the following issues:
    
    MDEV-28739: ha_spider::close() is called during tdc_start_shutdown(),
    which is called after query_cache_destroy(). Closing the sts/crd Aria
    tables will trigger a call to Query_cache::invalidate_table(), which
    will attempt to use the query cache mutex structure_guard_mutex
    destroyed previously.
    
    MDEV-29421: during ha_spider::close(), spider_free_share() could
    trigger another spider_free_share() through updating sts/crd table,
    because open_table() calls tc_add_table(), which could trigger another
    ha_spider::close()...
    
    Since spider sts/crd system tables are only updated here, there's no
    use for these tables any more, and we remove all uses of these tables
    too.
    
    The removal should not cause any performance issue, as in memory
    spider table stats are only updated based on a time
    interval (spider_sts_interval and spider_crd_interval), which defaults
    to 10 seconds. It should not affect accuracy either, due to the
    infrequency of server restart. And inaccurate stats are not a problem
    for optimizer anyway.
    
    To be on the safe side, we defer the removal of the spider sts/crd
    tables themselves to future.
    bdfd93d3
spd_sys_table.h 10.9 KB