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

Fix buffer length comparison when decompressing in netty-based streaming

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 4.0-alpha1, 4.0
    • None
    • None
    • Normal

    Description

      Streaming a single partition with ~100K rows fails with the following exception:

      ERROR [Stream-Deserializer-/127.0.0.1:35149-a92e5e12] 2017-09-21 04:03:41,237 StreamSession.java:617 - [Stream #c2e5b640-9eab-11e7-99c0-e9864ca8da8e] Streaming error occurred on session with peer 127.0.0.1
      org.apache.cassandra.streaming.StreamReceiveException: java.lang.RuntimeException: Last written key DecoratedKey(-1000328290821038380) >= current key DecoratedKey(-1055007227842125139)  writing into /home/paulo/.ccm/test/node2/data0/stresscql/typestest-482ac7b09e8d11e787cf85d073c
      8e037/na-1-big-Data.db
              at org.apache.cassandra.streaming.messages.IncomingFileMessage$1.deserialize(IncomingFileMessage.java:63) ~[main/:na]
              at org.apache.cassandra.streaming.messages.IncomingFileMessage$1.deserialize(IncomingFileMessage.java:41) ~[main/:na]
              at org.apache.cassandra.streaming.messages.StreamMessage.deserialize(StreamMessage.java:55) ~[main/:na]
              at org.apache.cassandra.streaming.async.StreamingInboundHandler$StreamDeserializingTask.run(StreamingInboundHandler.java:178) ~[main/:na]
              at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
      

      Reproduction steps:

      • Create CCM cluster with 2 nodes
      • Start only first node, disable hinted handoff
      • Run stress with the attached yaml: tools/bin/cassandra-stress "user profile=largepartition.yaml n=10K ops(insert=1) no-warmup -node whitelist 127.0.0.1 -mode native cql3 compression=lz4 -rate threads=4 -insert visits=FIXED(100K) revisit=FIXED(100K)"
      • Start second node, run repair on stresscql table - the exception above will be thrown.

      I investigated briefly and haven't found anything suspicious. This seems to be related to CASSANDRA-12229 as I tested the steps above in a branch without that and the repair completed successfully. I haven't tested with a smaller number of rows per partition to see at which point it starts to be a problem.

      We should probably add a regression dtest to stream large partitions to catch similar problems in the future.

      Attachments

        1. largepartition.yaml
          4 kB
          Paulo Motta

        Issue Links

          Activity

            People

              jasobrown Jason Brown
              pauloricardomg Paulo Motta
              Jason Brown
              Paulo Motta
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: