Skip to content

MINOR; Remove duplicate updateLeaderEndOffsetAndTimestamp#9638

Closed
dengziming wants to merge 2 commits into
apache:trunkfrom
dengziming:remove-duplicate-updateLeo
Closed

MINOR; Remove duplicate updateLeaderEndOffsetAndTimestamp#9638
dengziming wants to merge 2 commits into
apache:trunkfrom
dengziming:remove-duplicate-updateLeo

Conversation

@dengziming
Copy link
Copy Markdown
Member

@dengziming dengziming commented Nov 22, 2020

The KafkaRaftClient.onBecomeLeader will invoke appendLeaderChangeMessage, the call stack are:

1. appendLeaderChangeMessage
    1.1 flushLeaderLog
        1.1.1 updateLeaderEndOffsetAndTimestamp
        1.1.2 log.flush()

so the updateLeaderEndOffsetAndTimestamp is already invoked, and updateLeaderEndOffsetAndTimestamp should only be invoked after leo change(or time change), since log.flush() will not change leo(and time), it's unnessary to invoke twice.

@dengziming
Copy link
Copy Markdown
Member Author

ping @hachikuji to have a look.

@dengziming dengziming changed the title MINOR; Remove duplicate update updateLeaderEndOffsetAndTimestamp MINOR; Remove duplicate updateLeaderEndOffsetAndTimestamp Nov 24, 2020
@dengziming dengziming closed this Mar 16, 2021
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.

1 participant