-
Notifications
You must be signed in to change notification settings - Fork 11.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RIP 30] Support Compaction topic #4118
[RIP 30] Support Compaction topic #4118
Conversation
Codecov Report
@@ Coverage Diff @@
## 5.0.0-beta #4118 +/- ##
================================================
- Coverage 43.14% 43.02% -0.12%
- Complexity 6058 6153 +95
================================================
Files 801 810 +9
Lines 57086 57965 +879
Branches 7805 7923 +118
================================================
+ Hits 24630 24941 +311
- Misses 29230 29765 +535
- Partials 3226 3259 +33
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to add an integration test
store/src/main/java/org/apache/rocketmq/store/kv/CompactionService.java
Outdated
Show resolved
Hide resolved
store/src/main/java/org/apache/rocketmq/store/kv/CompactionPositionMgr.java
Show resolved
Hide resolved
CompactionLog log = new CompactionLog(defaultMessageStore, topic, queueId, | ||
offsetMapSize, positionMgr, compactionLogPath, compactionCqPath); | ||
compactionLogTable.put(topic + "_" + queueId, log); | ||
compactionSchedule.scheduleWithFixedDelay(log::doCompaction, compactionInterval, compactionInterval, TimeUnit.SECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different compactionLog files are distinguished by topic and queueId, and do compaction in every compactionLog. Does this mean messages with the same keys must send to the same queue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
MappedFile lastMappedFile = this.mappedFileQueue.getLastMappedFile(); | ||
if (lastMappedFile == null) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to add synchronized
or lock
to ensure thread safety when restoring a ByteBuffer from native?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the method recover
invoked by only one thread, I think there is no need to add synchronized
or lock
a072532
to
c130224
Compare
refer to #3799
the implement was base on 5.0.0-beta