yifan-c commented on a change in pull request #1379:
URL: https://github.com/apache/cassandra/pull/1379#discussion_r786429599
##########
File path:
src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDC.java
##########
@@ -264,29 +301,31 @@ public void start()
*/
void processNewSegment(CommitLogSegment segment)
{
- // See synchronization in CommitLogSegment.setCDCState
- synchronized(segment.cdcStateLock)
+ int segmentSize = defaultSegmentSize();
+ long allowance = allowableCDCBytes();
+ boolean blocking = DatabaseDescriptor.getCDCBlockWrites();
+
+ synchronized (segment.cdcStateLock)
{
- int segmentSize = defaultSegmentSize();
- long allowance = allowableCDCBytes();
- boolean blocking = DatabaseDescriptor.getCDCBlockWrites();
segment.setCDCState(blocking && segmentSize +
sizeInProgress.get() > allowance
? CDCState.FORBIDDEN
: CDCState.PERMITTED);
- // Remove the oldest cdc segment file when exceeding the CDC
storage allowance
Review comment:
Do you mean this comment line?
```
// See synchronization in CommitLogSegment.setCDCState```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]