9. Read Repairを期待する?
CREATE TABLE test1.test1 (
id int PRIMARY KEY,
value1 int,
value2 text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
1.発生率がそもそも低い
10. Read Repairを期待する?
2.すべてのレプリカを都度都度引き当てない
public int blockFor(Keyspace keyspace)
{
switch (this)
{
case ONE:
case LOCAL_ONE:
return 1;
~~snip~~
case QUORUM:
case SERIAL:
return quorumFor(keyspace);
~~snip~~
case LOCAL_QUORUM:
case LOCAL_SERIAL:
return localQuorumFor(keyspace, DatabaseDescriptor.getLocalDataCenter());
private int quorumFor(Keyspace keyspace)
{
return (keyspace.getReplicationStrategy().getReplicationFactor() / 2) + 1;
}
private int localQuorumFor(Keyspace keyspace, String dc)
{
return (keyspace.getReplicationStrategy() instanceof NetworkTopologyStrategy)
? (((NetworkTopologyStrategy) keyspace.getReplicationStrategy()).getReplicationFactor(dc) / 2) + 1
: quorumFor(keyspace);
}
結果としてほぼ発生しない
11. ① Keyspace、CF取得
② Primary Rangeの取得
③ RangeNodeの取得
④ 実行Optionの反映
⑤ submitRepairSession
第1段階
Repairの動き
第2段階
① 対象ノード死活確認
② CFの取得
③ Snapshotの取得
④ Validation(merkle treesの取得要求)
⑤ merkle treesの突き合わせ
⑥ (!整合)Streeming