Skip to content
Snippets Groups Projects
  • Kirill Shcherbatov's avatar
    302bb324
    box: make functional index creation transactional · 302bb324
    Kirill Shcherbatov authored
    The _func_index space trigger used to reject an insertion of a
    tuple that defines an invalid functional index.
    As insertion in _index space had been completed before, a garbage
    is kept in _index space in such case.
    
    We need to do something with the yelding _func_index trigger(that
    rebuilds an index) to wrap all index creation operation in DDL
    transaction in further patches (because only the first DDL
    operation may yeld now).
    
    This problem could be trivially solved with preparatory
    initialization of index_def function ponter: the memtx_tree
    index construction would perform all required job in such case.
    Therefore the following index rebuild in _func_index trigger
    becomes redundant and should be omitted.
    
    In other words, a trivial prefetch operation makes possible
    a transactional index creation (with space:create_index operation).
    
    As for index construction during recovery (a lack of function
    cache during recovery was the main motivation to introduce
    _func_index space), it's workflow is kept unchanged.
    
    Follow up #1250
    Needed for #4348
    Closes #4401
    302bb324
    History
    box: make functional index creation transactional
    Kirill Shcherbatov authored
    The _func_index space trigger used to reject an insertion of a
    tuple that defines an invalid functional index.
    As insertion in _index space had been completed before, a garbage
    is kept in _index space in such case.
    
    We need to do something with the yelding _func_index trigger(that
    rebuilds an index) to wrap all index creation operation in DDL
    transaction in further patches (because only the first DDL
    operation may yeld now).
    
    This problem could be trivially solved with preparatory
    initialization of index_def function ponter: the memtx_tree
    index construction would perform all required job in such case.
    Therefore the following index rebuild in _func_index trigger
    becomes redundant and should be omitted.
    
    In other words, a trivial prefetch operation makes possible
    a transactional index creation (with space:create_index operation).
    
    As for index construction during recovery (a lack of function
    cache during recovery was the main motivation to introduce
    _func_index space), it's workflow is kept unchanged.
    
    Follow up #1250
    Needed for #4348
    Closes #4401