dongeforever commented on a change in pull request #751: [RIP-7] Multiple 
Directories Storage Support
URL: https://github.com/apache/rocketmq/pull/751#discussion_r258846365
 
 

 ##########
 File path: 
store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
 ##########
 @@ -1537,27 +1545,35 @@ private boolean isSpaceToDelete() {
             cleanImmediately = false;
 
             {
-                String storePathPhysic = 
DefaultMessageStore.this.getMessageStoreConfig().getStorePathCommitLog();
-                double physicRatio = 
UtilAll.getDiskPartitionSpaceUsedPercent(storePathPhysic);
-                if (physicRatio > diskSpaceWarningLevelRatio) {
-                    boolean diskok = 
DefaultMessageStore.this.runningFlags.getAndMakeDiskFull();
-                    if (diskok) {
-                        DefaultMessageStore.log.error("physic disk maybe full 
soon " + physicRatio + ", so mark disk full");
-                    }
-
-                    cleanImmediately = true;
-                } else if (physicRatio > diskSpaceCleanForciblyRatio) {
-                    cleanImmediately = true;
+                List<String> storePaths;
+                if 
(DefaultMessageStore.this.getMessageStoreConfig().isMultiCommitLogPathEnable()) 
{
+                    storePaths = 
DefaultMessageStore.this.getMessageStoreConfig().getCommitLogStorePaths();
                 } else {
-                    boolean diskok = 
DefaultMessageStore.this.runningFlags.getAndMakeDiskOK();
-                    if (!diskok) {
-                        DefaultMessageStore.log.info("physic disk space OK " + 
physicRatio + ", so mark disk ok");
-                    }
+                    storePaths = 
Collections.singletonList(DefaultMessageStore.this.getMessageStoreConfig().getStorePathCommitLog());
                 }
 
-                if (physicRatio < 0 || physicRatio > ratio) {
-                    DefaultMessageStore.log.info("physic disk maybe full soon, 
so reclaim space, " + physicRatio);
-                    return true;
+                for (String storePathPhysic : storePaths) {
+                    double physicRatio = 
UtilAll.getDiskPartitionSpaceUsedPercent(storePathPhysic);
+                    if (physicRatio > diskSpaceWarningLevelRatio) {
 
 Review comment:
   If all storePath is full, then treat it as full.
   To co-operate with this, the create method should consider the capacity of 
storePath.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to