Skip to content

[ISSUE #9254] Refactor CQ-related in DefaultMessageStorage #9256

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

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

qianye1001
Copy link
Contributor

Which Issue(s) This PR Fixes

Fixes #9254

Brief Description

How Did You Test This Change?

@qianye1001 qianye1001 marked this pull request as draft March 17, 2025 12:56
@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 51.43288% with 322 lines in your changes missing coverage. Please review.

Project coverage is 48.22%. Comparing base (c5cd32a) to head (4e9574a).
Report is 27 commits behind head on develop.

Files with missing lines Patch % Lines
...rocketmq/store/queue/CombineConsumeQueueStore.java 41.24% 138 Missing and 13 partials ⚠️
...apache/rocketmq/store/queue/ConsumeQueueStore.java 50.00% 77 Missing and 6 partials ⚠️
...rocketmq/store/queue/RocksDBConsumeQueueStore.java 47.05% 26 Missing and 1 partial ⚠️
...etmq/store/metrics/RocksDBStoreMetricsManager.java 0.00% 16 Missing ⚠️
...pache/rocketmq/store/dledger/DLedgerCommitLog.java 41.17% 6 Missing and 4 partials ⚠️
...ache/rocketmq/store/queue/RocksDBConsumeQueue.java 74.19% 8 Missing ⚠️
...main/java/org/apache/rocketmq/store/CommitLog.java 58.82% 4 Missing and 3 partials ⚠️
...org/apache/rocketmq/store/DefaultMessageStore.java 87.80% 2 Missing and 3 partials ⚠️
...ache/rocketmq/store/config/MessageStoreConfig.java 75.00% 5 Missing ⚠️
...ocketmq/store/queue/AbstractConsumeQueueStore.java 69.23% 3 Missing and 1 partial ⚠️
... and 4 more
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #9256      +/-   ##
=============================================
+ Coverage      48.11%   48.22%   +0.10%     
- Complexity     12110    12229     +119     
=============================================
  Files           1322     1324       +2     
  Lines          93126    93576     +450     
  Branches       11940    12023      +83     
=============================================
+ Hits           44812    45126     +314     
- Misses         42775    42872      +97     
- Partials        5539     5578      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@qianye1001 qianye1001 changed the title [ISSUE #9254] Refactor DefaultMessageStorage type/enhancement [ISSUE #9254] Refactor DefaultMessageStorage Mar 18, 2025
@qianye1001 qianye1001 marked this pull request as ready for review March 18, 2025 03:31
@qianye1001 qianye1001 changed the title [ISSUE #9254] Refactor DefaultMessageStorage [ISSUE #9254] Refactor CQ-related thread in DefaultMessageStorage Mar 18, 2025
@qianye1001 qianye1001 changed the title [ISSUE #9254] Refactor CQ-related thread in DefaultMessageStorage [ISSUE #9254] Refactor CQ-related in DefaultMessageStorage Mar 19, 2025
@qianye1001 qianye1001 force-pushed the Refactor-DefaultMessageStore branch 2 times, most recently from ad190f2 to 61ee2f4 Compare March 25, 2025 07:03
@qianye1001 qianye1001 force-pushed the Refactor-DefaultMessageStore branch 2 times, most recently from dc014b5 to a8996fa Compare April 10, 2025 07:03
@qianye1001 qianye1001 force-pushed the Refactor-DefaultMessageStore branch from da78405 to 59ee17a Compare April 18, 2025 03:33
return this.consumeQueueStore.getMinOffsetInQueue(topic, queueId);
} catch (RocksDBException e) {
ERROR_LOG.error("getMinOffsetInQueue Failed. topic: {}, queueId: {}", topic, queueId, e);
return -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure here the default value is -1, but not 0.

@@ -480,4 +486,21 @@ public CqUnit nextAndRelease() {
}
}
}

public void initializeWithOffset(long offset) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used for mount --> main in container mode? If so, add some java docs here.


// update the max and min offset
if (offset > 0) {
this.consumeQueueStore.updateCqOffset(topic, queueId, 0L, offset - 1, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about use two methods for updating CQ offset for min and max offsets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Refactor CQ-related thread in DefaultMessageStorage
4 participants