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

fix: New Leader Risk Using Values Set By Prev Leader #281

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

Nfrederiksen
Copy link
Collaborator

Consider the case where a leader node dies when trying to setCurrentVod in store. Since this is one of the last values written to store in a VOD_NEXT_INIT state, all other values like vodMediaSeq and mediaSeq are already updated at that point.
So when the follower node becomes the new leader node, it is to take over and perform the VOD_NEXT_INIT state itself. But it does not know if the mediaSeq value for example is from the new vod or the prev vod. It cannot make that distinction. What happens is that it loads the vod and stores a new mediaSeq as (old mediaSeq + old final-vodMediaSeq). But the issue here is that it is using the new mediaSeq value that the prev leader put in.

This results in the leader node creating a mediaSeq that is too large and the stream will have jumped MEDIA-SEQUENCE values equal to the number of mseqs in the prev VOD. This large jump could be confusing to players.

This PR will move up the set operation for the vod object in hopes for there to only be old sequence values in store should it have died/failed setting the new VOD in store.

…there will still only be old values in store
@Nfrederiksen Nfrederiksen merged commit bec15da into master Aug 4, 2023
3 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.

1 participant