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

change LogRecord.class to MessageLogRecord.class to solve the problem… #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joycgj
Copy link

@joycgj joycgj commented Feb 2, 2020

Hi, guys, I found a problem, after you started delay server, you could see that messages could be written to message_log, but no messages were replayed to schedule_log. I checked the code and found that in LogIterateService#processLog(), then visitor.nextRecord(), readOneRecord(currentBuffer), then in DelayMessageLogVisitor#readOneRecord(SegmentBuffer segmentBuffer), at the last line you could see return LogVisitorRecord.data(new MessageLogRecord(header, recordBytes, wroteOffset, payloadSize, message)), the event.getClass() was MessageLogRecord.

However, in DefaultDelayLogFacade#DefaultDelayLogFacade(final StoreConfiguration config, final Function<ScheduleIndex, Boolean> func), you guys subscribed LogRecord in
bus.subscribe(LogRecord.class, e -> { AppendLogResult<ScheduleIndex> result = appendScheduleLog(e); int code = result.getCode(); if (MessageProducerCode.SUCCESS != code) { LOGGER.error("appendMessageLog schedule log error,log:{} {},code:{}", e.getSubject(), e.getMessageId(), code); throw new AppendException("appendScheduleLogError"); } func.apply(result.getAdditional()); }); bus.subscribe(Record.class, e -> { long checkpoint = e.getStartWroteOffset() + e.getRecordSize(); updateIterateOffset(checkpoint); });

After I fixed the bug and restarted the delay server, it could run correctly.

Please have a review and approve it, thanks.

… message_log can't be replayed to schedule_log
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.

None yet

1 participant