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

EXECUTE request with skipMetadata=false gets no metadata in response

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 2.1.1
    • Component/s: Legacy/CQL
    • Labels:
      None
    • Severity:
      Normal

      Description

      This has been reported independently with the Java and C++ drivers.

      This happens under heavy load, where multiple client threads prepare and execute statements in parallel. One of them sends an EXECUTE request with skipMetadata=false, but the returned ROWS response has no metadata in it.

      A patch of Message.Dispatcher.channelRead0 confirmed that the flag was incorrectly set on the response:

                      logger.debug("Received: {}, v={}", request, connection.getVersion());
      
                      boolean skipMetadataOnRequest = false;
                      if (request instanceof ExecuteMessage) {
                          ExecuteMessage execute = (ExecuteMessage)request;
                          skipMetadataOnRequest = execute.options.skipMetadata();
                      }
                      response = request.execute(qstate);
      
                      if (request instanceof ExecuteMessage) {
                          Rows rows = (Rows)response;
                          boolean skipMetadataOnResponse = rows.result.metadata.flags.contains(Flag.NO_METADATA);
                          if (skipMetadataOnResponse != skipMetadataOnRequest) {
                              logger.warn("Inconsistent skipMetadata on streamId {}, was {} in request but {} in response",
                                          request.getStreamId(),
                                          skipMetadataOnRequest,
                                          skipMetadataOnResponse);
                          }
                      }
      

      We observed the warning with (false, true) during our tests.

        Attachments

        1. 8054-2.1.txt
          0.8 kB
          Michael Penick
        2. 8054-fix.txt
          0.6 kB
          Aleksey Yeschenko
        3. 8054-v2.txt
          5 kB
          Sylvain Lebresne

          Activity

            People

            • Assignee:
              slebresne Sylvain Lebresne
              Reporter:
              omichallat Olivier Michallat
              Authors:
              Sylvain Lebresne
              Reviewers:
              Tom Hobbs
            • Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: