incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhu Han <schumi....@gmail.com>
Subject Randomly read repair?
Date Sat, 18 Sep 2010 14:39:45 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message