Skip to content
  • Marko Mäkelä's avatar
    7104f750
    Simplify WL#5526 online secondary index creation, part 3 of 3. · 7104f750
    Marko Mäkelä authored
    In online index creation, we set up a log for each index that is being
    created. Other threads may modify the table while the index records
    are being copied and sorted. Any thread that would modify the index
    will write a log record that will be applied at the end of the index
    creation.
    
    Previously, we used to copy delete-marked records to the index, and
    used to log operations with a higher granularity. This change gets rid
    of the delete-marked records and the tracking of the delete-mark
    flag. As a result, it decouples the purge of delete-marked records
    from online secondary index creation. We simply log two types of
    operations: ROW_OP_INSERT and ROW_OP_DELETE.
    
    enum row_op: Make the definition private to row0log.cc.
    Map the removed values as follows:
    ROW_OP_DELETE_MARK: ROW_OP_DELETE (that is, purge delete-marked
    records straight away).
    ROW_OP_DELETE_UNMARK: ROW_OP_INSERT.
    ROW_OP_PURGE: Remove (purge does not need to log anything).
    ROW_OP_DELETE_PURGE: ROW_OP_DELETE (rollback of INSERT).
    
    dict_index_online_log(): Remove. Declare row_log_online_op() in a wider scope.
    
    row_log_apply_ops(): Do not operate on delete-marked records. Instead,
    purge on delete and insert on delete-unmark.
    
    rb:1390 approved by Jimmy Yang, Sunny Bains
    7104f750
    Simplify WL#5526 online secondary index creation, part 3 of 3.
    Marko Mäkelä authored
    In online index creation, we set up a log for each index that is being
    created. Other threads may modify the table while the index records
    are being copied and sorted. Any thread that would modify the index
    will write a log record that will be applied at the end of the index
    creation.
    
    Previously, we used to copy delete-marked records to the index, and
    used to log operations with a higher granularity. This change gets rid
    of the delete-marked records and the tracking of the delete-mark
    flag. As a result, it decouples the purge of delete-marked records
    from online secondary index creation. We simply log two types of
    operations: ROW_OP_INSERT and ROW_OP_DELETE.
    
    enum row_op: Make the definition private to row0log.cc.
    Map the removed values as follows:
    ROW_OP_DELETE_MARK: ROW_OP_DELETE (that is, purge delete-marked
    records straight away).
    ROW_OP_DELETE_UNMARK: ROW_OP_INSERT.
    ROW_OP_PURGE: Remove (purge does not need to log anything).
    ROW_OP_DELETE_PURGE: ROW_OP_DELETE (rollback of INSERT).
    
    dict_index_online_log(): Remove. Declare row_log_online_op() in a wider scope.
    
    row_log_apply_ops(): Do not operate on delete-marked records. Instead,
    purge on delete and insert on delete-unmark.
    
    rb:1390 approved by Jimmy Yang, Sunny Bains
Loading