replication: implement an instance id filter for relay
Add a filter for relay to skip rows coming from unwanted instances. A list of instance ids whose rows replica doesn't want to fetch is encoded together with SUBSCRIBE request after a freshly introduced flag IPROTO_ID_FILTER. Filtering rows is needed to prevent an instance from fetching its own rows from a remote master, which is useful on initial configuration and harmful on resubscribe. Prerequisite #4739, #3294 @TarantoolBot document Title: document new binary protocol key and subscribe request changes Add key `IPROTO_ID_FILTER = 0x51` to the internals reference. This is an optional key used in SUBSCRIBE request followed by an array of ids of instances whose rows won't be relayed to the replica. SUBSCRIBE request is supplemented with an optional field of the following structure: ``` +====================+ | ID_FILTER | | 0x51 : ID LIST | | MP_INT : MP_ARRRAY | | | +====================+ ``` The field is encoded only when the id list is not empty.
Showing
- src/box/applier.cc 1 addition, 1 deletionsrc/box/applier.cc
- src/box/box.cc 4 additions, 3 deletionssrc/box/box.cc
- src/box/iproto_constants.h 1 addition, 0 deletionssrc/box/iproto_constants.h
- src/box/relay.cc 14 additions, 1 deletionsrc/box/relay.cc
- src/box/relay.h 2 additions, 1 deletionsrc/box/relay.h
- src/box/xrow.c 37 additions, 3 deletionssrc/box/xrow.c
- src/box/xrow.h 24 additions, 12 deletionssrc/box/xrow.h
Loading
Please register or sign in to comment