[
https://issues.apache.org/jira/browse/ROCKETMQ-27?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15965746#comment-15965746
]
ASF GitHub Bot commented on ROCKETMQ-27:
----------------------------------------
Github user Jaskey commented on the issue:
https://github.com/apache/incubator-rocketmq/pull/28
As far as I know, rocketmq will clean the unexpired files as long as space
is 85% full and cleanFileForciblyEnable=true(true by default)
Please refer to the code snippet
```
public int deleteExpiredFileByTime(final long expiredTime,
final int deleteFilesInterval,
final long intervalForcibly,
final boolean cleanImmediately) {
Object[] mfs = this.copyMappedFiles(0);
if (null == mfs)
return 0;
int mfsLength = mfs.length - 1;
int deleteCount = 0;
List<MappedFile> files = new ArrayList<MappedFile>();
if (null != mfs) {
for (int i = 0; i < mfsLength; i++) {
MappedFile mappedFile = (MappedFile) mfs[i];
long liveMaxTimestamp =
mappedFile.getLastModifiedTimestamp() + expiredTime;
if (System.currentTimeMillis() >= liveMaxTimestamp ||
cleanImmediately) { // here , it will clean the non expire files as long as
cleanImmediately=true
if (mappedFile.destroy(intervalForcibly)) {
files.add(mappedFile);
deleteCount++;
if (files.size() >= DELETE_FILES_BATCH_MAX) {
break;
}
if (deleteFilesInterval > 0 && (i + 1) < mfsLength)
{
try {
Thread.sleep(deleteFilesInterval);
} catch (InterruptedException e) {
}
}
} else {
break;
}
}
}
}
deleteExpiredFile(files);
return deleteCount;
}
```
> Add storage partition online
> ----------------------------
>
> Key: ROCKETMQ-27
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-27
> Project: Apache RocketMQ
> Issue Type: New Feature
> Components: rocketmq-store, rocketmq-tools
> Affects Versions: 4.1.0-incubating
> Reporter: Zhanhui Li
> Assignee: vongosling
> Fix For: 4.1.0-incubating
>
>
> RocketMQ broker stores all messages before they are expired, which requires
> pretty much storage for a high load system. For now, the message store can be
> configured to use only one partition. Quite often, we find broker runs out of
> storage as business expands quickly. Online resizing a partition most of time
> is not possible(with absence of LVM) whilst attaching a new disk/partition in
> cloud environment is super easy.
> It would be nice for RocketMQ to be capable of adding extra commit log store
> path online, allocating commit log files onto partitions based on
> free/available space.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)