cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Zhou (JIRA)" <>
Subject [jira] [Resolved] (CASSANDRA-13877) Potential concurrency issue with CDC size calculation
Date Mon, 18 Sep 2017 22:19:01 GMT


Simon Zhou resolved CASSANDRA-13877.
    Resolution: Invalid

Normally if you have multiple writers (producers), the add operation may use a stale local
copy even if the variable is volatile. Now since we have single producer here, it's safe to
use volatile, as citing from the book:
You can use volatile variables only when all the following criteria are met:
• Writes to the variable do not depend on its current value, or you can ensure
that only a single thread ever updates the value;

Thanks for commenting. I'm closing this ticket.

> Potential concurrency issue with CDC size calculation
> -----------------------------------------------------
>                 Key: CASSANDRA-13877
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Simon Zhou
>            Assignee: Simon Zhou
> We're backporting CDC feature and bug fixes to 3.0. There is potential visibility issue
with two variables {{CDCSizeTracker.sizeInProgress}} and {{DirectorySizeCalculator.size}}
. They're declared as volatile however there are cases that when assigning new values to them,
the new values depend on the current value. For example:
> In rare cases we'll not be able to calculate CDC data size correctly. We should change
these two variables back to AtomicLong, as the simplest fix. Java Concurrency In Practice
section 3.1.3 explains well why we shouldn't use volatile in these two cases. I'll provide
patch shortly.
> cc [~JoshuaMcKenzie] [~jay.zhuang]

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message