Skip to content
Snippets Groups Projects
  • Vladimir Davydov's avatar
    f64f4619
    Introduce replica local spaces · f64f4619
    Vladimir Davydov authored
    This patch introduces a new space option, group_id, which defines how
    the space is replicated. If it is 0 (default), the space is replicated
    throughout the entire cluster. If it is 1, the space is replica local,
    i.e. all changes made to it are invisible to other replicas in the
    cluster. Currently, no other value is permitted, but in future we will
    use this option for setting up arbitrary replication groups in a
    cluster. The option can only be set on space creation and cannot be
    altered.
    
    Since the concept of replication groups hasn't been established yet,
    group_id isn't exposed to Lua. Instead, we use is_local flag, both in
    box.schema.space.create arguments and in box.space output.
    
    Technically, to support this feature, we introduce a new header key,
    IPROTO_GROUP_ID, which is set to the space group id for all rows
    corresponding to a space, both in xlog and in snap. Relay won't send
    snapshot rows whose group_id is 1. As for xlog rows, they are
    transformed to IPROTO_NOP so as to promote vclock on replicas without
    any actual data modification.
    
    The feature is currently supported for memtx spaces only, but it should
    be easy to implement it for vinyl spaces as well.
    
    Closes #3443
    
    @TarantoolBot document
    Title: Document new space option - is_local
    If a space is created with is_local flag set in options, changes made to
    the space will be persisted, but won't be replicated.
    f64f4619
    History
    Introduce replica local spaces
    Vladimir Davydov authored
    This patch introduces a new space option, group_id, which defines how
    the space is replicated. If it is 0 (default), the space is replicated
    throughout the entire cluster. If it is 1, the space is replica local,
    i.e. all changes made to it are invisible to other replicas in the
    cluster. Currently, no other value is permitted, but in future we will
    use this option for setting up arbitrary replication groups in a
    cluster. The option can only be set on space creation and cannot be
    altered.
    
    Since the concept of replication groups hasn't been established yet,
    group_id isn't exposed to Lua. Instead, we use is_local flag, both in
    box.schema.space.create arguments and in box.space output.
    
    Technically, to support this feature, we introduce a new header key,
    IPROTO_GROUP_ID, which is set to the space group id for all rows
    corresponding to a space, both in xlog and in snap. Relay won't send
    snapshot rows whose group_id is 1. As for xlog rows, they are
    transformed to IPROTO_NOP so as to promote vclock on replicas without
    any actual data modification.
    
    The feature is currently supported for memtx spaces only, but it should
    be easy to implement it for vinyl spaces as well.
    
    Closes #3443
    
    @TarantoolBot document
    Title: Document new space option - is_local
    If a space is created with is_local flag set in options, changes made to
    the space will be persisted, but won't be replicated.
txn.c 11.86 KiB