Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-14983

Local reads potentially blocking remote reads



    • Bug
    • Status: Open
    • Low
    • Resolution: Unresolved
    • None
    • None
    • Low


      Since CASSANDRA-4718 there is a fast path allowing local requests to continue to work in the same thread rather than being sent over to the read stage.

      Based on the comment

      // We delay the local (potentially blocking) read till the end to avoid stalling remote requests.

      it seems like this should be performed last in the chain to avoid blocking remote requests but that does not seem to be the case when the local request is a data request. The digest request(s) are sent after the data requests are sent (and now the transient replica requests as well). When the fast path is used for local data/transient data requests this will block the next type of request from being sent away until the local read is finished and add additional latency to the request.

      In addition to this it seems like local requests are always data requests (might not be a problem), but the log message can say either "digest" or "data" as the type of request.

      I have tried to run performance measurements to see the impact of this in 3.0 (by moving local requests to the end of ARE#executeAsync()) but I haven't seen any big difference yet. I'll continue to run some more tests to see if I can find a use case affected by this.

      Attaching a trace (3.0) where this happens. Reproduction:

      1. Create a three node CCM cluster
      2. Provision data with stress (rf=3)
      3. In parallel:
        1. Start stress read run
        2. Run multiple manual read queries in cqlsh with tracing on and local_quorum (as this does not always happen)


        1. graph_local_read_trunk.html
          310 kB
          Marcus Olsson
        2. graph_local_read.html
          414 kB
          Marcus Olsson
        3. local_read_trace.log
          9 kB
          Marcus Olsson



            molsson Marcus Olsson
            molsson Marcus Olsson
            Marcus Olsson
            Benedict Elliott Smith
            0 Vote for this issue
            7 Start watching this issue