Skip to content
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

[Bug] schedule CQ offset invalid. offset=77, cqMinOffset=0, cqMaxOffset=74, queueId=1 #7084

Merged
merged 7 commits into from
Aug 1, 2023

Conversation

weihubeats
Copy link
Member

@weihubeats
Copy link
Member Author

@RongtongJin I understand that it was repaired in this way, take a look

@@ -250,7 +250,6 @@ public boolean correctDelayOffset() {
}
if (correctDelayOffset != currentDelayOffset) {
log.error("correct delay offset [ delayLevel {} ] from {} to {}", delayLevel, currentDelayOffset, correctDelayOffset);
offsetTable.put(delayLevel, correctDelayOffset);
Copy link
Contributor

Choose a reason for hiding this comment

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

If it is not put in the table, the correction will have no effect.

Copy link
Member Author

Choose a reason for hiding this comment

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

So there should be no reloading of the delayOffset.json file here, right?

Comment on lines 221 to 222
boolean result = super.load();
result = result && this.parseDelayLevel();
Copy link
Contributor

Choose a reason for hiding this comment

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

If super.load() is not called, the JSON file will not be parsed, even during startup. IMO, we can add a new method called loadWhenSyncDelayOffset, which will not correct the delay offset when syncDelayOffset is called.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a loadWhenSyncDelayOffset method, called at this.brokerController.getScheduleMessageService().loadWhenSyncDelayOffset();. loadWhenSyncDelayOffset doesn't read delayOffset.json repeatedly.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, we should read delayOffset.json and should not correct the delay offset when slave broker sync delay offset.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know if I understand correctly, but we correct the offset when we initialize the startup, not when we synchronize it

Copy link
Member Author

Choose a reason for hiding this comment

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

This doesn't feel right either.

@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2023

Codecov Report

Merging #7084 (4b3b105) into develop (32eb1d5) will increase coverage by 0.02%.
Report is 4 commits behind head on develop.
The diff coverage is 0.00%.

@@              Coverage Diff              @@
##             develop    #7084      +/-   ##
=============================================
+ Coverage      42.72%   42.74%   +0.02%     
- Complexity      9290     9297       +7     
=============================================
  Files           1138     1138              
  Lines          81249    81257       +8     
  Branches       10635    10638       +3     
=============================================
+ Hits           34714    34734      +20     
+ Misses         42190    42186       -4     
+ Partials        4345     4337       -8     
Files Changed Coverage Δ
...cketmq/broker/schedule/ScheduleMessageService.java 58.15% <0.00%> (-0.42%) ⬇️
...apache/rocketmq/broker/slave/SlaveSynchronize.java 4.16% <0.00%> (ø)

... and 21 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@weihubeats
Copy link
Member Author

weihubeats commented Jul 31, 2023

Do we not need to call correctDelayOffset in syncDelayOffset, because in syncDelayOffset we have already fixed delayOffset.json by MixAll.string2File(delayOffset, fileName)

@RongtongJin RongtongJin merged commit 8bcc948 into apache:develop Aug 1, 2023
9 of 10 checks passed
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.

3 participants