Skip to content

Commit

Permalink
[ISSUE apache#3463] Fix the issue of commitLog path error
Browse files Browse the repository at this point in the history
Signed-off-by: zhangyang21 <zhangyang21@xiaomi.com>
  • Loading branch information
Git-Yang committed Dec 3, 2021
1 parent 84bc9e6 commit 1c26076
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.apache.rocketmq.remoting.protocol.RemotingCommand;
import org.apache.rocketmq.store.DefaultMessageStore;
import org.apache.rocketmq.store.MessageExtBrokerInner;
import org.apache.rocketmq.store.MessageStore;
import org.apache.rocketmq.store.PutMessageResult;
import org.apache.rocketmq.store.config.StorePathConfigHelper;
import org.apache.rocketmq.store.stats.BrokerStatsManager;
Expand Down Expand Up @@ -680,7 +681,13 @@ public SocketAddress getStoreHost() {
}

private String diskUtil() {
String storePathPhysic = this.brokerController.getMessageStoreConfig().getStorePathCommitLog();
String storePathPhysic;
MessageStore messageStore = this.brokerController.getMessageStore();
if (messageStore instanceof DefaultMessageStore) {
storePathPhysic = ((DefaultMessageStore) messageStore).getStorePathPhysic();
} else {
storePathPhysic = this.brokerController.getMessageStoreConfig().getStorePathCommitLog();
}
double physicRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathPhysic);

String storePathLogis =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ public String getRunningDataInfo() {
return this.storeStatsService.toString();
}

private String getStorePathPhysic() {
public String getStorePathPhysic() {
String storePathPhysic = "";
if (DefaultMessageStore.this.getMessageStoreConfig().isEnableDLegerCommitLog()) {
storePathPhysic = ((DLedgerCommitLog)DefaultMessageStore.this.getCommitLog()).getdLedgerServer().getdLedgerConfig().getDataStorePath();
Expand Down

0 comments on commit 1c26076

Please sign in to comment.