Closed GoogleCodeExporter closed 9 years ago
Original comment by berkeley...@gmail.com
on 8 Sep 2011 at 5:17
Original comment by berkeley...@gmail.com
on 8 Sep 2011 at 5:18
Round-robin assignment of shards to channels is implemented using a new catalog
table called trep_shard_channel that has the structure shown below:
+----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+-------+
| shard_id | varchar(128) | NO | PRI | | |
| channel | int(11) | YES | | NULL | |
+----------+--------------+------+-----+---------+-------+
This persistently stores shard-to-channel assignments. You can enable this
type of round-robin assignment in the shard.list file by setting the
round-robin option as shown below:
# Method for channel hash assignments. Allowed values are round-robin and
# string-hash.
(hash-method)=round-robin
You must take the replicator offline and online for round-robin sharding to
take effect.
During operation the current contents of the shard assignment table is
available using the following new option on trepctl status:
trepctl status -name channel-assignments
This prints current shard channel assignments. The assignments are cleared
whenever the replicator goes offline cleanly. Specifically, whenever the
trep_commit_seqno table is reduced to a single row, the shard assignments table
is also cleared.
You must enable round-robin channel assignment explicitly. Otherwise, the
replicator uses the traditional approach of hashing on the shard ID. This is
still the default behavior.
Original comment by robert.h...@continuent.com
on 15 Dec 2011 at 6:27
Original issue reported on code.google.com by
berkeley...@gmail.com
on 3 Jul 2011 at 11:15