adrianco / spigo

Simulate Protocol Interactions in Go
Apache License 2.0
1.12k stars 111 forks source link

Model cassandra behaviors more accurately #54

Open adrianco opened 9 years ago

adrianco commented 9 years ago

First pass at hash based sharding in priamCassandra seems to work well enough for now. priamCassandra_test.go shows the token assignments and how balanced the hash is across nodes

cass5:0,cass6:268435455,cass8:536870910,cass1:805306365,cass7:1073741820,cass12:1342177275,cass13:1610612730,cass0:1879048185,cass4:2147483640,cass9:2415919095,cass14:2684354550,cass15:2952790005,cass2:3221225460,cass3:3489660915,cass10:3758096370,cass11:4026531825
map[6:55 1:60 13:65 5:51 4:79 7:54 14:69 12:60 15:82 10:64 2:63 3:56 11:59 8:62 0:64 9:57]

For now the ring token assignments are only setup within each zone, so when replicating a Put messages are sent to a random node in the right zone or region, which then passes them on to the right place. This should be extended so that each node gossips it's ring to the other zones and regions.

adrianco commented 9 years ago

Flow records are now stored for every step and traces are logged to json_metrics/_flow.json but currently as raw maps.

Since the chaosmonkey deletes nodes, if it deletes a node that has a GetResponse flowing back up through it, spigo crashes. I've only seen this race condition once so far in many runs.