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

Include keyspace and table names in logs where possible

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Fix Version/s: 2.1.x
    • Component/s: None
    • Labels:
    • Complexity:
      Low Hanging Fruit

      Description

      Most error messages and stacktraces give you no clue as to what keyspace or table was causing the problem. For example:

      ERROR [MutationStage:61648] 2014-05-20 12:05:45,145 CassandraDaemon.java (line 198) Exception in thread Thread[MutationStage:61648,5,main]
      java.lang.IllegalArgumentException
          at java.nio.Buffer.limit(Unknown Source)
          at org.apache.cassandra.db.marshal.AbstractCompositeType.getBytes(AbstractCompositeType.java:63)
          at org.apache.cassandra.db.marshal.AbstractCompositeType.getWithShortLength(AbstractCompositeType.java:72)
          at org.apache.cassandra.db.marshal.AbstractCompositeType.compare(AbstractCompositeType.java:98)
          at org.apache.cassandra.db.marshal.AbstractCompositeType.compare(AbstractCompositeType.java:35)
          at edu.stanford.ppl.concurrent.SnapTreeMap$1.compareTo(SnapTreeMap.java:538)
          at edu.stanford.ppl.concurrent.SnapTreeMap.attemptUpdate(SnapTreeMap.java:1108)
          at edu.stanford.ppl.concurrent.SnapTreeMap.updateUnderRoot(SnapTreeMap.java:1059)
          at edu.stanford.ppl.concurrent.SnapTreeMap.update(SnapTreeMap.java:1023)
          at edu.stanford.ppl.concurrent.SnapTreeMap.putIfAbsent(SnapTreeMap.java:985)
          at org.apache.cassandra.db.AtomicSortedColumns$Holder.addColumn(AtomicSortedColumns.java:328)
          at org.apache.cassandra.db.AtomicSortedColumns.addAllWithSizeDelta(AtomicSortedColumns.java:200)
          at org.apache.cassandra.db.Memtable.resolve(Memtable.java:226)
          at org.apache.cassandra.db.Memtable.put(Memtable.java:173)
          at org.apache.cassandra.db.ColumnFamilyStore.apply(ColumnFamilyStore.java:893)
          at org.apache.cassandra.db.Keyspace.apply(Keyspace.java:368)
          at org.apache.cassandra.db.Keyspace.apply(Keyspace.java:333)
          at org.apache.cassandra.db.RowMutation.apply(RowMutation.java:206)
          at org.apache.cassandra.db.RowMutationVerbHandler.doVerb(RowMutationVerbHandler.java:56)
          at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:60)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
      

      We should try to include info on the keyspace and column family in the error messages or logs whenever possible. This includes reads, writes, compactions, flushes, repairs, and probably more.

        Attachments

        1. 0001-Better-Logging-for-KS-and-CF.patch
          34 kB
          Anubhav Kale
        2. 0001-Consistent-KS-and-Table-Logging.patch
          71 kB
          Anubhav Kale
        3. 0001-Logging-for-Keyspace-and-Tables.patch
          31 kB
          Anubhav Kale
        4. 0001-Logging-KS-and-CF-consistently.patch
          35 kB
          Anubhav Kale
        5. 2.1-CASSANDRA-7276-v1.txt
          4 kB
          J.P. Eiti Kimura
        6. cassandra-2.1.9-7276.txt
          24 kB
          J.P. Eiti Kimura
        7. cassandra-2.1.9-7276-v2.txt
          51 kB
          J.P. Eiti Kimura
        8. cassandra-2.1-7276.txt
          1 kB
          Nitzan Volman
        9. cassandra-2.1-7276-compaction.txt
          1.0 kB
          Nitzan Volman

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              thobbs Tom Hobbs
            • Votes:
              5 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

              • Created:
                Updated: