ifesdjeen commented on code in PR #4504:
URL: https://github.com/apache/cassandra/pull/4504#discussion_r2581092988


##########
src/java/org/apache/cassandra/journal/Journal.java:
##########
@@ -222,6 +222,27 @@ public void start()
                               "Unexpected journal state after initialization", 
state);
         flusher.start();
         compactor.start();
+
+        final int maxSegments = 100;
+        if (segments.get().count(Segment::isStatic) > maxSegments)
+        {
+            while (true)
+            {
+                WaitQueue.Signal signal = compactor.compacted.register();
+                int count = segments.get().count(Segment::isStatic);
+                if (count <= maxSegments)
+                {
+                    signal.cancel();
+                    logger.info("Only {} static segments; continuing with 
startup", count);
+                    break;
+                }
+                else
+                {
+                    logger.info("Too many ({}) static segments; waiting until 
some compacted before starting up", count);

Review Comment:
   nit: some are compacted maybe?
   (please feel free to ignore)



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