incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Randomly read repair?
Date Sun, 19 Sep 2010 19:44:52 GMT
You're right, the simplest fix here is to just always do the re-read
in the strong path.  Done in r998720.

(IMO the "right" thing is more complicated -- we shouldn't send
requests to _all_ the replicas on the _first_ read with CL.QUORUM,
except as dictated by randomlyReadRepair.)

On Sat, Sep 18, 2010 at 9:39 AM, Zhu Han <schumi.han@gmail.com> wrote:
> Hi,
>
> I notice below code snippet in StorageProxy#strongRead(). Why the read
> repair is still trigged randomly if digest  is mis-matched  for CL.Quorum
> and CL.ALL. IMHO, the client wants the result to be returned is the
> consistent one on those two CL.  Read repair should be triggered
> definitively here.
>
> If the client does not care about consistency, CL.ONE is the definitive
> choice. For this level, read repair can be trigged randomly per the
> configuration of key space.
>
>            try
>>             {
>>                 long startTime2 = System.currentTimeMillis();
>>                 row = quorumResponseHandler.get();
>>                 if (row != null)
>>                     rows.add(row);
>>
>>                 if (logger.isDebugEnabled())
>>                     logger.debug("quorumResponseHandler: " + (System.
>> currentTimeMillis() - startTime2) + " ms.");
>>             }
>>             catch (DigestMismatchException ex)
>>             {
>>                 if (randomlyReadRepair(command))
>>                 {
>>                     AbstractReplicationStrategy rs = StorageService.
>> instance.getReplicationStrategy(command.table);
>>                     QuorumResponseHandler<Row> qrhRepair = rs.
>> getQuorumResponseHandler(new ReadResponseResolver(command.table),
>> ConsistencyLevel.QUORUM);
>>                     if (logger.isDebugEnabled())
>>                         logger.debug("Digest mismatch:", ex);
>>                     Message messageRepair = command.makeReadMessage();
>>                     MessagingService.instance.sendRR(messageRepair,
>> commandEndpoints.get(i), qrhRepair);
>>                     if (repairResponseHandlers == null)
>>                         repairResponseHandlers = new ArrayList<
>> QuorumResponseHandler<Row>>();
>>                     repairResponseHandlers.add(qrhRepair);
>>                 }
>>
>
>
>
>
> best regards,
> hanzhu
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Mime
View raw message