For VReplication streams, we must choose a tablet to serve the role of vstreamer (source) and vapplier (target) in the replication stream.
Key context for the tablet picker: cells, keyspace, shard, and tablet types (primary/master, replica).
ℹ️ VReplication will only look for tablet pairings within the same cell. If you want to have cross-cell streams then you will need to create a CellAlias that contains the list of potential cells and specify that using the
-cell
flag in your VReplication workflow commands.
The tablet picker logic for is here. It gets a set of valid candidates for the source and target of the stream:
- Source (vstreamer): it uses the random tablet returned by the tablet picker from the viable candidates of the specified types in your workflow command's
-tablet_types
flag⚠️ The default value for the VReplication workflow command's-tablet_types
flag is "PRIMARY/MASTER,REPLICA" - Target (vapplier) : it must choose a viable primary tablet as we need to do writes that are then replicated within the target shard
The relevant callsites are: