maedhroz commented on code in PR #4380:
URL: https://github.com/apache/cassandra/pull/4380#discussion_r2408146058


##########
src/java/org/apache/cassandra/index/sai/disk/v1/segment/SegmentBuilder.java:
##########
@@ -47,7 +47,7 @@ public abstract class SegmentBuilder
     private static long testLastValidSegmentRowId = -1;
 
     /** The number of column indexes being built globally. (Starts at one to 
avoid divide by zero.) */
-    private static final AtomicInteger ACTIVE_BUILDER_COUNT = new 
AtomicInteger(0);
+    private static final AtomicInteger ACTIVE_BUILDER_COUNT = new 
AtomicInteger(1);

Review Comment:
   In the DS fork, we actually do set this to 1, but here in OSS, we start at 
zero and ensure safety by making sure the access and increment/decrement 
operations happen in the correct order below. I would revert this and remove 
the comment. However, that does mean you'll probably get a failure in 
`CompactionTest#testSegmentBuilderFlushWithShardedCompaction()`, which assumes 
we initialize to 1 (and this is correct in the DS fork, of course).



-- 
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]

Reply via email to