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

Reduce thread contention in CommitLogSegment and HintsBuffer by rewriting CAS loops to atomic adds

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Change Category:
      Performance
    • Platform:
      All
    • Impacts:
      None
    • Test and Documentation Plan:
      Hide

      ci-cassandra.a.o

      Show
      ci-cassandra.a.o

      Description

      Follow up to CASSANDRA-15922

      Both CommitLogSegment and HintsBuffer use AtomicIntegers for the current offset when allocating. Like in CASSANDRA-15922 the loops on .compareAndSet(..) can be replaced with atomic adds using the . getAndAdd(..) method.

      In highly contended environments the CAS failures can be high, starving writes in a running Cassandra node. On the same cluster CASSANDRA-15922 was found, after CASSANDRA-15922's fix was deployed, there was still problems around commit log flushing and hints. No flamegraph was collected that demonstrated the thread contention as clearly as was found in CASSANDRA-15922, but the performance fix proposed here hopefully is obvious enough.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              mck Michael Semb Wever Assign to me
              Reporter:
              mck Michael Semb Wever
              Authors:
              Michael Semb Wever
              Reviewers:
              Benjamin Lerer, Berenguer Blasi

              Dates

              • Created:
                Updated:

                Issue deployment