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

counters++ lock on cells, not partitions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.1 beta2
    • None
    • None

    Description

      I'm starting to think that we should switch to locking by cells, not by partitions, when updating counters.

      With the current 2.1 counters, if nothing changes, the new recommendation would become "use smaller partitions, batch updates to the same partition", and that goes against what we usually recommend:
      1. Prefer wide partitions to narrow partitions
      2. Don't batch counter updates (because you risk to exaggerate undercounting/overcounting in case of a timeout)

      Locking on cells would cause C* to have to grab more locks for batch counter updates, but would give us generally more predictable performance (independent of partition wideness), and won't force people to remodel their data model if they have often concurrently-updated counters in the same few wide partitions.

      (It's a small change, code-wise)

      Attachments

        Issue Links

          Activity

            People

              aleksey Aleksey Yeschenko
              aleksey Aleksey Yeschenko
              Aleksey Yeschenko
              Benedict Elliott Smith
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: